geogov 0.0.10 → 0.0.11
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/lib/geogov/geo_stack.rb +91 -80
- data/lib/geogov/providers/dracos_gazetteer.rb +2 -2
- data/lib/geogov/providers/google.rb +6 -6
- data/lib/geogov/providers/hostip.rb +2 -2
- data/lib/geogov/providers/mapit.rb +5 -5
- data/lib/geogov/providers/open_street_map.rb +4 -4
- data/lib/geogov/utils.rb +5 -5
- data/test/geogov_test.rb +22 -8
- data/test/test_helper.rb +3 -2
- metadata +40 -52
data/lib/geogov/geo_stack.rb
CHANGED
@@ -7,28 +7,29 @@ module Geogov
|
|
7
7
|
def initialize(&block)
|
8
8
|
if block_given?
|
9
9
|
yield self
|
10
|
+
raise ArgumentError, "fuzzy point required" unless fuzzy_point
|
10
11
|
else
|
11
12
|
self.fuzzy_point = calculate_fuzzy_point
|
12
13
|
end
|
13
14
|
end
|
14
15
|
|
15
16
|
def calculate_fuzzy_point
|
16
|
-
if
|
17
|
-
return FuzzyPoint.new(
|
17
|
+
if lat && lon
|
18
|
+
return FuzzyPoint.new(lat, lon, :point)
|
18
19
|
end
|
19
20
|
|
20
|
-
if
|
21
|
+
if postcode
|
21
22
|
district = postcode.split(" ")[0]
|
22
23
|
district_centre = Geogov.centre_of_district(district)
|
23
24
|
if district_centre
|
24
|
-
return FuzzyPoint.new(district_centre["lat"],district_centre["lon"],:postcode_district)
|
25
|
+
return FuzzyPoint.new(district_centre["lat"], district_centre["lon"],:postcode_district)
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
28
|
-
if
|
29
|
-
country_centre = Geogov.centre_of_country(
|
29
|
+
if country
|
30
|
+
country_centre = Geogov.centre_of_country(country)
|
30
31
|
if country_centre
|
31
|
-
return FuzzyPoint.new(country_centre["lat"],country_centre["lon"],:country)
|
32
|
+
return FuzzyPoint.new(country_centre["lat"], country_centre["lon"],:country)
|
32
33
|
end
|
33
34
|
end
|
34
35
|
|
@@ -37,38 +38,31 @@ module Geogov
|
|
37
38
|
|
38
39
|
def self.new_from_ip(ip_address)
|
39
40
|
remote_location = Geogov.remote_location(ip_address)
|
40
|
-
new
|
41
|
-
if remote_location
|
42
|
-
gs.country = remote_location['country']
|
43
|
-
end
|
41
|
+
new { |gs|
|
42
|
+
gs.country = remote_location['country'] if remote_location
|
44
43
|
gs.fuzzy_point = gs.calculate_fuzzy_point
|
45
|
-
|
44
|
+
}
|
46
45
|
end
|
47
46
|
|
48
47
|
def self.new_from_hash(hash)
|
49
|
-
new
|
50
|
-
gs.set_fields(hash)
|
51
|
-
unless hash['fuzzy_point']
|
52
|
-
raise ArgumentError, "fuzzy point required"
|
53
|
-
end
|
54
|
-
end
|
48
|
+
new { |gs| gs.set_fields hash }
|
55
49
|
end
|
56
50
|
|
57
51
|
def to_hash
|
58
52
|
{
|
59
|
-
:fuzzy_point
|
60
|
-
:postcode
|
61
|
-
:council
|
62
|
-
:ward
|
63
|
-
:friendly_name =>
|
64
|
-
:nation
|
65
|
-
}
|
53
|
+
:fuzzy_point => fuzzy_point.to_hash,
|
54
|
+
:postcode => postcode,
|
55
|
+
:council => council,
|
56
|
+
:ward => ward,
|
57
|
+
:friendly_name => friendly_name,
|
58
|
+
:nation => nation
|
59
|
+
}
|
66
60
|
end
|
67
61
|
|
68
62
|
def update(hash)
|
69
|
-
self.class.new
|
63
|
+
self.class.new do |empty|
|
70
64
|
full_postcode = hash['postcode']
|
71
|
-
empty.set_fields
|
65
|
+
empty.set_fields hash
|
72
66
|
if has_valid_lat_lon(hash)
|
73
67
|
empty.fetch_missing_fields_for_coords(hash['lat'], hash['lon'])
|
74
68
|
elsif full_postcode
|
@@ -77,55 +71,73 @@ module Geogov
|
|
77
71
|
empty.fuzzy_point = empty.calculate_fuzzy_point
|
78
72
|
end
|
79
73
|
end
|
80
|
-
|
74
|
+
|
81
75
|
def friendly_name
|
82
76
|
@friendly_name ||= build_locality
|
83
77
|
end
|
84
78
|
|
85
|
-
def
|
86
|
-
|
87
|
-
end
|
88
|
-
|
89
|
-
def
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
79
|
+
def get_authority(type)
|
80
|
+
authorities[type.upcase.to_sym]
|
81
|
+
end
|
82
|
+
|
83
|
+
def formatted_authority_name(type)
|
84
|
+
authority = get_authority(type) or return type
|
85
|
+
authority["name"].gsub(%r{
|
86
|
+
\s*((((District|Borough|County|City)\s|)Council|Community)\s?)+ |
|
87
|
+
\s(North|East|South|West|Central)$ |
|
88
|
+
Mid\s
|
89
|
+
}x, "")
|
90
|
+
end
|
91
|
+
|
92
|
+
# Key to the three-letter abbreviations
|
93
|
+
# CTY | County
|
94
|
+
# CED | County Electoral Division
|
95
|
+
# DIS | District
|
96
|
+
# DIW | District Ward
|
97
|
+
# EUR | European Region
|
98
|
+
# GLA | Greater London Authority
|
99
|
+
# LAC | Greater London Authority Assembly Constituency
|
100
|
+
# LBR | London Borough
|
101
|
+
# LBW | London Borough Ward
|
102
|
+
# MTD | Metropolitan District
|
103
|
+
# MTW | Metropolitan District Ward
|
104
|
+
# SPE | Scottish Parliament Electoral Region
|
105
|
+
# SPC | Scottish Parliament Constituency
|
106
|
+
# UTA | Unitary Authority
|
107
|
+
# UTE | Unitary Authority Electoral Division
|
108
|
+
# UTW | Unitary Authority Ward
|
109
|
+
# WAE | Welsh Assembly Electoral Region
|
110
|
+
# WAC | Welsh Assembly Constituency
|
111
|
+
# WMC | Westminster Constituency
|
112
|
+
# LGW | NI Ward
|
113
|
+
# LGD | NI Council
|
114
|
+
# LGE | NI Electoral Area
|
115
|
+
# NIE | NI Assembly Constituency
|
116
|
+
# NIA | NI Assembly
|
117
|
+
|
118
|
+
LOCALITY_KEYS = [
|
119
|
+
[:LBO], # London (special case)
|
120
|
+
[:DIS, :CTY],
|
121
|
+
[:CPC, :UTA], # Cornwall civil parishes
|
122
|
+
[:UTE, :UTA],
|
123
|
+
[:UTW, :UTA],
|
124
|
+
[:MTW, :MTD],
|
125
|
+
[:LGW, :LGD]
|
126
|
+
]
|
104
127
|
|
105
128
|
def build_locality
|
106
|
-
return false unless
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
locality = ['CPC','UTA']
|
115
|
-
when has_authority?('UTA') && has_authority?('UTE')
|
116
|
-
locality = ['UTE','UTA']
|
117
|
-
when has_authority?('UTA') && has_authority?('UTW')
|
118
|
-
locality = ['UTW','UTA']
|
119
|
-
when has_authority?('MTW') && has_authority?('MTD')
|
120
|
-
locality = ['MTW','MTD']
|
121
|
-
else
|
122
|
-
return false
|
123
|
-
end
|
124
|
-
locality.map {|t| formatted_authority_name(t) || t }.uniq.join(', ')
|
129
|
+
return false unless authorities
|
130
|
+
selected_keys = LOCALITY_KEYS.find { |t|
|
131
|
+
(t - authorities.keys).none?
|
132
|
+
} or return false
|
133
|
+
|
134
|
+
parts = selected_keys.map { |a| formatted_authority_name(a) }
|
135
|
+
parts << "London" if selected_keys == [:LBO]
|
136
|
+
parts.uniq.join(", ")
|
125
137
|
end
|
126
138
|
|
127
139
|
def has_valid_lat_lon(hash)
|
128
|
-
|
140
|
+
%w[ lat lon ].none? { |k| hash[k].to_s.empty? }
|
129
141
|
end
|
130
142
|
|
131
143
|
def fetch_missing_fields_for_postcode(postcode)
|
@@ -134,30 +146,29 @@ module Geogov
|
|
134
146
|
fields = Geogov.areas_for_stack_from_postcode(postcode)
|
135
147
|
if fields
|
136
148
|
lat_lon = fields[:point]
|
137
|
-
set_fields
|
149
|
+
set_fields fields.select { |k,v| k != :point }
|
138
150
|
end
|
139
151
|
end
|
140
152
|
end
|
141
|
-
|
153
|
+
|
154
|
+
UK_NATIONS = ['England', 'Scotland', 'Northern Ireland', 'Wales']
|
155
|
+
|
142
156
|
def fetch_missing_fields_for_coords(lat, lon)
|
143
157
|
fields = Geogov.areas_for_stack_from_coords(lat, lon)
|
144
|
-
if
|
158
|
+
if UK_NATIONS.include?(fields[:nation])
|
145
159
|
self.country = 'UK'
|
146
|
-
set_fields
|
160
|
+
set_fields fields.select { |k,v| k != :point }
|
147
161
|
end
|
148
162
|
end
|
149
163
|
|
150
164
|
def set_fields(hash)
|
151
165
|
hash.each do |geo, value|
|
152
|
-
setter =
|
153
|
-
if
|
154
|
-
unless value == ""
|
155
|
-
self.send(setter,value)
|
156
|
-
end
|
166
|
+
setter = "#{geo.to_s}=".to_sym
|
167
|
+
if respond_to?(setter)
|
168
|
+
self.send(setter, value) unless value == ""
|
157
169
|
else
|
158
|
-
self.authorities ||= {
|
170
|
+
self.authorities ||= {}
|
159
171
|
self.authorities[geo] = value
|
160
|
-
# raise ArgumentError, "geo type '#{geo}' is not a valid geo type"
|
161
172
|
end
|
162
173
|
end
|
163
174
|
self
|
@@ -165,7 +176,7 @@ module Geogov
|
|
165
176
|
|
166
177
|
def fuzzy_point=(point)
|
167
178
|
if point.is_a?(Hash)
|
168
|
-
@fuzzy_point = FuzzyPoint.new(point["lat"],point["lon"],point["accuracy"])
|
179
|
+
@fuzzy_point = FuzzyPoint.new(point["lat"], point["lon"], point["accuracy"])
|
169
180
|
else
|
170
181
|
@fuzzy_point = point
|
171
182
|
end
|
@@ -176,7 +187,7 @@ module Geogov
|
|
176
187
|
|
177
188
|
def postcode=(postcode)
|
178
189
|
if (matches = (postcode.match(POSTCODE_REGEXP) || postcode.match(SECTOR_POSTCODE_REGEXP)))
|
179
|
-
@postcode = matches[1]
|
190
|
+
@postcode = [matches[1], matches[2]].join(" ")
|
180
191
|
end
|
181
192
|
end
|
182
193
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Geogov
|
2
|
-
class DracosGazetteer
|
2
|
+
class DracosGazetteer
|
3
3
|
def initialize(default_url = "http://gazetteer.dracos.vm.bytemark.co.uk")
|
4
4
|
@base = default_url
|
5
5
|
end
|
@@ -13,7 +13,7 @@ module Geogov
|
|
13
13
|
return nil
|
14
14
|
end
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
|
18
18
|
end
|
19
19
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Geogov
|
2
2
|
|
3
3
|
class Google
|
4
|
-
|
4
|
+
|
5
5
|
def dimension(l1,l2)
|
6
6
|
"#{l1}x#{l2}"
|
7
|
-
end
|
7
|
+
end
|
8
8
|
|
9
9
|
def location(l1,l2)
|
10
10
|
"#{l1},#{l2}"
|
@@ -19,9 +19,9 @@ module Geogov
|
|
19
19
|
}
|
20
20
|
if options[:marker_lat] && options[:marker_lon]
|
21
21
|
location = location(options[:marker_lat],options[:marker_lon])
|
22
|
-
g_options[:markers] = ["color:blue",location].join("|")
|
22
|
+
g_options[:markers] = ["color:blue",location].join("|")
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
params = Geogov.hash_to_params(g_options)
|
26
26
|
|
27
27
|
"http://maps.google.com/maps/api/staticmap?#{params}"
|
@@ -32,11 +32,11 @@ module Geogov
|
|
32
32
|
g_options = {
|
33
33
|
:z => options[:z] || 14,
|
34
34
|
:ie => "UTF8",
|
35
|
-
:q => location(lat,lon)
|
35
|
+
:q => location(lat,lon)
|
36
36
|
}
|
37
37
|
if options[:marker_lat] && options[:marker_lon]
|
38
38
|
location = location(options[:marker_lat],options[:marker_lon])
|
39
|
-
g_options[:sll] = location
|
39
|
+
g_options[:sll] = location
|
40
40
|
end
|
41
41
|
|
42
42
|
params = Geogov.hash_to_params(g_options)
|
@@ -8,7 +8,7 @@ module Geogov
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def remote_location(ip_address)
|
11
|
-
params = {:ip => ip_address, :position => true}
|
11
|
+
params = {:ip => ip_address, :position => true}
|
12
12
|
results = Geogov.get(@url + "?" + Geogov.hash_to_params(params))
|
13
13
|
return nil if results.nil?
|
14
14
|
response = YAML.load(results + "\n")
|
@@ -21,7 +21,7 @@ module Geogov
|
|
21
21
|
end
|
22
22
|
return nil if location['city'] =~ /Unknown City/
|
23
23
|
return nil if location['city'] =~ /Private Address/
|
24
|
-
|
24
|
+
|
25
25
|
# I found these very unreliable, so better they're
|
26
26
|
# not there to tempt anyone
|
27
27
|
location.delete("city")
|
@@ -64,11 +64,11 @@ module Geogov
|
|
64
64
|
query = self.point("4326", [lon, lat])
|
65
65
|
results = {:point => {'lat' => lat, 'lon' => lon}}
|
66
66
|
councils = { }
|
67
|
-
|
67
|
+
|
68
68
|
query.each do |id, area_info|
|
69
69
|
type = area_info['type'].upcase.to_sym
|
70
70
|
level = translate_area_type_to_shortcut(area_info['type'])
|
71
|
-
|
71
|
+
|
72
72
|
if level
|
73
73
|
level = level.downcase.to_sym
|
74
74
|
results[level] = [] unless results[level]
|
@@ -77,11 +77,11 @@ module Geogov
|
|
77
77
|
results[level] << level_info
|
78
78
|
results[:nation] = area_info['country_name'] if results[:nation].nil?
|
79
79
|
end
|
80
|
-
|
80
|
+
|
81
81
|
councils[type] = { 'name' => area_info['name'], 'type' => area_info['type'], 'id' => area_info['id'] }
|
82
82
|
end
|
83
83
|
|
84
|
-
return councils.merge results
|
84
|
+
return councils.merge results
|
85
85
|
end
|
86
86
|
|
87
87
|
def areas_for_stack_from_postcode(postcode)
|
@@ -93,7 +93,7 @@ module Geogov
|
|
93
93
|
query['areas'].each do |i, area|
|
94
94
|
type = area['type'].to_sym
|
95
95
|
results[type] = area
|
96
|
-
end
|
96
|
+
end
|
97
97
|
|
98
98
|
query['shortcuts'].each do |typ, i|
|
99
99
|
if i.is_a? Hash
|
@@ -16,12 +16,12 @@ module Geogov
|
|
16
16
|
:lon => long,
|
17
17
|
:show => 1
|
18
18
|
}.merge(options)
|
19
|
-
|
19
|
+
|
20
20
|
if options[:marker_lat] && options[:marker_lon]
|
21
21
|
options[:mlat0] = options.delete(:marker_lat)
|
22
22
|
options[:mlon0] = options.delete(:marker_lon)
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
params = Geogov.hash_to_params(options)
|
26
26
|
|
27
27
|
"#{@url}/StaticMap?#{params}"
|
@@ -34,12 +34,12 @@ module Geogov
|
|
34
34
|
:lon => long,
|
35
35
|
:layers => "M"
|
36
36
|
}.merge(options)
|
37
|
-
|
37
|
+
|
38
38
|
if options[:marker_lat] && options[:marker_lon]
|
39
39
|
options[:mlat0] = options.delete(:marker_lat)
|
40
40
|
options[:mlon0] = options.delete(:marker_lon)
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
params = Geogov.hash_to_params(options)
|
44
44
|
|
45
45
|
"http://www.openstreetmap.org/?#{params}"
|
data/lib/geogov/utils.rb
CHANGED
@@ -2,7 +2,7 @@ require 'json'
|
|
2
2
|
require 'net/http'
|
3
3
|
|
4
4
|
module Geogov
|
5
|
-
|
5
|
+
|
6
6
|
def get(url)
|
7
7
|
url = URI.parse(url) unless url.is_a? URI
|
8
8
|
response = Net::HTTP.start(url.host, url.port) { |http|
|
@@ -31,7 +31,7 @@ module Geogov
|
|
31
31
|
class LruCache
|
32
32
|
|
33
33
|
def initialize(size = 100)
|
34
|
-
@size = size
|
34
|
+
@size = size
|
35
35
|
@bucket1 = {}
|
36
36
|
@bucket2 = {}
|
37
37
|
end
|
@@ -67,14 +67,14 @@ module Geogov
|
|
67
67
|
class SimpleCache
|
68
68
|
def initialize(delegate)
|
69
69
|
@delegate = delegate
|
70
|
-
@cache = LruCache.new(1000)
|
70
|
+
@cache = LruCache.new(1000)
|
71
71
|
end
|
72
72
|
|
73
73
|
def method_missing(m, *args)
|
74
74
|
arg_key = args.inspect
|
75
75
|
cache_key = "#{m}--#{arg_key}"
|
76
76
|
if @cache[cache_key]
|
77
|
-
return @cache[cache_key]
|
77
|
+
return @cache[cache_key]
|
78
78
|
else
|
79
79
|
result = @delegate.send(m,*args)
|
80
80
|
@cache[cache_key] = result
|
@@ -82,6 +82,6 @@ module Geogov
|
|
82
82
|
end
|
83
83
|
end
|
84
84
|
end
|
85
|
-
|
85
|
+
|
86
86
|
|
87
87
|
end
|
data/test/geogov_test.rb
CHANGED
@@ -75,35 +75,49 @@ class GovspeakTest < Test::Unit::TestCase
|
|
75
75
|
|
76
76
|
test "stack with postcode returns correct locality" do
|
77
77
|
stack = Geogov::GeoStack.new
|
78
|
-
stack = stack.update(
|
78
|
+
stack = stack.update('postcode' => "SW1A 1AA")
|
79
79
|
|
80
80
|
assert_equal "Westminster, London", stack.friendly_name
|
81
81
|
end
|
82
|
-
|
82
|
+
|
83
|
+
test "stack with Belfast postcode returns correct locality" do
|
84
|
+
stack = Geogov::GeoStack.new
|
85
|
+
stack = stack.update('postcode' => "BT2 8BP")
|
86
|
+
|
87
|
+
assert_equal "Shaftesbury, Belfast", stack.friendly_name
|
88
|
+
end
|
89
|
+
|
90
|
+
test "stack with non-Belfast Northern Ireland postcode returns correct locality" do
|
91
|
+
stack = Geogov::GeoStack.new
|
92
|
+
stack = stack.update('postcode' => "BT35 6AZ")
|
93
|
+
|
94
|
+
assert_equal "Ballybot, Newry and Mourne", stack.friendly_name
|
95
|
+
end
|
96
|
+
|
83
97
|
test "stack with coordinates returns correct locality" do
|
84
98
|
stack = Geogov::GeoStack.new
|
85
|
-
stack = stack.update(
|
99
|
+
stack = stack.update('lat' => "51.501009", "lon" => "-0.1415870")
|
86
100
|
|
87
101
|
assert_equal "Westminster, London", stack.friendly_name
|
88
102
|
end
|
89
103
|
|
90
104
|
test "stack with postcode returns authorities" do
|
91
105
|
stack = Geogov::GeoStack.new
|
92
|
-
stack = stack.update(
|
106
|
+
stack = stack.update('postcode' => "SW1A 1AA")
|
93
107
|
|
94
108
|
assert stack.authorities.any?
|
95
109
|
end
|
96
110
|
|
97
111
|
test "stack with coordinates returns authorities" do
|
98
112
|
stack = Geogov::GeoStack.new
|
99
|
-
stack = stack.update(
|
113
|
+
stack = stack.update('lat' => "51.501009", "lon" => "-0.1415870")
|
100
114
|
|
101
115
|
assert stack.authorities.any?
|
102
116
|
end
|
103
117
|
|
104
118
|
test "stack with postcode returns correct locality, ward and council" do
|
105
119
|
stack = Geogov::GeoStack.new
|
106
|
-
stack = stack.update(
|
120
|
+
stack = stack.update('postcode' => "SW1A 1AA")
|
107
121
|
|
108
122
|
assert_equal "Westminster, London", stack.friendly_name
|
109
123
|
assert stack.ward and stack.ward.any?
|
@@ -113,7 +127,7 @@ class GovspeakTest < Test::Unit::TestCase
|
|
113
127
|
|
114
128
|
test "stack with coordinates returns correct locality, ward and council" do
|
115
129
|
stack = Geogov::GeoStack.new
|
116
|
-
stack = stack.update(
|
130
|
+
stack = stack.update('lat' => "51.501009", "lon" => "-0.1415870")
|
117
131
|
|
118
132
|
assert_equal "Westminster, London", stack.friendly_name
|
119
133
|
assert stack.ward and stack.ward.any?
|
@@ -121,4 +135,4 @@ class GovspeakTest < Test::Unit::TestCase
|
|
121
135
|
assert_equal "Westminster City Council", stack.council.first['name']
|
122
136
|
end
|
123
137
|
|
124
|
-
end
|
138
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
lib = File.expand_path("../../lib", __FILE__)
|
2
|
+
$:.unshift lib unless $:.include?(lib)
|
2
3
|
|
3
4
|
require 'test/unit'
|
4
5
|
require 'mocha'
|
@@ -10,7 +11,7 @@ class Test::Unit::TestCase
|
|
10
11
|
clean_name = name.gsub(/\s+/,'_')
|
11
12
|
method = "test_#{clean_name.gsub(/\s+/,'_')}".to_sym
|
12
13
|
already_defined = instance_method(method) rescue false
|
13
|
-
raise "#{method} exists" if already_defined
|
14
|
+
raise "#{method} exists" if already_defined
|
14
15
|
define_method(method, &block)
|
15
16
|
end
|
16
17
|
end
|
metadata
CHANGED
@@ -1,98 +1,86 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: geogov
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.11
|
4
5
|
prerelease:
|
5
|
-
version: 0.0.10
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Ben Griffiths
|
9
9
|
- James Stewart
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
- !ruby/object:Gem::Dependency
|
13
|
+
date: 2012-05-04 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
17
16
|
name: rake
|
18
|
-
requirement: &
|
17
|
+
requirement: &15045680 !ruby/object:Gem::Requirement
|
19
18
|
none: false
|
20
|
-
requirements:
|
19
|
+
requirements:
|
21
20
|
- - ~>
|
22
|
-
- !ruby/object:Gem::Version
|
21
|
+
- !ruby/object:Gem::Version
|
23
22
|
version: 0.9.0
|
24
23
|
type: :development
|
25
24
|
prerelease: false
|
26
|
-
version_requirements: *
|
27
|
-
- !ruby/object:Gem::Dependency
|
25
|
+
version_requirements: *15045680
|
26
|
+
- !ruby/object:Gem::Dependency
|
28
27
|
name: mocha
|
29
|
-
requirement: &
|
28
|
+
requirement: &15045200 !ruby/object:Gem::Requirement
|
30
29
|
none: false
|
31
|
-
requirements:
|
30
|
+
requirements:
|
32
31
|
- - ~>
|
33
|
-
- !ruby/object:Gem::Version
|
32
|
+
- !ruby/object:Gem::Version
|
34
33
|
version: 0.9.0
|
35
34
|
type: :development
|
36
35
|
prerelease: false
|
37
|
-
version_requirements: *
|
36
|
+
version_requirements: *15045200
|
38
37
|
description: Geolocation and utilities for UK Government single domain
|
39
|
-
email:
|
38
|
+
email:
|
40
39
|
- ben@alphagov.co.uk
|
41
40
|
- jystewart@gmail.com
|
42
41
|
executables: []
|
43
|
-
|
44
42
|
extensions: []
|
45
|
-
|
46
43
|
extra_rdoc_files: []
|
47
|
-
|
48
|
-
|
44
|
+
files:
|
45
|
+
- lib/geogov.rb
|
46
|
+
- lib/geogov/utils.rb
|
49
47
|
- lib/geogov/fuzzy_point.rb
|
50
|
-
- lib/geogov/geo_stack.rb
|
51
|
-
- lib/geogov/providers/dracos_gazetteer.rb
|
52
|
-
- lib/geogov/providers/geonames.rb
|
53
|
-
- lib/geogov/providers/google.rb
|
54
48
|
- lib/geogov/providers/hostip.rb
|
49
|
+
- lib/geogov/providers/dracos_gazetteer.rb
|
55
50
|
- lib/geogov/providers/mapit.rb
|
51
|
+
- lib/geogov/providers/google.rb
|
52
|
+
- lib/geogov/providers/geonames.rb
|
56
53
|
- lib/geogov/providers/open_street_map.rb
|
57
|
-
- lib/geogov/
|
58
|
-
- lib/geogov.rb
|
54
|
+
- lib/geogov/geo_stack.rb
|
59
55
|
- Gemfile
|
60
56
|
- Rakefile
|
61
|
-
- test/geogov_test.rb
|
62
57
|
- test/test_helper.rb
|
58
|
+
- test/geogov_test.rb
|
63
59
|
homepage: http://github.com/alphagov/geogov
|
64
60
|
licenses: []
|
65
|
-
|
66
61
|
post_install_message:
|
67
62
|
rdoc_options: []
|
68
|
-
|
69
|
-
require_paths:
|
63
|
+
require_paths:
|
70
64
|
- lib
|
71
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
66
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
|
78
|
-
- 0
|
79
|
-
version: "0"
|
80
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
72
|
none: false
|
82
|
-
requirements:
|
83
|
-
- -
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
|
86
|
-
segments:
|
87
|
-
- 0
|
88
|
-
version: "0"
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
89
77
|
requirements: []
|
90
|
-
|
91
78
|
rubyforge_project:
|
92
|
-
rubygems_version: 1.8.
|
79
|
+
rubygems_version: 1.8.11
|
93
80
|
signing_key:
|
94
81
|
specification_version: 3
|
95
82
|
summary: Geolocation and utilities for UK Government single domain
|
96
|
-
test_files:
|
97
|
-
- test/geogov_test.rb
|
83
|
+
test_files:
|
98
84
|
- test/test_helper.rb
|
85
|
+
- test/geogov_test.rb
|
86
|
+
has_rdoc:
|