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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91d9b9ff2e0b26e78e0c666e25f0e43ed2d7e63f
4
- data.tar.gz: 41b7873004e11a260af8280958e0353647473681
3
+ metadata.gz: 3acb06877cbd9dfa9823c54c3b8e4fd11270db92
4
+ data.tar.gz: ed5a9339c042aacd06fb2cb1edbe937b60dee29c
5
5
  SHA512:
6
- metadata.gz: 842c1c4c4c6b4172de92d1f77d10a79f487596bd4334088dc239d8afefad62cacc82b2ad361de1cd69b3c0bd710691ccb19574ae4319a62919ecfa9bacab16a0
7
- data.tar.gz: d3b1a9f064a1d73ddb4ea54fe10b9fd1f31f2fffa965206f5bccc60fa053e7103b62ce6f8a0f913faecbce2b0d0e307b6435571d49b0ecceacf53ad74cb50a72
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)
@@ -1,3 +1,3 @@
1
1
  module Timerage
2
- VERSION = "1.1.2"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -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.1.2
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: 2014-06-02 00:00:00.000000000 Z
12
+ date: 2015-02-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler