timerage 1.1.2 → 1.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 +6 -0
- data/lib/timerage/version.rb +1 -1
- data/spec/timerage/time_interval_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3acb06877cbd9dfa9823c54c3b8e4fd11270db92
|
4
|
+
data.tar.gz: ed5a9339c042aacd06fb2cb1edbe937b60dee29c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d814211ed6c43433c550de50ba581eb85d87bbc29dfcd59acc15199092fcce343b6fb59729306fc33a0ef0593bdd0670774b9d2540d1b6072164a8be74b4db9
|
7
|
+
data.tar.gz: ae499db68b130aed3f9e640b1f439191a6ed723f15d2332007ae90f1176e1ed483933c0edbad3895652d1b250a51be858d7989c7ac7d59aa38f8a49b11e9d2c1
|
@@ -23,6 +23,12 @@ module Timerage
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
# Returns and ISO8601 interval representation of self
|
27
|
+
# Takes same args as Time#iso8601
|
28
|
+
def iso8601(*args)
|
29
|
+
"#{self.begin.iso8601(*args)}/#{self.end.iso8601(*args)}"
|
30
|
+
end
|
31
|
+
|
26
32
|
protected
|
27
33
|
|
28
34
|
def rangeish?(an_obj)
|
data/lib/timerage/version.rb
CHANGED
@@ -21,6 +21,10 @@ describe Timerage::TimeInterval do
|
|
21
21
|
.and (be <= interval.end) }
|
22
22
|
specify { expect{|b| interval.step(1200, &b) }
|
23
23
|
.to yield_control.at_least(:once) }
|
24
|
+
specify { expect(interval.iso8601)
|
25
|
+
.to eq "#{interval.begin.iso8601}/#{interval.end.iso8601}" }
|
26
|
+
specify { expect(interval.iso8601(3))
|
27
|
+
.to eq "#{interval.begin.iso8601(3)}/#{interval.end.iso8601(3)}" }
|
24
28
|
|
25
29
|
context "interval include end" do
|
26
30
|
specify { expect(interval.exclude_end?).to be false }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timerage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Williams
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|