From c077dbf0334f1356a6f4ec5176fe856941d30171 Mon Sep 17 00:00:00 2001 From: Sean Browning Date: Sat, 1 Jun 2013 15:04:57 -0700 Subject: [PATCH 1/2] added an additional michigan zipcode --- lib/tzip/base.rb | 4 ++-- lib/tzip/values/eastern.rb | 2 +- spec/tzip_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tzip/base.rb b/lib/tzip/base.rb index 5f6cf9d..da19409 100644 --- a/lib/tzip/base.rb +++ b/lib/tzip/base.rb @@ -3,8 +3,8 @@ module ClassMethods def find_by_zipcode(zipcode) [5,4,3,2,1].each do |i| return MAPPING[zipcode.to_s[0,i]] if MAPPING.has_key?(zipcode.to_s[0,i]) - end + end return nil end end -end \ No newline at end of file +end diff --git a/lib/tzip/values/eastern.rb b/lib/tzip/values/eastern.rb index 7888356..1a23ca7 100644 --- a/lib/tzip/values/eastern.rb +++ b/lib/tzip/values/eastern.rb @@ -1,6 +1,6 @@ module TZip ZONINGS[:eastern] = %w{0 1 2} ZONINGS[:eastern] += %w{30 31 32 33 34 376 379 398 399} - ZONINGS[:eastern] += %w{402 405 410 43 44 45 460 462 462 480 481 482 483 485 488 489 490 495 496 } + ZONINGS[:eastern] += %w{402 405 410 43 44 45 460 462 462 480 481 482 483 484 485 488 489 490 495 496 } ZONINGS[:eastern] += %w{569} end diff --git a/spec/tzip_spec.rb b/spec/tzip_spec.rb index 8756142..b3a1e35 100644 --- a/spec/tzip_spec.rb +++ b/spec/tzip_spec.rb @@ -17,7 +17,7 @@ } # Eastern - %w(00926 08701 11226 23464 28269 30043 30044 48201 48109 32308 37604 37917 32207 32216 41017 40502 46032 48124 48197 48307 48532 48912 49008 49546 49684 48503 ).each{|zip| + %w(00926 08701 11226 23464 28269 30043 30044 48201 48430 48109 32308 37604 37917 32207 32216 41017 40502 46032 48124 48197 48307 48532 48912 49008 49546 49684 48503 ).each{|zip| it { print zip; lookup_zip(zip).should == 'Eastern Time (US & Canada)' } } From b4c39a28a751bedf08d4cc9c81c39907d3a9981e Mon Sep 17 00:00:00 2001 From: Sean Browning Date: Sat, 1 Jun 2013 15:41:00 -0700 Subject: [PATCH 2/2] added additional MI zipcodes that border WI and use central tz. --- lib/tzip/values/central.rb | 2 +- lib/tzip/values/eastern.rb | 2 +- spec/tzip_spec.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tzip/values/central.rb b/lib/tzip/values/central.rb index a32bda6..023bd63 100644 --- a/lib/tzip/values/central.rb +++ b/lib/tzip/values/central.rb @@ -1,6 +1,6 @@ module TZip ZONINGS[:central] = %w{35 36 370 3720 3723 381 383 39 } - ZONINGS[:central] += %w{4641} + ZONINGS[:central] += %w{4641 49801 49812 49815 49821 49831 49834 49847 49858 49873 49874 49881 49887 49892 49893 49896 49920 49935 49938 49947 49968 49969 } ZONINGS[:central] += %w{50 51 52 53 54 55 56 57 581 582 585 } ZONINGS[:central] += %w{60 61 62 63 64 65 660 661 6660 672 680 681 685} ZONINGS[:central] += %w{7} diff --git a/lib/tzip/values/eastern.rb b/lib/tzip/values/eastern.rb index 1a23ca7..8b67aef 100644 --- a/lib/tzip/values/eastern.rb +++ b/lib/tzip/values/eastern.rb @@ -1,6 +1,6 @@ module TZip ZONINGS[:eastern] = %w{0 1 2} ZONINGS[:eastern] += %w{30 31 32 33 34 376 379 398 399} - ZONINGS[:eastern] += %w{402 405 410 43 44 45 460 462 462 480 481 482 483 484 485 488 489 490 495 496 } + ZONINGS[:eastern] += %w{402 405 410 43 44 45 460 462 462 480 481 482 483 484 485 488 489 490 495 496 499} ZONINGS[:eastern] += %w{569} end diff --git a/spec/tzip_spec.rb b/spec/tzip_spec.rb index b3a1e35..e2428bd 100644 --- a/spec/tzip_spec.rb +++ b/spec/tzip_spec.rb @@ -12,12 +12,12 @@ } # Central - %w(37013 38104 38138 38301 60629 66062 67214 58103 58201 58501 66606 68510).each{|zip| + %w(37013 38104 38138 38301 49801 49812 49815 49821 49831 49834 49847 49858 49873 49874 49881 49887 49892 49893 49896 49920 49935 49938 49968 49969 60629 66062 67214 58103 58201 58501 66606 68510).each{|zip| it { print zip; lookup_zip(zip).should == 'Central Time (US & Canada)' } } # Eastern - %w(00926 08701 11226 23464 28269 30043 30044 48201 48430 48109 32308 37604 37917 32207 32216 41017 40502 46032 48124 48197 48307 48532 48912 49008 49546 49684 48503 ).each{|zip| + %w(00926 08701 11226 23464 28269 30043 30044 48201 48430 48109 32308 37604 37917 32207 32216 41017 40502 46032 48124 48197 48307 48532 48912 49008 49925 49546 49684 48503 ).each{|zip| it { print zip; lookup_zip(zip).should == 'Eastern Time (US & Canada)' } }