geolookup 0.6.0 → 0.6.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 773d3357110d1aa10ba64ffd6bcb9fcd28af738d
4
- data.tar.gz: 8f65d73b0c7962f854d1ec7ee783c0a0277d602f
3
+ metadata.gz: 81a1743dba047a0178fbc0ca5ffc7ad2860b3fe6
4
+ data.tar.gz: fff4b411d4a76123d9d18a972462bcc1e1ea08e5
5
5
  SHA512:
6
- metadata.gz: 0ff0f413d1c97392aa6e326420bb60dda738f7a1f6af7b854ef6442fe5e53ae74e12ac1939ea84e057f12b656859ac62b56408e470ac59fb3f146232daadc080
7
- data.tar.gz: bb5ae40ef7dd919605d8c04e05d430a1062b154453cdd4ca9bc7a03c9d7aa8574d4294c0a49dacdeeab5a0fd06728871d3891bd070d1434a5782d0510202bbda
6
+ metadata.gz: 3be6d9d9366e50014f35dfd32adcd30ac8b2836e99603ca6f6b8cca488077d1a73b0ec0e45afbd7efd5d5a897945a88850bf948c56631928d500f331ac090194
7
+ data.tar.gz: 3e85138d1749fab4887f5da8b2aaac6782edfbea709cf30cad49fef2661561bd4aa548928f10911bfbd6bf6522664933099e8faa0353a4fb097fbc40208a4bc4
@@ -1,4 +1,4 @@
1
- === 0.5.15
1
+ === 0.6.0
2
2
  - Adding lat_long by zipcode lookup
3
3
 
4
4
  === 0.5.13
@@ -49,4 +49,4 @@
49
49
 
50
50
  === 0.1.0
51
51
 
52
- - Inititial Gem
52
+ - Inititial Gem
@@ -0,0 +1,5 @@
1
+ ---
2
+ 60: American Samoa
3
+ 66: Guam
4
+ 69: Northern Mariana Islands
5
+ 78: Virgin Islands
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Geolookup
2
- VERSION = '0.6.0'
2
+ VERSION = '0.6.1'
3
3
  end
@@ -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.0
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-11 00:00:00.000000000 Z
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