CodeMonkeySteve-graticule 0.2.11 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/graticule.gemspec +1 -1
- data/lib/graticule/geocoder/google.rb +6 -0
- data/lib/graticule/location.rb +3 -2
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.12
|
data/graticule.gemspec
CHANGED
@@ -57,6 +57,12 @@ module Graticule #:nodoc:
|
|
57
57
|
l.postal_code = value(address.elements['.//PostalCodeNumber/text()'])
|
58
58
|
l.country = value(address.elements['.//CountryNameCode/text()'])
|
59
59
|
l.precision = PRECISION[address.attribute('Accuracy').value.to_i] || :unknown
|
60
|
+
|
61
|
+
neighborhood = address.elements['//Locality/AddressLine']
|
62
|
+
if ( neighborhood && neighborhood.text )
|
63
|
+
lng, lat, = neighborhood.elements['./ancestor::Placemark/Point/coordinates'].text.split(',').map { |v| v.to_f }
|
64
|
+
l.neighborhood = OpenStruct.new :name => neighborhood.text, :latitude => lat, :longitude => lng
|
65
|
+
end
|
60
66
|
end
|
61
67
|
end
|
62
68
|
end
|
data/lib/graticule/location.rb
CHANGED
@@ -2,11 +2,12 @@ module Graticule
|
|
2
2
|
|
3
3
|
# A geographic location
|
4
4
|
class Location
|
5
|
-
attr_accessor :latitude, :longitude, :street, :locality, :region, :postal_code, :country, :precision, :warning
|
5
|
+
attr_accessor :latitude, :longitude, :street, :neighborhood, :locality, :region, :postal_code, :country, :precision, :warning
|
6
6
|
alias_method :city, :locality
|
7
7
|
alias_method :state, :region
|
8
8
|
alias_method :zip, :postal_code
|
9
|
-
|
9
|
+
attr_accessor :neighborhood
|
10
|
+
|
10
11
|
def initialize(attrs = {})
|
11
12
|
attrs.each do |key,value|
|
12
13
|
instance_variable_set "@#{key}", value
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: CodeMonkeySteve-graticule
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
@@ -121,6 +121,7 @@ files:
|
|
121
121
|
- test/unit/graticule/location_test.rb
|
122
122
|
has_rdoc: false
|
123
123
|
homepage: http://github.com/collectiveidea/graticule
|
124
|
+
licenses:
|
124
125
|
post_install_message:
|
125
126
|
rdoc_options:
|
126
127
|
- --main
|
@@ -144,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
145
|
requirements: []
|
145
146
|
|
146
147
|
rubyforge_project: graticule
|
147
|
-
rubygems_version: 1.
|
148
|
+
rubygems_version: 1.3.5
|
148
149
|
signing_key:
|
149
150
|
specification_version: 3
|
150
151
|
summary: API for using all the popular geocoding services.
|