iso8601 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +4 -0
- data/iso8601.gemspec +1 -1
- data/lib/iso8601/duration.rb +7 -0
- data/lib/iso8601/version.rb +1 -1
- data/spec/iso8601/duration_spec.rb +17 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ef47c91dbb621380a2f03ba6239e336eab42ee004d43b90a7a642314f283327f
|
4
|
+
data.tar.gz: b388e38562f042754b00347e566c3ec6a80bac3bc318bbe6f5060393b23212c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afe7dec488de8ff01f11276ba876395ff3eea79672f09ca205409965921cbc04f2a214b4cbbe2c3b2990a9a8bd389c83205815f935c4fc930306b6fa7ff10310
|
7
|
+
data.tar.gz: 967b272cd21652fa5133dcef8a33491f7e66ecd669f91eb01d4692ae9770b1032ab45cb0a7c9161c2c836527e73da8524bcc10972f39df32ca91fed7db348363
|
data/CHANGELOG.md
CHANGED
data/iso8601.gemspec
CHANGED
@@ -64,5 +64,5 @@ Gem::Specification.new do |s|
|
|
64
64
|
s.add_development_dependency 'rspec', '~> 3.6'
|
65
65
|
s.add_development_dependency 'rubocop', '~> 0.50'
|
66
66
|
s.add_development_dependency 'pry', '~> 0.11.0'
|
67
|
-
s.add_development_dependency 'pry-doc', '~> 0.
|
67
|
+
s.add_development_dependency 'pry-doc', '~> 0.13.4'
|
68
68
|
end
|
data/lib/iso8601/duration.rb
CHANGED
@@ -125,6 +125,13 @@ module ISO8601
|
|
125
125
|
(to_seconds == fetch_seconds(other))
|
126
126
|
end
|
127
127
|
|
128
|
+
##
|
129
|
+
#
|
130
|
+
# @return [ISO8601::Duration]
|
131
|
+
def -@
|
132
|
+
seconds_to_iso(-to_seconds)
|
133
|
+
end
|
134
|
+
|
128
135
|
##
|
129
136
|
# @param [ISO8601::Duration] other The duration to compare
|
130
137
|
#
|
data/lib/iso8601/version.rb
CHANGED
@@ -251,6 +251,23 @@ RSpec.describe ISO8601::Duration do
|
|
251
251
|
end
|
252
252
|
end
|
253
253
|
|
254
|
+
describe '#-@' do
|
255
|
+
let(:positive) { ISO8601::Duration.new('PT1H') }
|
256
|
+
let(:negative) { ISO8601::Duration.new('-PT1H') }
|
257
|
+
|
258
|
+
it "should return a kind of duration" do
|
259
|
+
expect(-negative).to be_instance_of(ISO8601::Duration)
|
260
|
+
end
|
261
|
+
|
262
|
+
it "should return the negation of a positive duration" do
|
263
|
+
expect(-positive).to eq(negative)
|
264
|
+
end
|
265
|
+
|
266
|
+
it "should return the negation of a negative duration" do
|
267
|
+
expect(-negative).to eq(positive)
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
254
271
|
describe '#eql?' do
|
255
272
|
it "should respond to #eql?" do
|
256
273
|
subject = ISO8601::Duration.new('PT1H')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iso8601
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arnau Siches
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.13.4
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.13.4
|
69
69
|
description: |2
|
70
70
|
ISO8601 is a simple implementation in Ruby of the ISO 8601 (Data elements and
|
71
71
|
interchange formats - Information interchange - Representation of dates
|
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
134
|
version: '0'
|
135
135
|
requirements: []
|
136
136
|
rubyforge_project: iso8601
|
137
|
-
rubygems_version: 2.6
|
137
|
+
rubygems_version: 2.7.6
|
138
138
|
signing_key:
|
139
139
|
specification_version: 4
|
140
140
|
summary: Ruby parser to work with ISO 8601 dateTimes and durations - http://en.wikipedia.org/wiki/ISO_8601
|