tod 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +25 -11
- data/lib/tod/shift.rb +4 -4
- data/lib/tod/time_of_day.rb +1 -0
- data/lib/tod/version.rb +1 -1
- data/test/tod/time_of_day_test.rb +7 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c1822f3d5a2b798f5b61037371706e54b7588491c9470d8072ad93212239662
|
4
|
+
data.tar.gz: c9d25f0ec776493e5afe4cd2194b6d6d2226f43663842891c65efaef6224fc10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be10cd8868990590e93d07e97a8eb4861facbeb708fbf61a1b0b01a6aaaec8f84189a38d276d04133aeadd6aec199342dcb1be893b6a1ed19a68135c0fc9aa1d
|
7
|
+
data.tar.gz: 8c31766d217e42c06ada0cc193af5231c33d73a45b81ed62abe5a3e7c6ea11fb0e9c159d60322a242b5c9706936710390e880e0d72503911a698b10d455c38ad
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
# 3.1.2 (January 12, 2024)
|
2
|
+
|
3
|
+
* Add Tod::TimeOfDay#to_fs for Rails 7 compatibility (Igor S. Morozov)
|
4
|
+
* Shift internally calls second_of_day instead of to_i on objects that should quack like a Tod::TimeOfDay. This makes silent errors caused by passing a bad argument less likely.
|
5
|
+
|
1
6
|
# 3.1.1 (June 11, 2023)
|
2
7
|
|
3
8
|
* Allow use in Rails forms with time_select (Bill Pearce)
|
data/Gemfile.lock
CHANGED
@@ -1,38 +1,52 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tod (3.1.
|
4
|
+
tod (3.1.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
activemodel (7.
|
10
|
-
activesupport (= 7.
|
11
|
-
activerecord (7.
|
12
|
-
activemodel (= 7.
|
13
|
-
activesupport (= 7.
|
14
|
-
|
9
|
+
activemodel (7.1.2)
|
10
|
+
activesupport (= 7.1.2)
|
11
|
+
activerecord (7.1.2)
|
12
|
+
activemodel (= 7.1.2)
|
13
|
+
activesupport (= 7.1.2)
|
14
|
+
timeout (>= 0.4.0)
|
15
|
+
activesupport (7.1.2)
|
16
|
+
base64
|
17
|
+
bigdecimal
|
15
18
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
|
+
connection_pool (>= 2.2.5)
|
20
|
+
drb
|
16
21
|
i18n (>= 1.6, < 2)
|
17
22
|
minitest (>= 5.1)
|
23
|
+
mutex_m
|
18
24
|
tzinfo (~> 2.0)
|
25
|
+
base64 (0.2.0)
|
26
|
+
bigdecimal (3.1.5)
|
19
27
|
byebug (11.1.3)
|
20
28
|
coderay (1.1.3)
|
21
29
|
concurrent-ruby (1.2.2)
|
30
|
+
connection_pool (2.4.1)
|
31
|
+
drb (2.2.0)
|
32
|
+
ruby2_keywords
|
22
33
|
i18n (1.14.1)
|
23
34
|
concurrent-ruby (~> 1.0)
|
24
35
|
method_source (1.0.0)
|
25
|
-
mini_portile2 (2.8.
|
26
|
-
minitest (5.
|
36
|
+
mini_portile2 (2.8.5)
|
37
|
+
minitest (5.21.1)
|
38
|
+
mutex_m (0.2.0)
|
27
39
|
pry (0.14.2)
|
28
40
|
coderay (~> 1.1)
|
29
41
|
method_source (~> 1.0)
|
30
42
|
pry-byebug (3.10.1)
|
31
43
|
byebug (~> 11.0)
|
32
44
|
pry (>= 0.13, < 0.15)
|
33
|
-
rake (13.0
|
34
|
-
|
45
|
+
rake (13.1.0)
|
46
|
+
ruby2_keywords (0.0.5)
|
47
|
+
sqlite3 (1.7.0)
|
35
48
|
mini_portile2 (~> 2.8.0)
|
49
|
+
timeout (0.4.1)
|
36
50
|
tzinfo (2.0.6)
|
37
51
|
concurrent-ruby (~> 1.0)
|
38
52
|
|
data/lib/tod/shift.rb
CHANGED
@@ -16,10 +16,10 @@ module Tod
|
|
16
16
|
@ending = ending
|
17
17
|
@exclude_end = exclude_end
|
18
18
|
|
19
|
-
normalized_ending = ending.
|
20
|
-
normalized_ending += TimeOfDay::NUM_SECONDS_IN_DAY if normalized_ending < beginning.
|
19
|
+
normalized_ending = ending.second_of_day
|
20
|
+
normalized_ending += TimeOfDay::NUM_SECONDS_IN_DAY if normalized_ending < beginning.second_of_day
|
21
21
|
|
22
|
-
@range = Range.new(beginning.
|
22
|
+
@range = Range.new(beginning.second_of_day, normalized_ending, @exclude_end)
|
23
23
|
|
24
24
|
freeze # Shift instances are value objects
|
25
25
|
end
|
@@ -30,7 +30,7 @@ module Tod
|
|
30
30
|
|
31
31
|
# Returns true if the time of day is inside the shift, false otherwise.
|
32
32
|
def include?(tod)
|
33
|
-
second = tod.
|
33
|
+
second = tod.second_of_day
|
34
34
|
second += TimeOfDay::NUM_SECONDS_IN_DAY if second < @range.first
|
35
35
|
@range.cover?(second)
|
36
36
|
end
|
data/lib/tod/time_of_day.rb
CHANGED
data/lib/tod/version.rb
CHANGED
@@ -190,6 +190,13 @@ describe "TimeOfDay" do
|
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
193
|
+
describe "to_fs" do
|
194
|
+
it "is aliased to to_formatted_s" do
|
195
|
+
t = Tod::TimeOfDay.new(8,15,30)
|
196
|
+
assert_equal t.to_formatted_s, t.to_s
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
193
200
|
describe "inspect" do
|
194
201
|
it "is friendly representation" do
|
195
202
|
t = Tod::TimeOfDay.new(12,15,05)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Christensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
- !ruby/object:Gem::Version
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
|
-
rubygems_version: 3.
|
153
|
+
rubygems_version: 3.5.3
|
154
154
|
signing_key:
|
155
155
|
specification_version: 4
|
156
156
|
summary: Supplies TimeOfDay and Shift class
|