zipcoder 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fde88ab0a0441409d798cf1cb4ec90fb7942a218
4
- data.tar.gz: 839d0d315be9dbff593cdf0c8938e1e2ec8a9e58
3
+ metadata.gz: 8583ba7540cd24d0c9f89a579c0e31214628bbd5
4
+ data.tar.gz: a5fa272bc9e0af6af5b0c253f927ffb9097f9eab
5
5
  SHA512:
6
- metadata.gz: ee21dfd66e245dc4b5a995d33f641a66ad21c9724cca7c2a3c900aa58535c040e573fa8e0b18875440f383aba91197c553d2687af10883171ee127adc0499a63
7
- data.tar.gz: 952e42c0a34cf2ef62e8b142d9bb54444792045e6bbed3046df869c8f76dfa45ef2012b8be86a004bbac1a5afdaa6e5a4c6c3a7776dc75818d26d558a04f85d6
6
+ metadata.gz: 619afa13403aeb4635044adf2f8959d8805d7e3aa8e88022bb17730d4422810641c6f606c5c9d53ff29307f9cde4ed6056d54a8317e130ecbf84906043fe4275
7
+ data.tar.gz: 2de612f6a33e140af55859e1182119fc1a9f6ab8a5e9077c4cfb0409343f9ae7e84575008fe3c19e0bc08e5028b5141c5ea39bc6867c4e8bd47cef040b24fc56
data/README.md CHANGED
@@ -7,6 +7,8 @@ Gem for performing zip code lookup operations
7
7
 
8
8
  ## Revision History
9
9
 
10
+ - v0.8.3:
11
+ - added whitespace removal to "breakout_zips" to handle situation with spaces
10
12
  - v0.8.2:
11
13
  - fixed exception if it can't find the city when "filter" is used
12
14
  - v0.8.1:
@@ -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|
@@ -1,3 +1,3 @@
1
1
  module Zipcoder
2
- VERSION = "0.8.2"
2
+ VERSION = "0.8.3"
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zipcoder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Chapman