zipcoder 0.8.4 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +50 -6
- data/Rakefile +47 -17
- data/lib/data/county.csv +63212 -0
- data/lib/data/zip_data.yml +45121 -3043
- data/lib/zipcoder/cacher/base.rb +99 -16
- data/lib/zipcoder/ext/string.rb +4 -0
- data/lib/zipcoder/version.rb +1 -1
- data/lib/zipcoder.rb +10 -2
- data/spec/zipcoder_spec.rb +41 -0
- data/zipcoder.gemspec +2 -3
- metadata +23 -22
data/lib/zipcoder/cacher/base.rb
CHANGED
@@ -1,15 +1,70 @@
|
|
1
1
|
require_relative '../ext/array'
|
2
2
|
|
3
|
+
=begin
|
4
|
+
|
5
|
+
The ZipCoder::Cacher::Base class generates different data structures and then stores
|
6
|
+
them for later access based on whichever cacher is selected. For example, they could
|
7
|
+
be stored in memory, Redis, etc.
|
8
|
+
|
9
|
+
The generated data structures are as follows
|
10
|
+
|
11
|
+
## zipcoder:zip:ZIP
|
12
|
+
|
13
|
+
Information for each zip code
|
14
|
+
|
15
|
+
- zip: zip code (e.g. "55340")
|
16
|
+
- city: city name (e.g. "Hamel")
|
17
|
+
- county: County(s) for the zip code (e.g. ["Travis"])
|
18
|
+
- state: state (e.g. "MN")
|
19
|
+
- lat: latitude for the city (e.g. "45.07")
|
20
|
+
- long: longitude for the city (e.g. "-93.58")
|
21
|
+
|
22
|
+
## zipcoder:city:CITY,STATE
|
23
|
+
|
24
|
+
Information for each city
|
25
|
+
|
26
|
+
- city: city name (e.g. "Anderson")
|
27
|
+
- county: city county(s) (e.g. ["Travis"])
|
28
|
+
- state: city state (e.g. "IN")
|
29
|
+
- zip: list of zip codes for the city (e.g. "46011-46013,46016-46017")
|
30
|
+
- lat: latitude for the city (e.g. "40.09")
|
31
|
+
- long: longitude for the city (e.g. "-85.68")
|
32
|
+
|
33
|
+
## zipcoder:county:COUNTY,STATE
|
34
|
+
|
35
|
+
Information for each county
|
36
|
+
|
37
|
+
- county: county name
|
38
|
+
- cities: cities in the county
|
39
|
+
- state: county state
|
40
|
+
- zip: list of zip codes for the county (e.g. "46011-46013,46016-46017")
|
41
|
+
- lat: latitude for the county (e.g. "40.09")
|
42
|
+
- long: longitude for the county (e.g. "-85.68")
|
43
|
+
|
44
|
+
## zipcoder:state:cities:STATE
|
45
|
+
|
46
|
+
List of cities in the state
|
47
|
+
|
48
|
+
## zipcoder:state:counties:STATE
|
49
|
+
|
50
|
+
List of counties in the state
|
51
|
+
|
52
|
+
## zipcoder:states
|
53
|
+
|
54
|
+
List of the states in the US
|
55
|
+
|
56
|
+
=end
|
57
|
+
|
3
58
|
module Zipcoder
|
4
59
|
module Cacher
|
5
|
-
# The cacher base class places all of the objects in memory. The
|
6
|
-
# abstraction will later allow us to override for MemCacher and
|
7
|
-
# Redis implementations
|
8
60
|
class Base
|
61
|
+
|
9
62
|
KEY_BASE = "zipcoder"
|
10
63
|
KEY_ZIP = "#{KEY_BASE}:zip"
|
11
64
|
KEY_CITY = "#{KEY_BASE}:city"
|
12
|
-
|
65
|
+
KEY_COUNTY = "#{KEY_BASE}:county"
|
66
|
+
KEY_STATE_CITIES = "#{KEY_BASE}:state:cities"
|
67
|
+
KEY_STATE_COUNTIES = "#{KEY_BASE}:state:counties"
|
13
68
|
KEY_STATES = "#{KEY_BASE}:states"
|
14
69
|
|
15
70
|
#region Override These
|
@@ -40,6 +95,8 @@ module Zipcoder
|
|
40
95
|
end
|
41
96
|
|
42
97
|
def load
|
98
|
+
start_time = Time.now
|
99
|
+
|
43
100
|
this_dir = File.expand_path(File.dirname(__FILE__))
|
44
101
|
|
45
102
|
# Load zip cache from file
|
@@ -49,7 +106,8 @@ module Zipcoder
|
|
49
106
|
# Initialize
|
50
107
|
_empty_cache
|
51
108
|
city_states = {}
|
52
|
-
|
109
|
+
state_cities_lookup = {}
|
110
|
+
state_counties_lookup = {}
|
53
111
|
|
54
112
|
# Add the zip codes to the cache
|
55
113
|
zip_codes.each do |zip, cities|
|
@@ -80,19 +138,32 @@ module Zipcoder
|
|
80
138
|
normalized = _normalize_city(infos)
|
81
139
|
_write_cache _city_cache(city_state), normalized
|
82
140
|
|
83
|
-
# Populate the State Cache
|
84
|
-
cities =
|
141
|
+
# Populate the State City Cache
|
142
|
+
cities = state_cities_lookup[state] || []
|
85
143
|
cities << city
|
86
|
-
|
144
|
+
state_cities_lookup[state] = cities
|
145
|
+
|
146
|
+
# Populate the State Counties Cache
|
147
|
+
counties = state_counties_lookup[state] || []
|
148
|
+
counties += normalized[:county].split(",")
|
149
|
+
state_counties_lookup[state] = counties
|
87
150
|
end
|
88
151
|
|
89
152
|
# Set the cities cache
|
90
|
-
|
91
|
-
_write_cache
|
153
|
+
state_cities_lookup.each do |state, cities|
|
154
|
+
_write_cache _state_cities_cache(state), cities.sort
|
155
|
+
end
|
156
|
+
|
157
|
+
# Set the cities cache
|
158
|
+
state_counties_lookup.each do |state, counties|
|
159
|
+
_write_cache _state_counties_cache(state), counties.sort.uniq
|
92
160
|
end
|
93
161
|
|
94
162
|
# Set the states cache
|
95
|
-
self._write_cache _states,
|
163
|
+
self._write_cache _states, state_cities_lookup.keys.sort
|
164
|
+
|
165
|
+
# Print the alpsed time
|
166
|
+
puts "ZipCoder initialization time: #{Time.now-start_time}"
|
96
167
|
end
|
97
168
|
|
98
169
|
def read_zip_cache(zip)
|
@@ -103,8 +174,12 @@ module Zipcoder
|
|
103
174
|
_read_cache _city_cache(city_state)
|
104
175
|
end
|
105
176
|
|
106
|
-
def
|
107
|
-
_read_cache
|
177
|
+
def read_state_cities_cache(state)
|
178
|
+
_read_cache _state_cities_cache(state)
|
179
|
+
end
|
180
|
+
|
181
|
+
def read_state_counties_cache(state)
|
182
|
+
_read_cache _state_counties_cache(state)
|
108
183
|
end
|
109
184
|
|
110
185
|
def read_states
|
@@ -137,8 +212,12 @@ module Zipcoder
|
|
137
212
|
"#{KEY_CITY}:#{city_state}"
|
138
213
|
end
|
139
214
|
|
140
|
-
def
|
141
|
-
"#{
|
215
|
+
def _state_cities_cache(state)
|
216
|
+
"#{KEY_STATE_CITIES}:#{state}"
|
217
|
+
end
|
218
|
+
|
219
|
+
def _state_counties_cache(state)
|
220
|
+
"#{KEY_STATE_COUNTIES}:#{state}"
|
142
221
|
end
|
143
222
|
|
144
223
|
def _states
|
@@ -152,7 +231,8 @@ module Zipcoder
|
|
152
231
|
# Normalizes the values
|
153
232
|
def _normalize_city(infos)
|
154
233
|
# Values
|
155
|
-
zips =[]
|
234
|
+
zips = []
|
235
|
+
counties = []
|
156
236
|
lat_min = 200
|
157
237
|
lat_max = -200
|
158
238
|
long_min = 200
|
@@ -167,6 +247,7 @@ module Zipcoder
|
|
167
247
|
long_max = info[:long] if info[:long] > long_max
|
168
248
|
end
|
169
249
|
zips << info[:zip]
|
250
|
+
counties += info[:county].split(",")
|
170
251
|
end
|
171
252
|
|
172
253
|
# Create the normalized value
|
@@ -175,6 +256,7 @@ module Zipcoder
|
|
175
256
|
elsif infos.count == 1
|
176
257
|
normalized = {
|
177
258
|
city: infos[0][:city],
|
259
|
+
county: infos[0][:county],
|
178
260
|
state: infos[0][:state],
|
179
261
|
zip: infos[0][:zip],
|
180
262
|
lat: infos[0][:lat],
|
@@ -183,6 +265,7 @@ module Zipcoder
|
|
183
265
|
else
|
184
266
|
normalized = {
|
185
267
|
city: infos[0][:city],
|
268
|
+
county: counties.uniq.join(","),
|
186
269
|
state: infos[0][:state],
|
187
270
|
zip: zips.combine_zips,
|
188
271
|
lat: ((lat_min+lat_max)/2).round(4),
|
data/lib/zipcoder/ext/string.rb
CHANGED
data/lib/zipcoder/version.rb
CHANGED
data/lib/zipcoder.rb
CHANGED
@@ -141,12 +141,12 @@ module Zipcoder
|
|
141
141
|
keys = kwargs[:keys]
|
142
142
|
|
143
143
|
# Filter the returned cities
|
144
|
-
cities = self.cacher.
|
144
|
+
cities = self.cacher.read_state_cities_cache(state)
|
145
145
|
if names_only
|
146
146
|
cities
|
147
147
|
else
|
148
148
|
infos = []
|
149
|
-
self.cacher.
|
149
|
+
self.cacher.read_state_cities_cache(state).each { |city|
|
150
150
|
infos << self.city_info("#{city}, #{state}", keys: keys)
|
151
151
|
}
|
152
152
|
|
@@ -154,6 +154,14 @@ module Zipcoder
|
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
157
|
+
# Returns the counties in a state
|
158
|
+
def self.state_counties(state, **kwargs)
|
159
|
+
state = state.strip.upcase
|
160
|
+
|
161
|
+
# Return the counties
|
162
|
+
self.cacher.read_state_counties_cache(state)
|
163
|
+
end
|
164
|
+
|
157
165
|
# Returns the states
|
158
166
|
def self.states
|
159
167
|
self.cacher.read_states
|
data/spec/zipcoder_spec.rb
CHANGED
@@ -22,6 +22,7 @@ describe Zipcoder do
|
|
22
22
|
it "returns the info for a particular zip_code" do
|
23
23
|
zip_info = described_class.zip_info "78748"
|
24
24
|
expect(zip_info[:city]).to eq("Austin")
|
25
|
+
expect(zip_info[:county]).to eq("Travis,Williamson,Hays")
|
25
26
|
expect(zip_info[:state]).to eq("TX")
|
26
27
|
expect(zip_info[:zip]).to eq("78748")
|
27
28
|
expect(zip_info[:lat]).to eq(30.26)
|
@@ -31,6 +32,7 @@ describe Zipcoder do
|
|
31
32
|
it "returns the info for a particular zip_code" do
|
32
33
|
zip_info = described_class.zip_info 78748
|
33
34
|
expect(zip_info[:city]).to eq("Austin")
|
35
|
+
expect(zip_info[:county]).to eq("Travis,Williamson,Hays")
|
34
36
|
expect(zip_info[:state]).to eq("TX")
|
35
37
|
expect(zip_info[:zip]).to eq("78748")
|
36
38
|
expect(zip_info[:lat]).to eq(30.26)
|
@@ -46,6 +48,7 @@ describe Zipcoder do
|
|
46
48
|
it "only returns specified keys" do
|
47
49
|
zip_info = described_class.zip_info "78748", keys: [:city, :state]
|
48
50
|
expect(zip_info[:city]).to eq("Austin")
|
51
|
+
expect(zip_info[:county]).to be_nil
|
49
52
|
expect(zip_info[:state]).to eq("TX")
|
50
53
|
expect(zip_info[:zip]).to be_nil
|
51
54
|
expect(zip_info[:lat]).to be_nil
|
@@ -87,6 +90,7 @@ describe Zipcoder do
|
|
87
90
|
it "returns the normalized city/state value" do
|
88
91
|
city_info = described_class.city_info "Austin, TX"
|
89
92
|
expect(city_info[:city]).to eq("Austin")
|
93
|
+
expect(city_info[:county]).to eq("Travis,Williamson,Hays")
|
90
94
|
expect(city_info[:state]).to eq("TX")
|
91
95
|
expect(city_info[:zip].start_with?("78701")).to eq(true)
|
92
96
|
expect(city_info[:lat]).to eq(30.315)
|
@@ -96,6 +100,7 @@ describe Zipcoder do
|
|
96
100
|
it "returns the normalized city/state value with space" do
|
97
101
|
city_info = described_class.city_info " San Antonio , TX"
|
98
102
|
expect(city_info[:city]).to eq("San Antonio")
|
103
|
+
expect(city_info[:county]).to eq("Bexar,Comal")
|
99
104
|
expect(city_info[:state]).to eq("TX")
|
100
105
|
expect(city_info[:zip].start_with?("78201")).to eq(true)
|
101
106
|
expect(city_info[:lat]).to eq(29.435)
|
@@ -125,6 +130,7 @@ describe Zipcoder do
|
|
125
130
|
|
126
131
|
city_info = cities[0]
|
127
132
|
expect(city_info[:city]).to eq("Abbott")
|
133
|
+
expect(city_info[:county]).to eq("Hill")
|
128
134
|
expect(city_info[:state]).to eq("TX")
|
129
135
|
expect(city_info[:zip]).to eq("76621")
|
130
136
|
expect(city_info[:lat]).to eq(31.88)
|
@@ -136,6 +142,7 @@ describe Zipcoder do
|
|
136
142
|
|
137
143
|
city_info = cities[0]
|
138
144
|
expect(city_info[:city]).to eq("Abbott")
|
145
|
+
expect(city_info[:county]).to be_nil
|
139
146
|
expect(city_info[:state]).to be_nil
|
140
147
|
expect(city_info[:zip]).to eq("76621")
|
141
148
|
expect(city_info[:lat]).to be_nil
|
@@ -149,6 +156,15 @@ describe Zipcoder do
|
|
149
156
|
end
|
150
157
|
end
|
151
158
|
|
159
|
+
describe "#state_counties" do
|
160
|
+
it "returns the names of the counties for a state" do
|
161
|
+
counties = described_class.state_counties "TX"
|
162
|
+
expect(counties.count).to eq(250)
|
163
|
+
|
164
|
+
expect(counties[0]).to eq("Anderson")
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
152
168
|
describe "#zip_cities" do
|
153
169
|
it "returns a city for one zip code" do
|
154
170
|
zip_cities = "78748".zip_cities
|
@@ -156,6 +172,7 @@ describe Zipcoder do
|
|
156
172
|
|
157
173
|
zip_info = zip_cities[0]
|
158
174
|
expect(zip_info[:city]).to eq("Austin")
|
175
|
+
expect(zip_info[:county]).to eq("Travis,Williamson,Hays")
|
159
176
|
expect(zip_info[:state]).to eq("TX")
|
160
177
|
expect(zip_info[:zip]).to eq("78701-78705,78710,78712,78717,78719,78721-78739,78741-78742,78744-78754,78756-78759,78798-78799")
|
161
178
|
expect(zip_info[:specified_zip]).to eq("78748")
|
@@ -169,6 +186,7 @@ describe Zipcoder do
|
|
169
186
|
|
170
187
|
zip_info = zip_cities[0]
|
171
188
|
expect(zip_info[:city]).to eq("Austin")
|
189
|
+
expect(zip_info[:county]).to eq("Travis,Williamson,Hays")
|
172
190
|
expect(zip_info[:state]).to eq("TX")
|
173
191
|
expect(zip_info[:zip]).to eq("78701-78705,78710,78712,78717,78719,78721-78739,78741-78742,78744-78754,78756-78759,78798-78799")
|
174
192
|
expect(zip_info[:specified_zip]).to eq("78702-78705,78710,78712,78717,78719,78721-78739,78741-78742,78744-78750")
|
@@ -177,6 +195,7 @@ describe Zipcoder do
|
|
177
195
|
|
178
196
|
zip_info = zip_cities[1]
|
179
197
|
expect(zip_info[:city]).to eq("Cedar Park")
|
198
|
+
expect(zip_info[:county]).to eq("Williamson")
|
180
199
|
expect(zip_info[:state]).to eq("TX")
|
181
200
|
expect(zip_info[:zip]).to eq("78613")
|
182
201
|
expect(zip_info[:specified_zip]).to eq("78613")
|
@@ -201,6 +220,7 @@ describe Zipcoder do
|
|
201
220
|
|
202
221
|
zip_info = zip_cities["78701-78705,78710,78712,78717,78719,78721-78739,78741-78742,78744-78751"]
|
203
222
|
expect(zip_info[:city]).to eq("Austin")
|
223
|
+
expect(zip_info[:county]).to eq("Travis,Williamson,Hays")
|
204
224
|
expect(zip_info[:state]).to eq("TX")
|
205
225
|
expect(zip_info[:zip]).to eq("78701-78705,78710,78712,78717,78719,78721-78739,78741-78742,78744-78754,78756-78759,78798-78799")
|
206
226
|
expect(zip_info[:lat]).to eq(30.315)
|
@@ -208,6 +228,7 @@ describe Zipcoder do
|
|
208
228
|
|
209
229
|
zip_info = zip_cities["78613"]
|
210
230
|
expect(zip_info[:city]).to eq("Cedar Park")
|
231
|
+
expect(zip_info[:county]).to eq("Williamson")
|
211
232
|
expect(zip_info[:state]).to eq("TX")
|
212
233
|
expect(zip_info[:zip]).to eq("78613")
|
213
234
|
expect(zip_info[:lat]).to eq(30.51)
|
@@ -215,6 +236,7 @@ describe Zipcoder do
|
|
215
236
|
|
216
237
|
zip_info = zip_cities["13601"]
|
217
238
|
expect(zip_info[:city]).to eq("Watertown")
|
239
|
+
expect(zip_info[:county]).to eq("Jefferson")
|
218
240
|
expect(zip_info[:state]).to eq("NY")
|
219
241
|
expect(zip_info[:zip]).to eq("13601-13603")
|
220
242
|
expect(zip_info[:lat]).to eq(43.97)
|
@@ -257,6 +279,7 @@ describe Zipcoder do
|
|
257
279
|
it "returns the info for a particular zip_code" do
|
258
280
|
zip_info = "78748".zip_info
|
259
281
|
expect(zip_info[:city]).to eq("Austin")
|
282
|
+
expect(zip_info[:county]).to eq("Travis,Williamson,Hays")
|
260
283
|
expect(zip_info[:state]).to eq("TX")
|
261
284
|
expect(zip_info[:zip]).to eq("78748")
|
262
285
|
expect(zip_info[:lat]).to eq(30.26)
|
@@ -266,6 +289,7 @@ describe Zipcoder do
|
|
266
289
|
it "only returns specified keys" do
|
267
290
|
zip_info = "78748".zip_info keys: [:city, :state]
|
268
291
|
expect(zip_info[:city]).to eq("Austin")
|
292
|
+
expect(zip_info[:county]).to be_nil
|
269
293
|
expect(zip_info[:state]).to eq("TX")
|
270
294
|
expect(zip_info[:zip]).to be_nil
|
271
295
|
expect(zip_info[:lat]).to be_nil
|
@@ -277,6 +301,7 @@ describe Zipcoder do
|
|
277
301
|
it "returns the info for a particular city" do
|
278
302
|
city_info = "Austin, TX".city_info
|
279
303
|
expect(city_info[:city]).to eq("Austin")
|
304
|
+
expect(city_info[:county]).to eq("Travis,Williamson,Hays")
|
280
305
|
expect(city_info[:state]).to eq("TX")
|
281
306
|
expect(city_info[:zip].start_with?("78701")).to eq(true)
|
282
307
|
expect(city_info[:lat]).to eq(30.315)
|
@@ -286,6 +311,7 @@ describe Zipcoder do
|
|
286
311
|
it "only returns specified keys" do
|
287
312
|
city_info = "Austin, TX".city_info keys: [:zip, :city]
|
288
313
|
expect(city_info[:city]).to eq("Austin")
|
314
|
+
expect(city_info[:county]).to be_nil
|
289
315
|
expect(city_info[:state]).to be_nil
|
290
316
|
expect(city_info[:zip].start_with?("78701")).to eq(true)
|
291
317
|
expect(city_info[:lat]).to be_nil
|
@@ -302,6 +328,7 @@ describe Zipcoder do
|
|
302
328
|
it "returns the specified zip codes in the filter" do
|
303
329
|
city_info = "Austin, TX".city_info filter: "78701-78704,78748,13601"
|
304
330
|
expect(city_info[:city]).to eq("Austin")
|
331
|
+
expect(city_info[:county]).to eq("Travis,Williamson,Hays")
|
305
332
|
expect(city_info[:state]).to eq("TX")
|
306
333
|
expect(city_info[:specified_zip]).to eq("78701-78704,78748")
|
307
334
|
expect(city_info[:zip].start_with?("78701")).to eq(true)
|
@@ -312,6 +339,7 @@ describe Zipcoder do
|
|
312
339
|
it "returns the specified zip codes in the filter with space" do
|
313
340
|
city_info = "Austin, TX".city_info filter: " 78701 "
|
314
341
|
expect(city_info[:city]).to eq("Austin")
|
342
|
+
expect(city_info[:county]).to eq("Travis,Williamson,Hays")
|
315
343
|
expect(city_info[:state]).to eq("TX")
|
316
344
|
expect(city_info[:specified_zip]).to eq("78701")
|
317
345
|
expect(city_info[:zip].start_with?("78701")).to eq(true)
|
@@ -332,6 +360,7 @@ describe Zipcoder do
|
|
332
360
|
it "returns the info for an acceptable city" do
|
333
361
|
city_info = "West Lake Hills, TX".city_info
|
334
362
|
expect(city_info[:city]).to eq("West Lake Hills")
|
363
|
+
expect(city_info[:county]).to eq("Travis")
|
335
364
|
expect(city_info[:state]).to eq("TX")
|
336
365
|
expect(city_info[:zip]).to eq("78746")
|
337
366
|
expect(city_info[:lat]).to eq(30.26)
|
@@ -346,6 +375,7 @@ describe Zipcoder do
|
|
346
375
|
|
347
376
|
city_info = cities[0]
|
348
377
|
expect(city_info[:city]).to eq("Abbott")
|
378
|
+
expect(city_info[:county]).to eq("Hill")
|
349
379
|
expect(city_info[:state]).to eq("TX")
|
350
380
|
expect(city_info[:zip]).to eq("76621")
|
351
381
|
expect(city_info[:lat]).to eq(31.88)
|
@@ -357,6 +387,7 @@ describe Zipcoder do
|
|
357
387
|
|
358
388
|
city_info = cities[0]
|
359
389
|
expect(city_info[:city]).to eq("Abbott")
|
390
|
+
expect(city_info[:county]).to be_nil
|
360
391
|
expect(city_info[:state]).to be_nil
|
361
392
|
expect(city_info[:zip]).to eq("76621")
|
362
393
|
expect(city_info[:lat]).to be_nil
|
@@ -375,12 +406,22 @@ describe Zipcoder do
|
|
375
406
|
expect(contains_acceptable).to eq(true)
|
376
407
|
end
|
377
408
|
end
|
409
|
+
|
410
|
+
describe "#state_counties" do
|
411
|
+
it "returns the names of the counties for a state" do
|
412
|
+
counties = "TX".state_counties
|
413
|
+
expect(counties.count).to eq(250)
|
414
|
+
|
415
|
+
expect(counties[0]).to eq("Anderson")
|
416
|
+
end
|
417
|
+
end
|
378
418
|
end
|
379
419
|
|
380
420
|
describe("Integer") do
|
381
421
|
it "returns the info for a particular zip_code" do
|
382
422
|
zip_info = 78748.zip_info
|
383
423
|
expect(zip_info[:city]).to eq("Austin")
|
424
|
+
expect(zip_info[:county]).to eq("Travis,Williamson,Hays")
|
384
425
|
expect(zip_info[:state]).to eq("TX")
|
385
426
|
expect(zip_info[:zip]).to eq("78748")
|
386
427
|
expect(zip_info[:lat]).to eq(30.26)
|
data/zipcoder.gemspec
CHANGED
@@ -7,11 +7,10 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "zipcoder"
|
8
8
|
spec.version = Zipcoder::VERSION
|
9
9
|
spec.authors = ["Eric Chapman"]
|
10
|
-
spec.email = ["
|
10
|
+
spec.email = ["chapman@e2tec.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{Converts zip codes to cities, lat/long, and vice-versa}
|
13
|
-
|
14
|
-
spec.homepage = 'https://github.com/ericchapman/zipcoder'
|
13
|
+
spec.homepage = 'https://github.com/e2technologies/zipcoder'
|
15
14
|
spec.license = "MIT"
|
16
15
|
|
17
16
|
spec.files = `git ls-files -z`.split("\x0")
|
metadata
CHANGED
@@ -1,111 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zipcoder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Chapman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.7'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 3.5.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 3.5.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: simplecov
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: codecov
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: redis
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 3.3.5
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ~>
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 3.3.5
|
97
97
|
description:
|
98
98
|
email:
|
99
|
-
-
|
99
|
+
- chapman@e2tec.com
|
100
100
|
executables:
|
101
101
|
- console
|
102
102
|
- setup
|
103
103
|
extensions: []
|
104
104
|
extra_rdoc_files: []
|
105
105
|
files:
|
106
|
-
- .gitignore
|
107
|
-
- .rspec
|
108
|
-
- .ruby-version
|
106
|
+
- ".gitignore"
|
107
|
+
- ".rspec"
|
108
|
+
- ".ruby-version"
|
109
109
|
- Gemfile
|
110
110
|
- LICENSE.txt
|
111
111
|
- README.md
|
@@ -113,6 +113,7 @@ files:
|
|
113
113
|
- bin/console
|
114
114
|
- bin/setup
|
115
115
|
- circle.yml
|
116
|
+
- lib/data/county.csv
|
116
117
|
- lib/data/zip_data.yml
|
117
118
|
- lib/data/zipcode.csv
|
118
119
|
- lib/zipcoder.rb
|
@@ -128,7 +129,7 @@ files:
|
|
128
129
|
- spec/spec_helper.rb
|
129
130
|
- spec/zipcoder_spec.rb
|
130
131
|
- zipcoder.gemspec
|
131
|
-
homepage: https://github.com/
|
132
|
+
homepage: https://github.com/e2technologies/zipcoder
|
132
133
|
licenses:
|
133
134
|
- MIT
|
134
135
|
metadata: {}
|
@@ -138,17 +139,17 @@ require_paths:
|
|
138
139
|
- lib
|
139
140
|
required_ruby_version: !ruby/object:Gem::Requirement
|
140
141
|
requirements:
|
141
|
-
- -
|
142
|
+
- - ">="
|
142
143
|
- !ruby/object:Gem::Version
|
143
144
|
version: '2.0'
|
144
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
146
|
requirements:
|
146
|
-
- -
|
147
|
+
- - ">="
|
147
148
|
- !ruby/object:Gem::Version
|
148
149
|
version: '0'
|
149
150
|
requirements: []
|
150
151
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.
|
152
|
+
rubygems_version: 2.6.14
|
152
153
|
signing_key:
|
153
154
|
specification_version: 4
|
154
155
|
summary: Converts zip codes to cities, lat/long, and vice-versa
|