ziptz 1.1.37 → 2.0.0

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
  SHA256:
3
- metadata.gz: a7d2f0fd9f3aaf2040ec18fd975aeca7314596292bf22912e379043f08e8ffc6
4
- data.tar.gz: 07de026ce831cc3010aead537f8e6b6da68dc0ce236192f20f34963a7694e38d
3
+ metadata.gz: 5c36416c578b6e6fe58181907429f71d2e12d0c74c1331aa025a9b3b59d8135b
4
+ data.tar.gz: 2942ed2c23881d8f9032dffd74053a9a6291e467e013ab8bc1172906d39ee861
5
5
  SHA512:
6
- metadata.gz: b200931cd9d4160b668a9782f1808e5b3627d28212a980456d31945f57b34f53ad7e0c722d1e97b2326bfcfed7e4de43af4e20088c3af4bd5461fa4d71ac8514
7
- data.tar.gz: 3ce4426bdb6c1ed6b87425c566588d117029bf7319954704da1444d0000d6ef3ace01c7c02579eb5e5ccce19b67aed7bb88e9288f77b6b22e742e6315c2ad810
6
+ metadata.gz: 4617b3380eee2117b071f1e2c00dd65e2005e72cde770e187c9de5383f16a4e47ebefe9bb4b99148a379af133b38c900f7b7f6a09287be491ec5b56f087cd8bd
7
+ data.tar.gz: 69dab2c9bcec57d48d0bf77b711e11b174eda4ec1c7c239c1008bdb403da2f09442f5130c8bfa3da2224da717a23460ef5fc000c52063bac0e9be6d5fd8abc02
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ziptz (1.1.37)
4
+ ziptz (2.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -20,7 +20,7 @@ Add the gem to your Gemfile:
20
20
  Get the time zone name for any ZIP code:
21
21
 
22
22
  z = Ziptz.new
23
- z.time_zone_name('97213') #=> "Pacific"
23
+ z.time_zone_name('97213') #=> "America/Los_Angeles"
24
24
 
25
25
  Get the time zone offset for any ZIP code:
26
26
 
@@ -34,26 +34,44 @@ Determine if the ZIP code uses Daylight Saving Time:
34
34
 
35
35
  Get all the zip codes in a time zone:
36
36
 
37
- z.zips('American Samoa') #=> ["96799", "96941", "96942", "96943", "96944"]
37
+ z.zips('Pacific/Pago_Pago') #=> ["96799", "96941", "96942", "96943", "96944"]
38
38
 
39
39
 
40
40
  ## Supported Time Zones
41
41
 
42
- * "Atlantic" UTC -04:00
43
- * "Eastern" UTC -05:00
44
- * "Central" UTC -06:00
45
- * "Mountain" UTC -07:00
46
- * "Pacific" UTC -08:00
47
- * "Alaska" UTC -09:00
48
- * "Hawaii-Aleutian Islands" UTC -10:00
49
- * "American Samoa" UTC -11:00
50
- * "Marshall Islands" UTC +12:00
51
- * "Guam" UTC +10:00
52
- * "Palau" UTC +09:00
53
- * "Micronesia" UTC +11:00
42
+ * "America/Puerto_Rico" UTC -04:00
43
+ * "America/New_York" UTC -05:00
44
+ * "America/Chicago" UTC -06:00
45
+ * "America/Denver" UTC -07:00
46
+ * "America/Los_Angeles" UTC -08:00
47
+ * "America/Anchorage" UTC -09:00
48
+ * "Pacific/Honolulu" UTC -10:00
49
+ * "Pacific/Pago_Pago" UTC -11:00
50
+ * "Pacific/Majuro" UTC +12:00
51
+ * "Pacific/Guam" UTC +10:00
52
+ * "Pacific/Palau" UTC +09:00
53
+ * "Pacific/Pohnpei" UTC +11:00
54
54
 
55
55
  <em>Note that APO/FPO zip codes will not return a known time zone offset.</em>
56
56
 
57
+ ## Version 2 breaking changes
58
+
59
+ Time zone names now reflect standard tz-database names.
60
+
61
+ | V1 Name | V2 Name |
62
+ | --- | --- |
63
+ | Atlantic | America/Puerto_Rico |
64
+ | Eastern | America/New_York |
65
+ | Central | America/Chicago |
66
+ | Mountain | America/Denver |
67
+ | Pacific | America/Los_Angeles |
68
+ | Hawaii-Aleutian Islands | Pacific/Honolulu |
69
+ | American Samoa | Pacific/Pago_Pago |
70
+ | Marshall Islands | Pacific/Majuro |
71
+ | Guam | Pacific/Guam |
72
+ | Palau | Pacific/Palau |
73
+ | Micronesia | Pacific/Pohnpei |
74
+
57
75
  ## License
58
76
 
59
77
  Copyright (c) 2015-2018 Keith Morrison <<keithm@infused.org>>
data/lib/ziptz.rb CHANGED
@@ -1,22 +1,22 @@
1
1
  require 'yaml'
2
2
 
3
3
  class Ziptz
4
- VERSION = '1.1.37'
4
+ VERSION = '2.0.0'
5
5
 
6
6
  TZ_INFO = {
7
7
  '0' => {name: 'APO/FPO (time zone unknown)', offset: 0},
8
- '4' => {name: 'Atlantic', offset: -4},
9
- '5' => {name: 'Eastern', offset: -5},
10
- '6' => {name: 'Central', offset: -6},
11
- '7' => {name: 'Mountain', offset: -7},
12
- '8' => {name: 'Pacific', offset: -8},
13
- '9' => {name: 'Alaska', offset: -9},
14
- '10' => {name: 'Hawaii-Aleutian Islands', offset: -10},
15
- '11' => {name: 'American Samoa', offset: -11},
16
- '13' => {name: 'Marshall Islands', offset: 12},
17
- '14' => {name: 'Guam', offset: 10},
18
- '15' => {name: 'Palau', offset: 9},
19
- '16' => {name: 'Micronesia', offset: 11}
8
+ '4' => {name: 'America/Puerto_Rico', offset: -4},
9
+ '5' => {name: 'America/New_York', offset: -5},
10
+ '6' => {name: 'America/Chicago', offset: -6},
11
+ '7' => {name: 'America/Denver', offset: -7},
12
+ '8' => {name: 'America/Los_Angeles', offset: -8},
13
+ '9' => {name: 'America/Anchorage', offset: -9},
14
+ '10' => {name: 'America/Adak', offset: -10},
15
+ '11' => {name: 'Pacific/Pago_Pago', offset: -11},
16
+ '13' => {name: 'Pacific/Majuro', offset: 12},
17
+ '14' => {name: 'Pacific/Guam', offset: 10},
18
+ '15' => {name: 'Pacific/Palau', offset: 9},
19
+ '16' => {name: 'Pacific/Pohnpei', offset: 11}
20
20
  }
21
21
 
22
22
  def initialize
data/spec/ziptz_spec.rb CHANGED
@@ -14,7 +14,7 @@ describe Ziptz do
14
14
 
15
15
  context 'when given a 5-digit zipcode' do
16
16
  it 'returns the time zone number' do
17
- expect(ziptz.time_zone_name('97034')).to eq 'Pacific'
17
+ expect(ziptz.time_zone_name('97034')).to eq 'America/Los_Angeles'
18
18
  end
19
19
  end
20
20
 
@@ -30,7 +30,7 @@ describe Ziptz do
30
30
 
31
31
  context 'when given a 5-digit zipcode' do
32
32
  it 'returns the time zone number' do
33
- expect(ziptz.time_zone_name('97034')).to eq 'Pacific'
33
+ expect(ziptz.time_zone_name('97034')).to eq 'America/Los_Angeles'
34
34
  end
35
35
  end
36
36
  end
@@ -57,11 +57,11 @@ describe Ziptz do
57
57
  let(:ziptz) { Ziptz.new }
58
58
 
59
59
  it 'returns an array of zip codes' do
60
- expect(ziptz.zips('American Samoa')).to eq %w(96799)
60
+ expect(ziptz.zips('Pacific/Pago_Pago')).to eq %w(96799)
61
61
  end
62
62
 
63
63
  it 'is case-insensitive' do
64
- expect(ziptz.zips('american samoa')).to eq %w(96799)
64
+ expect(ziptz.zips('Pacific/Pago_Pago')).to eq %w(96799)
65
65
  end
66
66
 
67
67
  it 'returns nil for unknown time zones' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ziptz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.37
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Morrison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-02 00:00:00.000000000 Z
11
+ date: 2018-07-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Get timezone info for all 5-digit US zip codes
14
14
  email: keithm@infused.org