geolookup 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +2 -2
- data/lib/data/IGNORED_STATES.yml +5 -0
- data/lib/geolookup/usa/state.rb +22 -0
- data/lib/geolookup/version.rb +1 -1
- data/spec/lib/state_spec.rb +12 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81a1743dba047a0178fbc0ca5ffc7ad2860b3fe6
|
4
|
+
data.tar.gz: fff4b411d4a76123d9d18a972462bcc1e1ea08e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3be6d9d9366e50014f35dfd32adcd30ac8b2836e99603ca6f6b8cca488077d1a73b0ec0e45afbd7efd5d5a897945a88850bf948c56631928d500f331ac090194
|
7
|
+
data.tar.gz: 3e85138d1749fab4887f5da8b2aaac6782edfbea709cf30cad49fef2661561bd4aa548928f10911bfbd6bf6522664933099e8faa0353a4fb097fbc40208a4bc4
|
data/CHANGELOG.rdoc
CHANGED
data/lib/geolookup/usa/state.rb
CHANGED
@@ -7,6 +7,7 @@ module Geolookup
|
|
7
7
|
STATE_NAME_TO_CODE_FILE = 'STATE_NAME_TO_CODE.yml'
|
8
8
|
STATE_ABBREVIATION_TO_NAME_FILE = 'STATE_FULL_STATE_NAMES.yml'
|
9
9
|
STATE_LAT_LONG_FILE = 'STATE_LAT_LONG.yml'
|
10
|
+
IGNORED_STATES_FILE = 'IGNORED_STATES.yml'
|
10
11
|
DOMESTIC_STATE_CUTOFF = 56
|
11
12
|
|
12
13
|
@state_code_to_full
|
@@ -14,6 +15,7 @@ module Geolookup
|
|
14
15
|
@state_name_to_code
|
15
16
|
@state_abbreviation_to_name
|
16
17
|
@state_lat_long
|
18
|
+
@ignored_states
|
17
19
|
@domestic_state_code_to_name
|
18
20
|
@domestic_state_code_to_abbreviation
|
19
21
|
###################################################################
|
@@ -164,6 +166,26 @@ module Geolookup
|
|
164
166
|
@state_code_to_full.keys
|
165
167
|
end
|
166
168
|
|
169
|
+
###################################################################
|
170
|
+
# self.ignored_state_codes
|
171
|
+
#
|
172
|
+
# Returns an array of ignored state codes
|
173
|
+
#
|
174
|
+
def self.ignored_state_codes
|
175
|
+
@ignored_states ||= Geolookup.load_hash_from_file(IGNORED_STATES_FILE)
|
176
|
+
@ignored_states.keys
|
177
|
+
end
|
178
|
+
|
179
|
+
###################################################################
|
180
|
+
# self.ignored_state_names
|
181
|
+
#
|
182
|
+
# Returns an array of ignored state names
|
183
|
+
#
|
184
|
+
def self.ignored_state_names
|
185
|
+
@ignored_states ||= Geolookup.load_hash_from_file(IGNORED_STATES_FILE)
|
186
|
+
@ignored_states.values
|
187
|
+
end
|
188
|
+
|
167
189
|
class << self
|
168
190
|
alias :abbreviation_to_code :name_to_code
|
169
191
|
alias :abbreviation_to_lat_long :name_to_lat_long
|
data/lib/geolookup/version.rb
CHANGED
data/spec/lib/state_spec.rb
CHANGED
@@ -37,6 +37,18 @@ describe "Geolookup::USA::State" do
|
|
37
37
|
expect(Geolookup::USA::State.codes).to include(6)
|
38
38
|
end
|
39
39
|
end
|
40
|
+
|
41
|
+
describe "#ignored_state_codes" do
|
42
|
+
it 'should return an array of ignored state codes' do
|
43
|
+
expect(Geolookup::USA::State.ignored_state_codes).to include(60)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe "#ignored_state_names" do
|
48
|
+
it 'should return an array of ignored state names' do
|
49
|
+
expect(Geolookup::USA::State.ignored_state_names).to include("American Samoa")
|
50
|
+
end
|
51
|
+
end
|
40
52
|
|
41
53
|
describe "#code_to_abbreviation" do
|
42
54
|
it 'should return a state abbreviation gien a state code' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geolookup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Austin Fonacier
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-05-
|
14
|
+
date: 2016-05-19 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- lib/data/COUNTY_IGNORED_STATES.yml
|
83
83
|
- lib/data/COUNTY_LAT_LONG.yml
|
84
84
|
- lib/data/COUNTY_NAME_TO_CODE.yml
|
85
|
+
- lib/data/IGNORED_STATES.yml
|
85
86
|
- lib/data/METRO_CODE_TO_NAME.yml
|
86
87
|
- lib/data/STATE_CODE_TO_DISPLAY_NAME.yml
|
87
88
|
- lib/data/STATE_CODE_TO_FULL.yml
|