ziptz 4.0.2 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +2 -3
- data/lib/version.rb +1 -1
- data/spec/ziptz_spec.rb +17 -27
- data/ziptz.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6210e31a3e0416b29057e85c8de5b90ddeb7c646b5fbd1874f4a76f37f04cc8a
|
4
|
+
data.tar.gz: 7200a7702ed839c4f6d6f6f3e647da2f78a9779241d54f05ff2ab21c8f62081d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b20e336f5ca2f277214e958354ff6e6574470665b6f2b040b05d0c4f3e3a3abdc95001ae45c1ebb6893039a008718b6c1f0e245bc69c7a178d98943d05581b4
|
7
|
+
data.tar.gz: 9c547aeef08f95f2e9620fc5fafca0bd5bf57e0ddc6b98de8de7a280c072c4292d8bc7ec6a62133cb9fed2614b30b49708fb145841156bfa0c5cae1847f76b65
|
data/LICENSE
CHANGED
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
|
15
|
+
* Ruby 3.1.x, 3.2.x, 3.3.x
|
16
16
|
|
17
17
|
## Installation
|
18
18
|
|
@@ -20,7 +20,6 @@ Add the gem to your Gemfile:
|
|
20
20
|
|
21
21
|
gem 'ziptz'
|
22
22
|
|
23
|
-
|
24
23
|
## Usage
|
25
24
|
|
26
25
|
Get the time zone name for any ZIP code:
|
@@ -160,7 +159,7 @@ Time zone names now reflect standard tz-database names.
|
|
160
159
|
|
161
160
|
## License
|
162
161
|
|
163
|
-
Copyright (c) 2015-
|
162
|
+
Copyright (c) 2015-2024 Keith Morrison <<keithm@infused.org>>
|
164
163
|
|
165
164
|
Permission is hereby granted, free of charge, to any person
|
166
165
|
obtaining a copy of this software and associated documentation
|
data/lib/version.rb
CHANGED
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) {
|
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 '#
|
39
|
-
context 'when given a 5-digit zipcode' do
|
40
|
-
it 'returns
|
41
|
-
expect(ziptz.
|
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
|
52
|
-
it 'returns
|
53
|
-
expect(ziptz.
|
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
|
-
|
59
|
-
|
60
|
-
|
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
|
67
|
-
it 'returns
|
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(-
|
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(-
|
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(
|
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(
|
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 = '>=
|
20
|
+
s.required_ruby_version = '>= 3.1.0'
|
21
21
|
s.metadata['rubygems_mfa_required'] = 'true'
|
22
|
-
s.add_dependency 'sqlite3', '~>
|
22
|
+
s.add_dependency 'sqlite3', '~> 2.0'
|
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
|
+
version: 5.1.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:
|
11
|
+
date: 2024-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqlite3
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
description: Get timezone info for all 5-digit US zip codes
|
28
28
|
email: keithm@infused.org
|
29
29
|
executables: []
|
@@ -56,14 +56,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
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.
|
66
|
+
rubygems_version: 3.5.9
|
67
67
|
signing_key:
|
68
68
|
specification_version: 4
|
69
69
|
summary: TimeZone info for any 5-digit US zip code
|