greatseth-google-geo 2.0 → 2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/Manifest +2 -2
- data/{README → README.textile} +13 -16
- data/Rakefile +2 -1
- data/google-geo.gemspec +9 -9
- data/lib/google/geo.rb +1 -32
- metadata +8 -8
data/CHANGELOG
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
v2.1. Added a LICENSE and RubyForge publishing support. Fixed Rakefile.
|
2
|
+
|
1
3
|
v2.0. Multiple Addresses (and tests you can actually run!); Not insignificant API change: *** Google::Geo#locate ALWAYS RETURNS AN ARRAY ***; There are now some nice examples in the README; Updated to include the fixtures and vendor dependencies for tests, yeknow, so you can actually run them; No namby pamby point releases. This is serious, folks.
|
2
4
|
|
3
5
|
v1.0. Initial Release
|
data/Manifest
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
CHANGELOG
|
2
2
|
lib/google/geo.rb
|
3
3
|
LICENSE
|
4
|
+
Manifest
|
4
5
|
Rakefile
|
5
|
-
README
|
6
|
+
README.textile
|
6
7
|
test/fixtures/invalid_map_key.xml
|
7
8
|
test/fixtures/missing_address.xml
|
8
9
|
test/fixtures/server_error.xml
|
@@ -64,4 +65,3 @@ vendor/mocha-0.4.0/test/stubba_acceptance_test.rb
|
|
64
65
|
vendor/mocha-0.4.0/test/stubba_integration_test.rb
|
65
66
|
vendor/mocha-0.4.0/test/stubba_test_result_integration_test.rb
|
66
67
|
vendor/mocha-0.4.0/test/test_helper.rb
|
67
|
-
Manifest
|
data/{README → README.textile}
RENAMED
@@ -1,35 +1,32 @@
|
|
1
|
-
|
1
|
+
h1. Google::Geo
|
2
2
|
|
3
3
|
A simple, elegant library for getting geocoding information from Google Maps. Very much inspired by the google-geocode gem, but completely dependency free!
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
h2. Examples
|
6
|
+
|
7
7
|
geo = Google::Geo.new API_KEY
|
8
|
-
|
9
|
-
addresses = geo.locate '1600 Amphitheatre Parkway, Mountain View, CA'
|
10
8
|
|
9
|
+
addresses = geo.locate '1600 Amphitheatre Parkway, Mountain View, CA'
|
11
10
|
addresses.size # 1, :locate always returns an Array
|
12
11
|
|
13
12
|
address = addresses.first
|
14
|
-
|
15
13
|
address.country # 'US'
|
16
14
|
address.city # 'Mountain View'
|
17
|
-
address.full_address # '1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA'
|
18
|
-
|
15
|
+
address.full_address # '1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA'
|
19
16
|
address.query # '1600 Amphitheatre Parkway, Mountain View, CA'
|
20
17
|
address.accuracy # 8
|
21
|
-
|
18
|
+
address.coordinates # [-122.084143, 37.421972, 0.0]
|
19
|
+
|
22
20
|
In the case of sufficiently vague queries, Google::Geo will return more than one:
|
23
|
-
|
21
|
+
|
24
22
|
addresses = geo.locate 'hell'
|
25
|
-
|
26
23
|
addresses.size # 2
|
27
24
|
addresses.map { |a| a.state } # ['PA', 'NC']
|
25
|
+
|
26
|
+
h2. Contributors
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
Seth Thomas Rasmussen - http://greatseth.com - sethrasmussen@gmail.com
|
28
|
+
Seth Thomas Rasmussen - "http://greatseth.com":http://greatseth.com
|
32
29
|
|
33
|
-
|
30
|
+
h2. License
|
34
31
|
|
35
|
-
(c) 2007-2008 Seth Thomas Rasmussen and released under the WTFPL. See the LICENSE file for details.
|
32
|
+
(c) 2007-2008 Seth Thomas Rasmussen and released under the WTFPL. See the LICENSE file for details.
|
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
README = File.readlines "#{File.dirname __FILE__}/README"
|
1
|
+
README = File.readlines "#{File.dirname __FILE__}/README.textile"
|
2
2
|
|
3
3
|
require "echoe"
|
4
4
|
|
@@ -7,4 +7,5 @@ Echoe.new "google-geo" do |p|
|
|
7
7
|
p.email = "sethrasmussen@gmail.com"
|
8
8
|
p.url = "http://github.com/greatseth/google-geo"
|
9
9
|
p.summary = README[2]
|
10
|
+
p.project = "greatseth"
|
10
11
|
end
|
data/google-geo.gemspec
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
|
2
|
-
# Gem::Specification for Google-geo-2.
|
2
|
+
# Gem::Specification for Google-geo-2.1
|
3
3
|
# Originally generated by Echoe
|
4
4
|
|
5
5
|
--- !ruby/object:Gem::Specification
|
6
6
|
name: google-geo
|
7
7
|
version: !ruby/object:Gem::Version
|
8
|
-
version: "2.
|
8
|
+
version: "2.1"
|
9
9
|
platform: ruby
|
10
10
|
authors:
|
11
11
|
- Seth Thomas Rasmussen
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
|
15
|
-
date: 2008-
|
15
|
+
date: 2008-09-29 00:00:00 -04:00
|
16
16
|
default_executable:
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
@@ -35,13 +35,14 @@ extra_rdoc_files:
|
|
35
35
|
- CHANGELOG
|
36
36
|
- lib/google/geo.rb
|
37
37
|
- LICENSE
|
38
|
-
- README
|
38
|
+
- README.textile
|
39
39
|
files:
|
40
40
|
- CHANGELOG
|
41
41
|
- lib/google/geo.rb
|
42
42
|
- LICENSE
|
43
|
+
- Manifest
|
43
44
|
- Rakefile
|
44
|
-
- README
|
45
|
+
- README.textile
|
45
46
|
- test/fixtures/invalid_map_key.xml
|
46
47
|
- test/fixtures/missing_address.xml
|
47
48
|
- test/fixtures/server_error.xml
|
@@ -103,7 +104,6 @@ files:
|
|
103
104
|
- vendor/mocha-0.4.0/test/stubba_integration_test.rb
|
104
105
|
- vendor/mocha-0.4.0/test/stubba_test_result_integration_test.rb
|
105
106
|
- vendor/mocha-0.4.0/test/test_helper.rb
|
106
|
-
- Manifest
|
107
107
|
- google-geo.gemspec
|
108
108
|
has_rdoc: true
|
109
109
|
homepage: http://github.com/greatseth/google-geo
|
@@ -114,7 +114,7 @@ rdoc_options:
|
|
114
114
|
- --title
|
115
115
|
- Google-geo
|
116
116
|
- --main
|
117
|
-
- README
|
117
|
+
- README.textile
|
118
118
|
require_paths:
|
119
119
|
- lib
|
120
120
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -125,13 +125,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version:
|
126
126
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
|
-
- - "
|
128
|
+
- - ">="
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: "1.2"
|
131
131
|
version:
|
132
132
|
requirements: []
|
133
133
|
|
134
|
-
rubyforge_project:
|
134
|
+
rubyforge_project: greatseth
|
135
135
|
rubygems_version: 1.2.0
|
136
136
|
specification_version: 2
|
137
137
|
summary: A simple, elegant library for getting geocoding information from Google Maps. Very much inspired by the google-geocode gem, but completely dependency free!
|
data/lib/google/geo.rb
CHANGED
@@ -1,38 +1,7 @@
|
|
1
1
|
require 'open-uri'
|
2
2
|
|
3
3
|
module Google
|
4
|
-
|
5
|
-
# = Google::Geo
|
6
|
-
#
|
7
|
-
# A simple, elegant library for getting geocoding information from Google Maps. Very much inspired by the google-geocode gem, but completely dependency free!
|
8
|
-
#
|
9
|
-
# == Examples
|
10
|
-
#
|
11
|
-
# geo = Google::Geo.new API_KEY
|
12
|
-
#
|
13
|
-
# addresses = geo.locate '1600 Amphitheatre Parkway, Mountain View, CA'
|
14
|
-
#
|
15
|
-
# addresses.size # 1, :locate always returns an Array
|
16
|
-
#
|
17
|
-
# address = addresses.first
|
18
|
-
#
|
19
|
-
# address.country # 'US'
|
20
|
-
# address.city # 'Mountain View'
|
21
|
-
# address.full_address # '1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA'
|
22
|
-
#
|
23
|
-
# address.query # '1600 Amphitheatre Parkway, Mountain View, CA'
|
24
|
-
# address.accuracy # 8
|
25
|
-
#
|
26
|
-
# In the case of sufficiently vague queries, Google will return more than one address:
|
27
|
-
#
|
28
|
-
# addresses = geo.locate 'heaven'
|
29
|
-
#
|
30
|
-
# addresses.size # 2
|
31
|
-
# addresses.map { |a| a.state } # ['PA', 'NC']
|
32
|
-
#
|
33
|
-
# == Contributors
|
34
|
-
#
|
35
|
-
# Seth Thomas Rasmussen - http://greatseth.com - sethrasmussen@gmail.com
|
4
|
+
# Please see README for usage examples.
|
36
5
|
class Geo
|
37
6
|
# API key provided by Google allowing access to the Geocode API
|
38
7
|
attr_accessor :key
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: greatseth-google-geo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "2.
|
4
|
+
version: "2.1"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Thomas Rasmussen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
|
-
date: 2008-
|
11
|
+
date: 2008-09-28 21:00:00 -07:00
|
12
12
|
default_executable:
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
@@ -31,13 +31,14 @@ extra_rdoc_files:
|
|
31
31
|
- CHANGELOG
|
32
32
|
- lib/google/geo.rb
|
33
33
|
- LICENSE
|
34
|
-
- README
|
34
|
+
- README.textile
|
35
35
|
files:
|
36
36
|
- CHANGELOG
|
37
37
|
- lib/google/geo.rb
|
38
38
|
- LICENSE
|
39
|
+
- Manifest
|
39
40
|
- Rakefile
|
40
|
-
- README
|
41
|
+
- README.textile
|
41
42
|
- test/fixtures/invalid_map_key.xml
|
42
43
|
- test/fixtures/missing_address.xml
|
43
44
|
- test/fixtures/server_error.xml
|
@@ -99,7 +100,6 @@ files:
|
|
99
100
|
- vendor/mocha-0.4.0/test/stubba_integration_test.rb
|
100
101
|
- vendor/mocha-0.4.0/test/stubba_test_result_integration_test.rb
|
101
102
|
- vendor/mocha-0.4.0/test/test_helper.rb
|
102
|
-
- Manifest
|
103
103
|
- google-geo.gemspec
|
104
104
|
has_rdoc: true
|
105
105
|
homepage: http://github.com/greatseth/google-geo
|
@@ -110,7 +110,7 @@ rdoc_options:
|
|
110
110
|
- --title
|
111
111
|
- Google-geo
|
112
112
|
- --main
|
113
|
-
- README
|
113
|
+
- README.textile
|
114
114
|
require_paths:
|
115
115
|
- lib
|
116
116
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -121,13 +121,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
121
121
|
version:
|
122
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
123
|
requirements:
|
124
|
-
- - "
|
124
|
+
- - ">="
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: "1.2"
|
127
127
|
version:
|
128
128
|
requirements: []
|
129
129
|
|
130
|
-
rubyforge_project:
|
130
|
+
rubyforge_project: greatseth
|
131
131
|
rubygems_version: 1.2.0
|
132
132
|
signing_key:
|
133
133
|
specification_version: 2
|