ziptz 4.0.2 → 5.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: e372363dfe77796f0e34f2c5a84e8cb534a023be513ddef02e06ac9996bf0f45
4
- data.tar.gz: bb831c06249d4074173c82f78509c6abfd03aa04795c5379d9ef306f1bcec496
3
+ metadata.gz: 9f1ff0d267b6ba06ee70a99186cd14f8684744f4fd243f56d9b7150117f26cc0
4
+ data.tar.gz: 407d339f02d80651adc97150bccb8e85cac844f948f3e9e7c2d348e110dfc20c
5
5
  SHA512:
6
- metadata.gz: a71f7908c800eab26541917afcbe734872482b4b1578243efb8c17b69dcae8b3f53fc2d89049fd48c1adac5452185a19bf4ab8efc70fab07f97b59b8262fd89e
7
- data.tar.gz: e7c151febd3365c5a5842363b993083d0971f58bbf6b3839b8aa7614f56c602265e866bfe04ca4712621ad79e76b1ee29ff70264ef4ff7a1879790ef18639df6
6
+ metadata.gz: 4724ab134a22f108612b724339343a16f78bfcdad477f378bf6e30154cdb9e2470a6f95964dbabbbfa874253df215a88e93adba6a0e0bcb8a4bc4f6b88eb2e68
7
+ data.tar.gz: 69242029d2511543b28068cc0045f4de2ee00b00458a834dbcd810b736d75090f8c1fa74e8156f124a4857059b93d4f6ba15174e75d2340aa458062821a089df
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015-2023 Keith Morrison <keithm@infused.org>
1
+ Copyright (c) 2015-2024 Keith Morrison <keithm@infused.org>
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -12,7 +12,7 @@ Get time zone, daylight saving time, and base offset for any US ZIP code.
12
12
 
13
13
  Ziptz is tested to work with the following versions of Ruby:
14
14
 
15
- * Ruby 2.3.x, 2.4.x, 2.5.x, 2.6.x, 2.7.x, 3.x
15
+ * Ruby 3.1.x, 3.2.x, 3.3.x
16
16
 
17
17
  ## Installation
18
18
 
@@ -160,7 +160,7 @@ Time zone names now reflect standard tz-database names.
160
160
 
161
161
  ## License
162
162
 
163
- Copyright (c) 2015-2023 Keith Morrison <<keithm@infused.org>>
163
+ Copyright (c) 2015-2024 Keith Morrison <<keithm@infused.org>>
164
164
 
165
165
  Permission is hereby granted, free of charge, to any person
166
166
  obtaining a copy of this software and associated documentation
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Ziptz
2
- VERSION = '4.0.2'.freeze
2
+ VERSION = '5.0.0'.freeze
3
3
  end
data/spec/ziptz_spec.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe Ziptz do
4
- let(:ziptz) { Ziptz.new }
4
+ let(:ziptz) { described_class.new }
5
5
 
6
6
  describe 'when inspected' do
7
7
  it 'does not show internal instance variables' do
@@ -35,37 +35,27 @@ RSpec.describe Ziptz do
35
35
  end
36
36
  end
37
37
 
38
- describe '#time_zone_name' do
39
- context 'when given a 5-digit zipcode' do
40
- it 'returns the time zone number' do
41
- expect(ziptz.time_zone_name('97034')).to eq 'America/Los_Angeles'
42
- end
43
- end
44
-
45
- context 'when given a 9-digit zipcode' do
46
- it 'returns the time zone number' do
47
- expect(ziptz.time_zone_name('97034-1234')).to eq 'America/Los_Angeles'
38
+ describe '#time_zone_uses_dst?' do
39
+ context 'when given a valid 5-digit zipcode' do
40
+ it 'returns true' do
41
+ expect(ziptz.time_zone_uses_dst?('97034')).to eq true
48
42
  end
49
43
  end
50
44
 
51
- context 'when there is no matching zipcode' do
52
- it 'returns nil' do
53
- expect(ziptz.time_zone_name('xyz')).to be_nil
45
+ context 'when given an invalid 5-digit zipcode' do
46
+ it 'returns false' do
47
+ expect(ziptz.time_zone_uses_dst?('85004')).to eq false
54
48
  end
55
49
  end
56
- end
57
50
 
58
- describe '#time_zone_uses_dst?' do
59
- context 'when given a 5-digit zipcode' do
60
- it 'returns a boolean' do
61
- expect(ziptz.time_zone_uses_dst?('97034')).to eq true
62
- expect(ziptz.time_zone_uses_dst?('85004')).to eq false
51
+ context 'when given a valid 9-digit zipcode' do
52
+ it 'returns a true' do
53
+ expect(ziptz.time_zone_uses_dst?('97034-1234')).to eq true
63
54
  end
64
55
  end
65
56
 
66
- context 'when given a 9-digit zipcode' do
67
- it 'returns a boolean' do
68
- expect(ziptz.time_zone_uses_dst?('97034-1234')).to eq true
57
+ context 'when given an invalid 9-digit zipcode' do
58
+ it 'returns false' do
69
59
  expect(ziptz.time_zone_uses_dst?('85004-1234')).to eq false
70
60
  end
71
61
  end
@@ -80,13 +70,13 @@ RSpec.describe Ziptz do
80
70
  describe '#time_zone_offset' do
81
71
  context 'when given a 5-digit zipcode' do
82
72
  it 'returns the time zone number' do
83
- expect(ziptz.time_zone_offset('97034')).to eq(-28800)
73
+ expect(ziptz.time_zone_offset('97034')).to eq(-28_800)
84
74
  end
85
75
  end
86
76
 
87
77
  context 'when given a 9-digit zipcode' do
88
78
  it 'returns the time zone number' do
89
- expect(ziptz.time_zone_offset('97034-1234')).to eq(-28800)
79
+ expect(ziptz.time_zone_offset('97034-1234')).to eq(-28_800)
90
80
  end
91
81
  end
92
82
 
@@ -116,13 +106,13 @@ RSpec.describe Ziptz do
116
106
  describe '#instance' do
117
107
  context 'when given a 5 digit zip code' do
118
108
  it 'matches the behavior of Ziptz.new' do
119
- expect(Ziptz.instance.time_zone_name('97034')).to eq ziptz.time_zone_name('97034')
109
+ expect(described_class.instance.time_zone_name('97034')).to eq ziptz.time_zone_name('97034')
120
110
  end
121
111
  end
122
112
 
123
113
  context 'when called twice' do
124
114
  it 'returns identical instances' do
125
- expect(Ziptz.instance.object_id).to eq Ziptz.instance.object_id
115
+ expect(described_class.instance.object_id).to eq described_class.instance.object_id
126
116
  end
127
117
  end
128
118
  end
data/ziptz.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.extra_rdoc_files = ['README.md', 'LICENSE']
18
18
  s.files = Dir['README.md', 'LICENSE', '{data,lib,spec}/**/*', 'ziptz.gemspec']
19
19
  s.require_paths = ['lib']
20
- s.required_ruby_version = '>= 2.0.0'
20
+ s.required_ruby_version = '>= 3.1.0'
21
21
  s.metadata['rubygems_mfa_required'] = 'true'
22
22
  s.add_dependency 'sqlite3', '~> 1.6'
23
23
  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: 4.0.2
4
+ version: 5.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: 2023-12-14 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3
@@ -56,14 +56,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 2.0.0
59
+ version: 3.1.0
60
60
  required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  requirements:
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
65
  requirements: []
66
- rubygems_version: 3.4.21
66
+ rubygems_version: 3.5.3
67
67
  signing_key:
68
68
  specification_version: 4
69
69
  summary: TimeZone info for any 5-digit US zip code