...
 
Commits (6)
## 0.11.0
* Add support for unary minus operator (thanks @walterbrebels).
## 0.10.1
* Fix `TimeInterval` size for non UTC timezones. (#41)
......
ruby-iso8601 (0.11.0-1) unstable; urgency=medium
* New upstream release.
- Supporting negation.
* Bump Standards-Version to 4.1.5, no changes needed.
* Bump copyright years.
-- Stefano Rivera <stefanor@debian.org> Mon, 23 Jul 2018 09:21:29 +0800
ruby-iso8601 (0.10.1-1) unstable; urgency=medium
* Initial release (Closes: #895638)
......
......@@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 10),
gem2deb,
rake,
ruby-rspec
Standards-Version: 4.1.4
Standards-Version: 4.1.5
Vcs-Git: https://salsa.debian.org/ruby-team/ruby-iso8601.git
Vcs-Browser: https://salsa.debian.org/ruby-team/ruby-iso8601
Homepage: https://github.com/arnau/ISO8601
......
......@@ -3,7 +3,7 @@ Upstream-Name: iso8601
Source: https://github.com/arnau/ISO8601
Files: *
Copyright: 2012-2015 Arnau Siches
Copyright: 2012-2018 Arnau Siches
License: Expat
Files: debian/*
......
......@@ -64,5 +64,5 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rspec', '~> 3.6'
s.add_development_dependency 'rubocop', '~> 0.50'
s.add_development_dependency 'pry', '~> 0.11.0'
s.add_development_dependency 'pry-doc', '~> 0.11.0'
s.add_development_dependency 'pry-doc', '~> 0.13.4'
end
......@@ -125,6 +125,13 @@ module ISO8601
(to_seconds == fetch_seconds(other))
end
##
#
# @return [ISO8601::Duration]
def -@
seconds_to_iso(-to_seconds)
end
##
# @param [ISO8601::Duration] other The duration to compare
#
......
module ISO8601
##
# The gem version
VERSION = '0.10.1'.freeze
VERSION = '0.11.0'.freeze
end
......@@ -251,6 +251,23 @@ RSpec.describe ISO8601::Duration do
end
end
describe '#-@' do
let(:positive) { ISO8601::Duration.new('PT1H') }
let(:negative) { ISO8601::Duration.new('-PT1H') }
it "should return a kind of duration" do
expect(-negative).to be_instance_of(ISO8601::Duration)
end
it "should return the negation of a positive duration" do
expect(-positive).to eq(negative)
end
it "should return the negation of a negative duration" do
expect(-negative).to eq(positive)
end
end
describe '#eql?' do
it "should respond to #eql?" do
subject = ISO8601::Duration.new('PT1H')
......