timerage 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/timerage/time_interval.rb +1 -1
- data/lib/timerage/version.rb +1 -1
- data/spec/timerage/time_interval_spec.rb +16 -0
- 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: '07846226e71bd754087bd3b54c49d85a70e9d2f9b809d678351fbd685546fcb4'
|
4
|
+
data.tar.gz: e3be843301a7d7a7ea7cec902c2f4fd8152314a5cbbf4e74d8aad65ede5196ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76acc33ddaa358897021f20b82c4f3faffb1867469e410da6566480880c78c9524a84e39edb6c3468bfd5d49cba4d72dfe526dbd749ad6ecff66be839fcb6bc0
|
7
|
+
data.tar.gz: 96e281a1b857a002653629b4289574f4488068609f40f74b85832966a402311c88ea16f9db91080a74566ac502a7bd1468d496bb73b5095dcfbe572d09f2ec06
|
data/lib/timerage/version.rb
CHANGED
@@ -214,6 +214,22 @@ describe Timerage::TimeInterval do
|
|
214
214
|
specify { expect{ |b| subject.step(3_600, &b) }.to yield_control.exactly(2).times }
|
215
215
|
end
|
216
216
|
|
217
|
+
context "When given date range" do
|
218
|
+
it "returns date objects when stepping through the range with a day duration" do
|
219
|
+
date_range = Date.new(2020, 1, 1)..Date.new(2020,1,3)
|
220
|
+
described_class.new(date_range).step(1.day) do |date|
|
221
|
+
expect(date).to be_kind_of Date
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
it "returns Time objects when stepping through the range with an hour duration" do
|
226
|
+
date_range = Date.new(2020, 1, 1)..Date.new(2020,1,2)
|
227
|
+
described_class.new(date_range).step(6.hours) do |date|
|
228
|
+
expect(date).to be_kind_of Time
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
217
233
|
let(:leap_day) { Time.parse("2016-02-29 12:00:00 UTC") }
|
218
234
|
let(:before_leap_day) { leap_day - 1.day }
|
219
235
|
let(:after_leap_day) { leap_day + 1.day}
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timerage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Williams
|
8
8
|
- Chris Schneider
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-11-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -96,7 +96,7 @@ homepage: ''
|
|
96
96
|
licenses:
|
97
97
|
- MIT
|
98
98
|
metadata: {}
|
99
|
-
post_install_message:
|
99
|
+
post_install_message:
|
100
100
|
rdoc_options: []
|
101
101
|
require_paths:
|
102
102
|
- lib
|
@@ -111,8 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
115
|
-
signing_key:
|
114
|
+
rubygems_version: 3.2.33
|
115
|
+
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Simple refinement to Range to allow Time or Date as arguments
|
118
118
|
test_files:
|