diff -Nru ruby-iso8601-0.11.0/CHANGELOG.md ruby-iso8601-0.12.0/CHANGELOG.md --- ruby-iso8601-0.11.0/CHANGELOG.md 2018-07-23 01:17:11.000000000 +0000 +++ ruby-iso8601-0.12.0/CHANGELOG.md 2018-08-22 19:35:32.000000000 +0000 @@ -1,3 +1,7 @@ +## 0.12.0 + +* Fix `Months#to_seconds` from November (thanks @walterbrebels). + ## 0.11.0 * Add support for unary minus operator (thanks @walterbrebels). diff -Nru ruby-iso8601-0.11.0/debian/changelog ruby-iso8601-0.12.0/debian/changelog --- ruby-iso8601-0.11.0/debian/changelog 2018-07-23 01:21:29.000000000 +0000 +++ ruby-iso8601-0.12.0/debian/changelog 2018-08-22 19:40:34.000000000 +0000 @@ -1,3 +1,10 @@ +ruby-iso8601 (0.12.0-1) unstable; urgency=medium + + * New upstream release. + * Bump Standards_version to 4.2.0, no changes needed. + + -- Stefano Rivera Wed, 22 Aug 2018 12:40:34 -0700 + ruby-iso8601 (0.11.0-1) unstable; urgency=medium * New upstream release. diff -Nru ruby-iso8601-0.11.0/debian/control ruby-iso8601-0.12.0/debian/control --- ruby-iso8601-0.11.0/debian/control 2018-07-23 01:21:29.000000000 +0000 +++ ruby-iso8601-0.12.0/debian/control 2018-08-22 19:40:34.000000000 +0000 @@ -7,7 +7,7 @@ gem2deb, rake, ruby-rspec -Standards-Version: 4.1.5 +Standards-Version: 4.2.0 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 diff -Nru ruby-iso8601-0.11.0/lib/iso8601/months.rb ruby-iso8601-0.12.0/lib/iso8601/months.rb --- ruby-iso8601-0.11.0/lib/iso8601/months.rb 2018-07-23 01:17:11.000000000 +0000 +++ ruby-iso8601-0.12.0/lib/iso8601/months.rb 2018-08-22 19:35:32.000000000 +0000 @@ -76,7 +76,7 @@ else month = initial <= 12 ? initial : (initial % 12) month = 12 if month.zero? - year = base.year + ((base.month + atom) / 12).to_i + year = initial <= 12 ? base.year : base.year + (initial / 12).to_i end (::Time.utc(year, month) - ::Time.utc(base.year, base.month)) / atom diff -Nru ruby-iso8601-0.11.0/lib/iso8601/version.rb ruby-iso8601-0.12.0/lib/iso8601/version.rb --- ruby-iso8601-0.11.0/lib/iso8601/version.rb 2018-07-23 01:17:11.000000000 +0000 +++ ruby-iso8601-0.12.0/lib/iso8601/version.rb 2018-08-22 19:35:32.000000000 +0000 @@ -1,5 +1,5 @@ module ISO8601 ## # The gem version - VERSION = '0.11.0'.freeze + VERSION = '0.12.0'.freeze end diff -Nru ruby-iso8601-0.11.0/LICENSE ruby-iso8601-0.12.0/LICENSE --- ruby-iso8601-0.11.0/LICENSE 2018-07-23 01:17:11.000000000 +0000 +++ ruby-iso8601-0.12.0/LICENSE 2018-08-22 19:35:32.000000000 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2012-2015 Arnau Siches +Copyright (c) 2012-2018 Arnau Siches MIT License diff -Nru ruby-iso8601-0.11.0/README.md ruby-iso8601-0.12.0/README.md --- ruby-iso8601-0.11.0/README.md 2018-07-23 01:17:11.000000000 +0000 +++ ruby-iso8601-0.12.0/README.md 2018-08-22 19:35:32.000000000 +0000 @@ -18,7 +18,6 @@ ## Build status [![Build Status](https://secure.travis-ci.org/arnau/ISO8601.png?branch=master)](http://travis-ci.org/arnau/ISO8601/) -[![Dependency Status](https://gemnasium.com/arnau/ISO8601.svg)](https://gemnasium.com/arnau/ISO8601) [![Gem Version](https://badge.fury.io/rb/iso8601.svg)](http://badge.fury.io/rb/iso8601) ## Supported versions diff -Nru ruby-iso8601-0.11.0/spec/iso8601/duration_spec.rb ruby-iso8601-0.12.0/spec/iso8601/duration_spec.rb --- ruby-iso8601-0.11.0/spec/iso8601/duration_spec.rb 2018-07-23 01:17:11.000000000 +0000 +++ ruby-iso8601-0.12.0/spec/iso8601/duration_spec.rb 2018-08-22 19:35:32.000000000 +0000 @@ -7,6 +7,9 @@ let(:common_february) { ISO8601::DateTime.new('2010-02-01') } let(:leap_february) { ISO8601::DateTime.new('2000-02-01') } + let(:common_november) { ISO8601::DateTime.new('2010-11-01') } + let(:common_december) { ISO8601::DateTime.new('2010-12-01') } + it "should raise a ISO8601::Errors::UnknownPattern for any unknown pattern" do expect { ISO8601::Duration.new('') }.to raise_error(ISO8601::Errors::UnknownPattern) expect { ISO8601::Duration.new('P') }.to raise_error(ISO8601::Errors::UnknownPattern) @@ -120,6 +123,10 @@ expect(ISO8601::Duration.new('P1M').to_seconds(common_year)).to eq(2678400) expect(ISO8601::Duration.new('P19M').to_seconds(ISO8601::DateTime.new('2012-05-01'))).to eq(Time.utc(2014, 12) - Time.utc(2012, 5)) expect(ISO8601::Duration.new('P14M').to_seconds(common_year)).to eq(Time.utc(2011, 3) - Time.utc(2010, 1)) + expect(ISO8601::Duration.new('P1M').to_seconds(common_november)).to eq(Time.utc(2010, 12) - Time.utc(2010, 11)) + expect(ISO8601::Duration.new('P1M').to_seconds(common_december)).to eq(Time.utc(2011, 1) - Time.utc(2010, 12)) + expect(ISO8601::Duration.new('P2M').to_seconds(common_november)).to eq(Time.utc(2011, 1) - Time.utc(2010, 11)) + expect(ISO8601::Duration.new('P3M').to_seconds(common_november)).to eq(Time.utc(2011, 2) - Time.utc(2010, 11)) end it "should return the seconds of a P[n]M duration in a leap year" do diff -Nru ruby-iso8601-0.11.0/spec/iso8601/months_spec.rb ruby-iso8601-0.12.0/spec/iso8601/months_spec.rb --- ruby-iso8601-0.11.0/spec/iso8601/months_spec.rb 2018-07-23 01:17:11.000000000 +0000 +++ ruby-iso8601-0.12.0/spec/iso8601/months_spec.rb 2018-08-22 19:35:32.000000000 +0000 @@ -7,6 +7,8 @@ let(:common_february) { ISO8601::DateTime.new('2010-02-01') } let(:leap_february) { ISO8601::DateTime.new('2000-02-01') } + let(:common_november) { ISO8601::DateTime.new('2017-11-01') } + let(:common_december) { ISO8601::DateTime.new('2017-12-01') } let(:leap_december) { ISO8601::DateTime.new('2000-12-01') } @@ -62,6 +64,9 @@ expect(ISO8601::Months.new(1).to_seconds(common_year)).to eq(2678400) expect(ISO8601::Months.new(0).to_seconds(common_year)).to eq(0) expect(ISO8601::Months.new(0).to_seconds(common_december)).to eq(0) + expect(ISO8601::Months.new(2).to_seconds(common_november)).to eq(5270400) + expect(ISO8601::Months.new(1).to_seconds(common_november)).to eq(2592000) + expect(ISO8601::Months.new(0).to_seconds(common_november)).to eq(0) end it "should return the amount of seconds for a leap year" do