zipcoder 0.8.2 → 0.8.3
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 +4 -4
- data/README.md +2 -0
- data/lib/zipcoder/ext/string.rb +1 -1
- data/lib/zipcoder/version.rb +1 -1
- data/spec/zipcoder_spec.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8583ba7540cd24d0c9f89a579c0e31214628bbd5
|
4
|
+
data.tar.gz: a5fa272bc9e0af6af5b0c253f927ffb9097f9eab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 619afa13403aeb4635044adf2f8959d8805d7e3aa8e88022bb17730d4422810641c6f606c5c9d53ff29307f9cde4ed6056d54a8317e130ecbf84906043fe4275
|
7
|
+
data.tar.gz: 2de612f6a33e140af55859e1182119fc1a9f6ab8a5e9077c4cfb0409343f9ae7e84575008fe3c19e0bc08e5028b5141c5ea39bc6867c4e8bd47cef040b24fc56
|
data/README.md
CHANGED
data/lib/zipcoder/ext/string.rb
CHANGED
@@ -26,7 +26,7 @@ class String
|
|
26
26
|
|
27
27
|
def breakout_zips
|
28
28
|
zips = []
|
29
|
-
self.split(',').each do |zip_group|
|
29
|
+
self.gsub(" ","").split(',').each do |zip_group|
|
30
30
|
if zip_group.include? '-'
|
31
31
|
components = zip_group.split('-')
|
32
32
|
((components[0].to_i)..(components[1].to_i)).each do |zip|
|
data/lib/zipcoder/version.rb
CHANGED
data/spec/zipcoder_spec.rb
CHANGED
@@ -309,6 +309,16 @@ describe Zipcoder do
|
|
309
309
|
expect(city_info[:long]).to eq(-97.71)
|
310
310
|
end
|
311
311
|
|
312
|
+
it "returns the specified zip codes in the filter with space" do
|
313
|
+
city_info = "Austin, TX".city_info filter: " 78701 "
|
314
|
+
expect(city_info[:city]).to eq("Austin")
|
315
|
+
expect(city_info[:state]).to eq("TX")
|
316
|
+
expect(city_info[:specified_zip]).to eq("78701")
|
317
|
+
expect(city_info[:zip].start_with?("78701")).to eq(true)
|
318
|
+
expect(city_info[:lat]).to eq(30.315)
|
319
|
+
expect(city_info[:long]).to eq(-97.71)
|
320
|
+
end
|
321
|
+
|
312
322
|
it "returns nil if it cant find the city" do
|
313
323
|
city_info = "Aus, TX".city_info filter: "78701-78704,78748,13601"
|
314
324
|
expect(city_info).to be_nil
|