geolookup 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +3 -0
- data/lib/geolookup/usa/state.rb +15 -1
- data/lib/geolookup/version.rb +1 -1
- data/spec/lib/state_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7efbb53169b86cd200ce73fe96417bee806aa258
|
4
|
+
data.tar.gz: 619b70440587d06b3649e6cb6d803045fda64aa0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 868b6188745b3540eee7a7b4eea25da95805fc5acc4e647d8afcd34fde847668bd310b1a645cb95213cb3b92d44ec7c9bdab99e57b9ef130f0a59f278e319c67
|
7
|
+
data.tar.gz: 26a29839df85dc22514321b9e5a2adaae01b0bcf0a11dcbd7568ac4b7f7da49d5e13f8cd38fa2c48177aea75543d6c411b8e8d70053fa0ebaea409427f39506b
|
data/CHANGELOG.rdoc
CHANGED
data/lib/geolookup/usa/state.rb
CHANGED
@@ -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 >
|
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
|
#
|
data/lib/geolookup/version.rb
CHANGED
data/spec/lib/state_spec.rb
CHANGED
@@ -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.
|
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-
|
13
|
+
date: 2014-10-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|