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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2b989c9cbc0ed939c15af4a776a7bc721069a8c0
4
- data.tar.gz: b97d26d50d48493cb55c972acdefa9e7d851a4e4
2
+ SHA256:
3
+ metadata.gz: ef47c91dbb621380a2f03ba6239e336eab42ee004d43b90a7a642314f283327f
4
+ data.tar.gz: b388e38562f042754b00347e566c3ec6a80bac3bc318bbe6f5060393b23212c6
5
5
  SHA512:
6
- metadata.gz: '08f5b58f3345538a7b8ea1c871ded069fadc994098c0beaaeb43d0980ae3e2d68e0a094ab5d6b61c0b0935ce3ca597e713229622eec0b712bd0d5fdf73c145aa'
7
- data.tar.gz: aabdc3c3a408a8f324fb1163b2199b0f7bbe73211b33bbb47a73f494f1bebfd1358067af0661ec555e601377244b47bf63610326ada0c9483caf5b5cb2f70275
6
+ metadata.gz: afe7dec488de8ff01f11276ba876395ff3eea79672f09ca205409965921cbc04f2a214b4cbbe2c3b2990a9a8bd389c83205815f935c4fc930306b6fa7ff10310
7
+ data.tar.gz: 967b272cd21652fa5133dcef8a33491f7e66ecd669f91eb01d4692ae9770b1032ab45cb0a7c9161c2c836527e73da8524bcc10972f39df32ca91fed7db348363
@@ -1,3 +1,7 @@
1
+ ## 0.11.0
2
+
3
+ * Add support for unary minus operator (thanks @walterbrebels).
4
+
1
5
  ## 0.10.1
2
6
 
3
7
  * Fix `TimeInterval` size for non UTC timezones. (#41)
@@ -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.11.0'
67
+ s.add_development_dependency 'pry-doc', '~> 0.13.4'
68
68
  end
@@ -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
  #
@@ -1,5 +1,5 @@
1
1
  module ISO8601
2
2
  ##
3
3
  # The gem version
4
- VERSION = '0.10.1'.freeze
4
+ VERSION = '0.11.0'.freeze
5
5
  end
@@ -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.10.1
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: 2017-12-30 00:00:00.000000000 Z
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.11.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.11.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.14
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