ziptz 2.0.12 → 2.0.13

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: 0522b8aecf63fecac583697d371c8a88a936f5b37aef66fd06f0c46c24a69513
4
- data.tar.gz: 6acba43f5a186f57b34d1f77e6f97959faa00c19bf20237fab5f0ed33994613e
3
+ metadata.gz: 72973320e13a5a4c4356e14344e14e7837e906d5e2ec9d3bbbd9d16099572816
4
+ data.tar.gz: a3579132181b258bbb2739afae37d05dca964f5b6d10fb065a305e40c1781cb9
5
5
  SHA512:
6
- metadata.gz: f3eb35cf0dfd067dcb6b586bf14fde829d55f73b5bbfcbcd2f0ba6d1563630bc3bdc0f442841a61700cdaec13da04da3b971e43fdddd29fe9bdad076d89b4b4f
7
- data.tar.gz: b90206c961af064f9e1f870539364e8560ea19fdd5c076d4774bd35f270dbaa766520e8c089236c6bd509f4c80cc16817e3272573e391420dfc953dadbbac4e6
6
+ metadata.gz: 40ebf00788b9436ea940e649cc6fd3a338ad8d3fdec170b1a4438522587b47aff0db7f1ff5e84a159958a8cb98326e21660a26d03e45ecc1ee7ebba209050dfc
7
+ data.tar.gz: 69262cd17c8b74c18e3f1748273427248759391cfa5d3a518c5964d5be36cd60334e248be62fff44ca22d6dcfd5ff954036491736dca6baeb9990d47840f1db3
@@ -23,7 +23,7 @@ GEM
23
23
  coderay (1.1.2)
24
24
  concurrent-ruby (1.1.5)
25
25
  diff-lcs (1.3)
26
- ffi (1.11.1)
26
+ ffi (1.10.0)
27
27
  formatador (0.2.5)
28
28
  guard (2.15.0)
29
29
  formatador (>= 0.2.4)
@@ -56,11 +56,12 @@ GEM
56
56
  nenv (~> 0.1)
57
57
  shellany (~> 0.0)
58
58
  parallel (1.17.0)
59
- parser (2.6.3.0)
59
+ parser (2.6.2.1)
60
60
  ast (~> 2.4.0)
61
61
  pry (0.12.2)
62
62
  coderay (~> 1.1.0)
63
63
  method_source (~> 0.9.0)
64
+ psych (3.1.0)
64
65
  rainbow (3.0.0)
65
66
  rake (12.3.2)
66
67
  rb-fsevent (0.10.3)
@@ -72,25 +73,26 @@ GEM
72
73
  rspec-mocks (~> 3.8.0)
73
74
  rspec-core (3.8.0)
74
75
  rspec-support (~> 3.8.0)
75
- rspec-expectations (3.8.3)
76
+ rspec-expectations (3.8.2)
76
77
  diff-lcs (>= 1.2.0, < 2.0)
77
78
  rspec-support (~> 3.8.0)
78
79
  rspec-mocks (3.8.0)
79
80
  diff-lcs (>= 1.2.0, < 2.0)
80
81
  rspec-support (~> 3.8.0)
81
82
  rspec-support (3.8.0)
82
- rubocop (0.71.0)
83
+ rubocop (0.67.2)
83
84
  jaro_winkler (~> 1.5.1)
84
85
  parallel (~> 1.10)
85
- parser (>= 2.6)
86
+ parser (>= 2.5, != 2.5.1.1)
87
+ psych (>= 3.1.0)
86
88
  rainbow (>= 2.2.2, < 4.0)
87
89
  ruby-progressbar (~> 1.7)
88
- unicode-display_width (>= 1.4.0, < 1.7)
89
- rubocop-performance (1.3.0)
90
- rubocop (>= 0.68.0)
91
- rubocop-rspec (1.33.0)
90
+ unicode-display_width (>= 1.4.0, < 1.6)
91
+ rubocop-performance (1.1.0)
92
+ rubocop (>= 0.67.0)
93
+ rubocop-rspec (1.32.0)
92
94
  rubocop (>= 0.60.0)
93
- ruby-progressbar (1.10.1)
95
+ ruby-progressbar (1.10.0)
94
96
  ruby_dep (1.5.0)
95
97
  shellany (0.0.1)
96
98
  thor (0.20.3)
@@ -100,7 +102,7 @@ GEM
100
102
  tty-cursor (~> 0.7)
101
103
  tzinfo (1.2.5)
102
104
  thread_safe (~> 0.1)
103
- unicode-display_width (1.6.0)
105
+ unicode-display_width (1.5.0)
104
106
 
105
107
  PLATFORMS
106
108
  ruby
@@ -122,4 +124,4 @@ DEPENDENCIES
122
124
  ziptz!
123
125
 
124
126
  BUNDLED WITH
125
- 1.17.2
127
+ 1.17.3
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Get time zone and daylight saving time for any US ZIP code.
8
8
 
9
- <i>ZIP codes are up to date as of <b>June 2019</b>.</i>
9
+ <i>ZIP codes are up to date as of <b>July 2019</b>.</i>
10
10
 
11
11
  ## Installation
12
12
 
data/Rakefile CHANGED
@@ -38,6 +38,8 @@ task :create_ziptz do
38
38
  alias_attribute :day_light_saving, :DayLightSaving
39
39
  end
40
40
 
41
+ spinner = TTY::Spinner.new('[:spinner] :message')
42
+ spinner.update message: 'Retrieving zip codes from database'
41
43
  data = {}
42
44
  ZipCode.find_each do |zip|
43
45
  next if zip.time_zone.blank? || zip.day_light_saving.blank?
@@ -46,21 +48,23 @@ task :create_ziptz do
46
48
  data[zip.zip_code][:tz] ||= zip.time_zone
47
49
  data[zip.zip_code][:dst] ||= zip.day_light_saving
48
50
  end
49
- spinner = TTY::Spinner.new("[:spinner] Retrieving zip codes from database (#{data.size} records)")
51
+ spinner.update message: "Retrieving zip codes from database (#{data.size} records)"
50
52
  spinner.success
51
53
 
52
- spinner = TTY::Spinner.new('[:spinner] Writing tz.data')
54
+ spinner = TTY::Spinner.new('[:spinner] :message')
55
+ spinner.update message: 'Writing tz.data'
53
56
  spinner.auto_spin
54
57
  lines = data.map { |k, v| "#{k}=#{v[:tz]}" }
55
58
  lines.sort!
56
59
  File.open('data/tz.data', 'w') do |f|
57
60
  lines.each { |line| f.puts line }
58
61
  end
59
- spinner = TTY::Spinner.new "[:spinner] Writing tz.data (#{File.size('data/tz.data').to_s} bytes)"
62
+ spinner.update message: "Writing tz.data (#{File.size('data/tz.data')} bytes)"
60
63
  spinner.success
61
64
  # puts File.size('data/tz.data').to_s
62
65
 
63
- spinner = TTY::Spinner.new('[:spinner] Writing dst.data')
66
+ spinner = TTY::Spinner.new('[:spinner] :message')
67
+ spinner.update message: 'Writing dst.data'
64
68
  spinner.auto_spin
65
69
  lines = data.map { |k, v| "#{k}=#{v[:dst] =~ /y/i ? 1 : 0}" }
66
70
  lines.sort!
@@ -68,7 +72,7 @@ task :create_ziptz do
68
72
  File.open('data/dst.data', 'w') do |f|
69
73
  lines.each { |line| f.puts line }
70
74
  end
71
- spinner = TTY::Spinner.new "[:spinner] Writing dst.data (#{File.size('data/dst.data').to_s} bytes)"
75
+ spinner.update message: "Writing dst.data (#{File.size('data/dst.data')} bytes)"
72
76
  spinner.success
73
77
  rescue StandardError
74
78
  spinner && spinner.error
@@ -3262,6 +3262,7 @@
3262
3262
  09265=1
3263
3263
  09266=1
3264
3264
  09276=1
3265
+ 09277=1
3265
3266
  09278=1
3266
3267
  09289=1
3267
3268
  09290=1
@@ -3309,6 +3310,7 @@
3309
3310
  09421=1
3310
3311
  09447=1
3311
3312
  09454=1
3313
+ 09456=1
3312
3314
  09459=1
3313
3315
  09461=1
3314
3316
  09463=1
@@ -3412,12 +3414,14 @@
3412
3414
  09634=1
3413
3415
  09635=1
3414
3416
  09636=1
3417
+ 09641=1
3415
3418
  09642=1
3416
3419
  09643=1
3417
3420
  09645=1
3418
3421
  09647=1
3419
3422
  09648=1
3420
3423
  09649=1
3424
+ 09665=1
3421
3425
  09701=1
3422
3426
  09702=1
3423
3427
  09703=1
@@ -27420,6 +27424,7 @@
27420
27424
  63178=1
27421
27425
  63179=1
27422
27426
  63180=1
27427
+ 63182=1
27423
27428
  63188=1
27424
27429
  63195=1
27425
27430
  63197=1
@@ -3262,6 +3262,7 @@
3262
3262
  09265=0
3263
3263
  09266=0
3264
3264
  09276=0
3265
+ 09277=0
3265
3266
  09278=0
3266
3267
  09289=0
3267
3268
  09290=0
@@ -3309,6 +3310,7 @@
3309
3310
  09421=0
3310
3311
  09447=0
3311
3312
  09454=0
3313
+ 09456=0
3312
3314
  09459=0
3313
3315
  09461=0
3314
3316
  09463=0
@@ -3412,12 +3414,14 @@
3412
3414
  09634=0
3413
3415
  09635=0
3414
3416
  09636=0
3417
+ 09641=0
3415
3418
  09642=0
3416
3419
  09643=0
3417
3420
  09645=0
3418
3421
  09647=0
3419
3422
  09648=0
3420
3423
  09649=0
3424
+ 09665=0
3421
3425
  09701=0
3422
3426
  09702=0
3423
3427
  09703=0
@@ -27420,6 +27424,7 @@
27420
27424
  63178=6
27421
27425
  63179=6
27422
27426
  63180=6
27427
+ 63182=6
27423
27428
  63188=6
27424
27429
  63195=6
27425
27430
  63197=6
@@ -1,7 +1,7 @@
1
1
  require 'yaml'
2
2
 
3
3
  class Ziptz
4
- VERSION = '2.0.12'.freeze
4
+ VERSION = '2.0.13'.freeze
5
5
 
6
6
  TZ_INFO = {
7
7
  '0' => {name: 'APO/FPO (time zone unknown)', offset: 0},
@@ -3,5 +3,6 @@ require 'yaml'
3
3
  require 'rspec'
4
4
 
5
5
  RSpec.configure do |config|
6
-
6
+ config.order = :random
7
+ config.disable_monkey_patching!
7
8
  end
@@ -1,24 +1,24 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Ziptz do
4
- before(:all) { @ziptz = Ziptz.new }
3
+ RSpec.describe Ziptz do
4
+ let(:ziptz) { Ziptz.new }
5
5
 
6
6
  describe 'when inspected' do
7
7
  it 'does not show internal instance variables' do
8
- expect(@ziptz.inspect).to match(/#<Ziptz:\d+>/)
8
+ expect(ziptz.inspect).to match(/#<Ziptz:\d+>/)
9
9
  end
10
10
  end
11
11
 
12
12
  describe '#time_zone_name' do
13
13
  context 'when given a 5-digit zipcode' do
14
14
  it 'returns the time zone number' do
15
- expect(@ziptz.time_zone_name('97034')).to eq 'America/Los_Angeles'
15
+ expect(ziptz.time_zone_name('97034')).to eq 'America/Los_Angeles'
16
16
  end
17
17
  end
18
18
 
19
19
  context 'when there is no matching zipcode' do
20
20
  it 'returns nil' do
21
- expect(@ziptz.time_zone_name('xyz')).to be_nil
21
+ expect(ziptz.time_zone_name('xyz')).to be_nil
22
22
  end
23
23
  end
24
24
  end
@@ -26,7 +26,7 @@ describe Ziptz do
26
26
  describe '#time_zone_uses_dst?' do
27
27
  context 'when given a 5-digit zipcode' do
28
28
  it 'returns the time zone number' do
29
- expect(@ziptz.time_zone_name('97034')).to eq 'America/Los_Angeles'
29
+ expect(ziptz.time_zone_name('97034')).to eq 'America/Los_Angeles'
30
30
  end
31
31
  end
32
32
  end
@@ -34,14 +34,14 @@ describe Ziptz do
34
34
  describe '#time_zone_offset' do
35
35
  context 'when given a 5-digit zipcode' do
36
36
  it 'returns a boolean' do
37
- expect(@ziptz.time_zone_uses_dst?('97034')).to eq true
38
- expect(@ziptz.time_zone_uses_dst?('85004')).to eq false
37
+ expect(ziptz.time_zone_uses_dst?('97034')).to eq true
38
+ expect(ziptz.time_zone_uses_dst?('85004')).to eq false
39
39
  end
40
40
  end
41
41
 
42
42
  context 'when there is no matching zipcode' do
43
43
  it 'returns nil' do
44
- expect(@ziptz.time_zone_offset('xyz')).to be_nil
44
+ expect(ziptz.time_zone_offset('xyz')).to be_nil
45
45
  end
46
46
  end
47
47
  end
@@ -49,15 +49,15 @@ describe Ziptz do
49
49
  describe '#zips' do
50
50
  context 'when given a time zone' do
51
51
  it 'returns an array of zip codes' do
52
- expect(@ziptz.zips('Pacific/Pago_Pago')).to eq %w[96799]
52
+ expect(ziptz.zips('Pacific/Pago_Pago')).to eq %w[96799]
53
53
  end
54
54
 
55
55
  it 'is case-insensitive' do
56
- expect(@ziptz.zips('Pacific/Pago_Pago')).to eq %w[96799]
56
+ expect(ziptz.zips('pacific/pago_pago')).to eq %w[96799]
57
57
  end
58
58
 
59
59
  it 'returns nil for unknown time zones' do
60
- expect(@ziptz.zips('Glark')).to be_nil
60
+ expect(ziptz.zips('Glark')).to be_nil
61
61
  end
62
62
  end
63
63
  end
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: 2.0.12
4
+ version: 2.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Morrison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-02 00:00:00.000000000 Z
11
+ date: 2019-07-01 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
@@ -51,7 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  requirements: []
54
- rubygems_version: 3.0.3
54
+ rubygems_version: 3.0.4
55
55
  signing_key:
56
56
  specification_version: 4
57
57
  summary: TimeZone info for any 5-digit US zip code