geolookup 0.5.7 → 0.5.8

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: dcd267b945c4da74fdf8a9ccaf277d281dd2a779
4
- data.tar.gz: b179652672aaf9fe4f3fe23c9d9c9f96164e5940
3
+ metadata.gz: 7efbb53169b86cd200ce73fe96417bee806aa258
4
+ data.tar.gz: 619b70440587d06b3649e6cb6d803045fda64aa0
5
5
  SHA512:
6
- metadata.gz: fa2ec426346d4df537580d60b4d05143e90d78d475f8628c33045fe04c9358e565910fac25ea5299e27b1e75167badc20ecec64c52d65688d27f0fae87ea152b
7
- data.tar.gz: 59c54b00d8f8c44f6945e4728646c5ed76c60ea7112ad6c72371d77048bc69913cacd49e49a3fab6b0ea853742d064d72072e12f0af200e235f15a9430f0fb2d
6
+ metadata.gz: 868b6188745b3540eee7a7b4eea25da95805fc5acc4e647d8afcd34fde847668bd310b1a645cb95213cb3b92d44ec7c9bdab99e57b9ef130f0a59f278e319c67
7
+ data.tar.gz: 26a29839df85dc22514321b9e5a2adaae01b0bcf0a11dcbd7568ac4b7f7da49d5e13f8cd38fa2c48177aea75543d6c411b8e8d70053fa0ebaea409427f39506b
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ === 0.5.8
2
+ - Adding state.domestic_names to return an array of domestic US state names
3
+
1
4
  === 0.5.7
2
5
  - Adding state.domestic_abbreviations to return an array of domestic US states
3
6
 
@@ -7,12 +7,15 @@ 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
+ DOMESTIC_STATE_CUTOFF = 56
10
11
 
11
12
  @state_code_to_full
12
13
  @state_code_to_abbreviation
13
14
  @state_name_to_code
14
15
  @state_abbreviation_to_name
15
16
  @state_lat_long
17
+ @domestic_state_code_to_name
18
+ @domestic_state_code_to_abbreviation
16
19
  ###################################################################
17
20
  # self.code_to_name
18
21
  #
@@ -99,10 +102,21 @@ module Geolookup
99
102
  # Returns an array of state abbreviations
100
103
  #
101
104
  def self.domestic_abbreviations
102
- @domestic_state_code_to_abbreviation ||= Geolookup.load_hash_from_file(STATE_CODE_TO_ABBREVIATION_FILE).delete_if{|code, abbr| code > 56}
105
+ @domestic_state_code_to_abbreviation ||= Geolookup.load_hash_from_file(STATE_CODE_TO_ABBREVIATION_FILE).delete_if{|code, abbr| code > DOMESTIC_STATE_CUTOFF}
103
106
  @domestic_state_code_to_abbreviation.values
104
107
  end
105
108
 
109
+
110
+ ###################################################################
111
+ # self.domestic_names
112
+ #
113
+ # Returns an array of domestic state names
114
+ #
115
+ def self.domestic_names
116
+ @domestic_state_code_to_name ||= Geolookup.load_hash_from_file(STATE_CODE_TO_FULL_FILE).delete_if{|code, abbr| code > DOMESTIC_STATE_CUTOFF}
117
+ @domestic_state_code_to_name.values
118
+ end
119
+
106
120
  ###################################################################
107
121
  # self.names
108
122
  #
@@ -1,3 +1,3 @@
1
1
  module Geolookup
2
- VERSION = "0.5.7"
2
+ VERSION = "0.5.8"
3
3
  end
@@ -133,4 +133,14 @@ describe "Geolookup::USA::State" do
133
133
  expect(Geolookup::USA::State.domestic_abbreviations.length).to eql(51)
134
134
  end
135
135
  end
136
+
137
+ describe "#domestic_names" do
138
+ it "should return array of X states" do
139
+ expect(Geolookup::USA::State.domestic_names.length).to eql(51)
140
+ end
141
+
142
+ it "should not return Guam" do
143
+ expect(Geolookup::USA::State.domestic_names).to_not include("Guam")
144
+ end
145
+ end
136
146
  end
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.5.7
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Fonacier
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-09-02 00:00:00.000000000 Z
13
+ date: 2014-10-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler