google-geocode 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +15 -0
- data/{LICENSE → LICENSE.txt} +0 -0
- data/Manifest.txt +3 -2
- data/{README → README.txt} +1 -1
- data/Rakefile +16 -57
- data/lib/google_geocode.rb +10 -4
- data/test/test_google_geocode.rb +2 -0
- metadata +21 -11
data/History.txt
ADDED
data/{LICENSE → LICENSE.txt}
RENAMED
File without changes
|
data/Manifest.txt
CHANGED
data/{README → README.txt}
RENAMED
data/Rakefile
CHANGED
@@ -1,68 +1,27 @@
|
|
1
|
-
require '
|
2
|
-
require 'rake'
|
3
|
-
require 'rake/testtask'
|
4
|
-
require 'rake/rdoctask'
|
5
|
-
require 'rake/gempackagetask'
|
1
|
+
require 'hoe'
|
6
2
|
|
7
|
-
|
3
|
+
require './lib/google_geocode'
|
8
4
|
|
9
|
-
|
10
|
-
s.name = 'google-geocode'
|
11
|
-
s.version = '1.2.0'
|
12
|
-
s.summary = 'Google Geocoder API Library'
|
13
|
-
s.description = 'Map addresses to latitude and longitude with Google\'s Geocoder.'
|
14
|
-
s.author = 'Eric Hodel'
|
15
|
-
s.email = 'eric@robotcoop.com'
|
5
|
+
DEV_DOC_PATH = 'Libraries/google-geocode'
|
16
6
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
task :default => [ :test ]
|
7
|
+
hoe = Hoe.new 'google-geocode', GoogleGeocode::VERSION do |p|
|
8
|
+
p.summary = 'Google Geocoder API Library'
|
9
|
+
p.description = 'Map addresses to latitude and longitude with Google\'s Geocoder.'
|
10
|
+
p.author = 'Eric Hodel'
|
11
|
+
p.email = 'drbrain@segment7.net'
|
12
|
+
p.url = "http://dev.robotcoop.com/#{DEV_DOC_PATH}"
|
13
|
+
p.changes = File.read('History.txt').scan(/\A(=.*?)^=/m).first.first
|
14
|
+
p.rubyforge_name = 'rctools'
|
26
15
|
|
27
|
-
|
28
|
-
t.libs << '../rc-rest/lib'
|
29
|
-
t.pattern = 'test/test_*.rb'
|
30
|
-
t.verbose = true
|
16
|
+
p.extra_deps << ['rc-rest', '>= 2.0.0']
|
31
17
|
end
|
32
18
|
|
33
|
-
|
34
|
-
task :update_manifest do
|
35
|
-
sh "find . -type f | sed -e 's%./%%' | egrep -v 'svn|swp|~' | egrep -v '^(doc|pkg)/' | sort > Manifest.txt"
|
36
|
-
end
|
37
|
-
|
38
|
-
desc 'Generate RDoc'
|
39
|
-
Rake::RDocTask.new :rdoc do |rd|
|
40
|
-
rd.rdoc_dir = 'doc'
|
41
|
-
rd.rdoc_files.add 'lib', 'README', 'LICENSE'
|
42
|
-
rd.main = 'README'
|
43
|
-
rd.options << '-d' if `which dot` =~ /\/dot/
|
44
|
-
rd.options << '-t Google Geocode'
|
45
|
-
end
|
19
|
+
SPEC = hoe.spec
|
46
20
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
rd.rdoc_files.add 'lib', 'README', 'LICENSE'
|
51
|
-
rd.main = 'README'
|
52
|
-
rd.options << '-d' if `which dot` =~ /\/dot/
|
53
|
-
rd.options << '-t Google Geocode'
|
21
|
+
begin
|
22
|
+
require '../tasks'
|
23
|
+
rescue LoadError
|
54
24
|
end
|
55
25
|
|
56
|
-
desc 'Build Gem'
|
57
|
-
Rake::GemPackageTask.new spec do |pkg|
|
58
|
-
pkg.need_tar = true
|
59
|
-
end
|
60
|
-
|
61
|
-
desc 'Clean up'
|
62
|
-
task :clean => [ :clobber_rdoc, :clobber_package ]
|
63
|
-
|
64
|
-
desc 'Clean up'
|
65
|
-
task :clobber => [ :clean ]
|
66
|
-
|
67
26
|
# vim: syntax=Ruby
|
68
27
|
|
data/lib/google_geocode.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'rubygems'
|
1
2
|
require 'rc_rest'
|
2
3
|
|
3
4
|
##
|
@@ -7,6 +8,11 @@ require 'rc_rest'
|
|
7
8
|
|
8
9
|
class GoogleGeocode < RCRest
|
9
10
|
|
11
|
+
##
|
12
|
+
# This is the version you are running.
|
13
|
+
|
14
|
+
VERSION = '1.2.1'
|
15
|
+
|
10
16
|
##
|
11
17
|
# Base error class
|
12
18
|
|
@@ -35,14 +41,14 @@ class GoogleGeocode < RCRest
|
|
35
41
|
|
36
42
|
def initialize(key)
|
37
43
|
@key = key
|
38
|
-
@url = URI.parse 'http://maps.google.com/maps/
|
44
|
+
@url = URI.parse 'http://maps.google.com/maps/'
|
39
45
|
end
|
40
46
|
|
41
47
|
##
|
42
48
|
# Locates +address+ returning a Location struct.
|
43
49
|
|
44
50
|
def locate(address)
|
45
|
-
get :q => address
|
51
|
+
get :geo, :q => address
|
46
52
|
end
|
47
53
|
|
48
54
|
##
|
@@ -87,11 +93,11 @@ class GoogleGeocode < RCRest
|
|
87
93
|
# Creates a URL from the Hash +params+. Automatically adds the key and
|
88
94
|
# sets the output type to 'xml'.
|
89
95
|
|
90
|
-
def make_url(params)
|
96
|
+
def make_url(method, params)
|
91
97
|
params[:key] = @key
|
92
98
|
params[:output] = 'xml'
|
93
99
|
|
94
|
-
super params
|
100
|
+
super method, params
|
95
101
|
end
|
96
102
|
|
97
103
|
end
|
data/test/test_google_geocode.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.0.6
|
3
3
|
specification_version: 1
|
4
4
|
name: google-geocode
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.2.
|
7
|
-
date: 2006-
|
6
|
+
version: 1.2.1
|
7
|
+
date: 2006-11-27 00:00:00 -08:00
|
8
8
|
summary: Google Geocoder API Library
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
|
-
email:
|
12
|
-
homepage:
|
13
|
-
rubyforge_project:
|
11
|
+
email: drbrain@segment7.net
|
12
|
+
homepage: http://dev.robotcoop.com/Libraries/google-geocode
|
13
|
+
rubyforge_project: rctools
|
14
14
|
description: Map addresses to latitude and longitude with Google's Geocoder.
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
@@ -29,14 +29,15 @@ post_install_message:
|
|
29
29
|
authors:
|
30
30
|
- Eric Hodel
|
31
31
|
files:
|
32
|
-
-
|
32
|
+
- History.txt
|
33
|
+
- LICENSE.txt
|
33
34
|
- Manifest.txt
|
34
|
-
- README
|
35
|
+
- README.txt
|
35
36
|
- Rakefile
|
36
37
|
- lib/google_geocode.rb
|
37
38
|
- test/test_google_geocode.rb
|
38
|
-
test_files:
|
39
|
-
|
39
|
+
test_files:
|
40
|
+
- test/test_google_geocode.rb
|
40
41
|
rdoc_options: []
|
41
42
|
|
42
43
|
extra_rdoc_files: []
|
@@ -48,6 +49,15 @@ extensions: []
|
|
48
49
|
requirements: []
|
49
50
|
|
50
51
|
dependencies:
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: hoe
|
54
|
+
version_requirement:
|
55
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 1.1.4
|
60
|
+
version:
|
51
61
|
- !ruby/object:Gem::Dependency
|
52
62
|
name: rc-rest
|
53
63
|
version_requirement:
|
@@ -55,5 +65,5 @@ dependencies:
|
|
55
65
|
requirements:
|
56
66
|
- - ">="
|
57
67
|
- !ruby/object:Gem::Version
|
58
|
-
version:
|
68
|
+
version: 2.0.0
|
59
69
|
version:
|