From c85e266af3c1a5d868b57092176ec4336a97b831 Mon Sep 17 00:00:00 2001 From: Alex Reisner <alex@alexreisner.com> Date: Thu, 1 Oct 2009 12:27:51 -0400 Subject: [PATCH] Add gem installation to documentation. --- README.rdoc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.rdoc b/README.rdoc index 1919bc2c..7f9c7bab 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,13 +1,21 @@ = Geocoder -Geocoder is a plugin for Rails that provides database-agnostic object geocoding (via Google) and some utilities for working with geocoded objects. It does not rely on proprietary database functions so reasonably accurate distances can be calculated in MySQL or even SQLite. +Geocoder adds database-agnostic object geocoding to Rails (via Google). It does not rely on proprietary database functions so reasonably accurate distances can be calculated in MySQL or even SQLite. == Setup -Use the Rails plugin install script: +Install either *as a plugin*: script/plugin install git://github.com/alexreisner/geocoder.git +or *as a gem*: + + # add to config/environment.rb: + config.gem :geocoder, :source => "http://gemcutter.org/" + + # at command prompt: + sudo rake gems:install + To add geocoding features to a class: geocoded_by :location @@ -45,7 +53,7 @@ Assuming +obj+ has a valid string for its +location+: Assuming +obj+ is geocoded (has latitude and longitude): - obj.nearbys(30) # other objects within radius + obj.nearbys(30) # other objects within 30 miles obj.distance_to(40.714, -100.234) # distance to arbitrary point Some utility methods are also available: -- GitLab