duration.rb 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e8c196994e5358c6875d3ee17471f379cf8cffe2fa9924856729a6fc64c88d0
4
- data.tar.gz: de2a825ddec433cb81b9797015833a61eac8b5548166b592686623f86cc9101a
3
+ metadata.gz: 55bc0f38eb9c213a08b6ca49ea69908c2aeff8679637df50ab7309bc564ad457
4
+ data.tar.gz: 14032f8850e3499398761abcf3155c1390d22b89e71e1c2be302cfe6b9863f5b
5
5
  SHA512:
6
- metadata.gz: e47937b8086f02fd9ab15d4444bc9b9f38c7d7b01e8948c99c500adfaef01697ea17d8898c93cc727b8961610f904810e3aaeb9da00aa762fbee4a1ffd25ed57
7
- data.tar.gz: 17f71a43aa5680b73bc5ca532e2c172964cf988d74668b2bfa253105c4b46d31a34810e9ee31ff37a0e85d36a91df42fd39194394c7429186ddff34afb1274b1
6
+ metadata.gz: 41cc6f366ad11f553d299616312fbf325bb7979dfd7f978302a3b0afc4697b2d92dd506b35481deb17718add06377b0037df7d022a1f817010da69396a939cf4
7
+ data.tar.gz: ef8d3edc58e19d3a2715901904af9be11600e52e1ec6b03cc5a58e920d69c6db1e4e26632169aa887c6d3ddbf99b9d6da928053f505faa4cf5c8890ad4a4229f
data/CHANGELOG CHANGED
@@ -1,5 +1,24 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 20260812
4
+
5
+ 0.5.2: + gemspec test.
6
+
7
+ 1. + test/gemspec_test.rb: Ensure that the specification validates, that no date is pinned, that the version comes from Duration::VERSION, and that the runtime and development dependencies are those expected.
8
+ 2. ~ duration.rb.gemspec: /a description identical to the summary/a description of its own/. Found by the test above upon its first run, spec.validate having warned of it. The summary says what the gem is; the description now says how it goes about it.
9
+ 3. ~ Duration::VERSION: /0.5.1/0.5.2/
10
+
11
+
12
+ ## 20260812
13
+
14
+ 0.5.1: + VERSION test.
15
+
16
+ 1. + test/Duration/VERSION_test.rb: Ensure that VERSION is a string, that it has three dotted numbers, and that it matches the newest entry in the CHANGELOG. A release edits both files and this now ensure that one moves with the other.
17
+ 2. + .gitignore
18
+ 3. ~ README.md: /Months is slated for removal in 0.5.0/Months is therefore slated for removal/, 0.5.0 having been and gone with Months still in place.
19
+ 4. ~ Duration::VERSION: /0.5.0/0.5.1/
20
+
21
+
3
22
  ## 20260811
4
23
 
5
24
  0.5.0: + Multiplication and division, and with them the dimensionless ratio.
data/README.md CHANGED
@@ -138,8 +138,8 @@ the calendar. Its conversions use the Gregorian mean month (2629746 seconds),
138
138
  so they are honest only as a statistical average, never as calendar-correct
139
139
  arithmetic. Its `ago`/`hence` inherit this — they displace by the mean month,
140
140
  so they are approximate rather than calendar-correct; reach for a
141
- calendar-anchored type such as `month.rb` when that matters. `Months` is slated
142
- for removal in 0.5.0.
141
+ calendar-anchored type such as `month.rb` when that matters. `Months` is
142
+ therefore slated for removal.
143
143
 
144
144
  ## Contributing
145
145
 
data/duration.rb.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.version = Duration::VERSION
12
12
 
13
13
  spec.summary = "Objects for handling durations of time."
14
- spec.description = "Objects for handling durations of time."
14
+ spec.description = "The unit is the class rather than a decoration upon a number of seconds, so a Minutes holds minutes and no unit is privileged as a base. Nothing is normalised at construction and conversions divide by exact ratios, so an Integer or a Rational stays exact the whole way through, with to_f left for the edge."
15
15
 
16
16
  spec.author = 'thoran'
17
17
  spec.email = 'code@thoran.com'
@@ -1,3 +1,3 @@
1
1
  module Duration
2
- VERSION = '0.5.0'
2
+ VERSION = '0.5.2'
3
3
  end
@@ -0,0 +1,22 @@
1
+ # test/duration/version_test.rb
2
+
3
+ require_relative '../test_helper'
4
+
5
+ # Note that VERSION.rb is the one file duration.rb requires rather than autoloaded, because an autoloaded file goes unread until its constant is named and nothing else here names this one.
6
+
7
+ describe Duration do
8
+ describe "VERSION" do
9
+ it "is a string" do
10
+ _(Duration::VERSION).must_be_instance_of String
11
+ end
12
+
13
+ it "is three numbers separated by dots" do
14
+ _(Duration::VERSION).must_match(/\A\d+\.\d+\.\d+\z/)
15
+ end
16
+
17
+ it "matches the newest entry in the CHANGELOG" do
18
+ changelog = File.read(File.expand_path('../../CHANGELOG', __dir__))
19
+ _(changelog[/^(\d+\.\d+\.\d+):/, 1]).must_equal Duration::VERSION
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,27 @@
1
+ # test/gemspec_test.rb
2
+
3
+ require_relative './test_helper'
4
+
5
+ describe 'duration.rb.gemspec' do
6
+ let(:spec){Gem::Specification.load(File.expand_path('../duration.rb.gemspec', __dir__))}
7
+
8
+ it "is a valid specification" do
9
+ _(spec.validate).must_equal(true)
10
+ end
11
+
12
+ it "does not pin a date" do
13
+ _(spec.date).must_equal(Gem::Specification.new.date)
14
+ end
15
+
16
+ it "takes its version from Duration::VERSION" do
17
+ _(spec.version.to_s).must_equal(Duration::VERSION)
18
+ end
19
+
20
+ it "declares no runtime dependencies" do
21
+ _(spec.runtime_dependencies.map(&:name).sort).must_equal([])
22
+ end
23
+
24
+ it "declares its development dependencies" do
25
+ _(spec.development_dependencies.map(&:name).sort).must_equal(%w{minitest minitest-spec-context rake})
26
+ end
27
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duration.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoran
@@ -51,7 +51,10 @@ dependencies:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
- description: Objects for handling durations of time.
54
+ description: The unit is the class rather than a decoration upon a number of seconds,
55
+ so a Minutes holds minutes and no unit is privileged as a base. Nothing is normalised
56
+ at construction and conversions divide by exact ratios, so an Integer or a Rational
57
+ stays exact the whole way through, with to_f left for the edge.
55
58
  email: code@thoran.com
56
59
  executables: []
57
60
  extensions: []
@@ -87,7 +90,9 @@ files:
87
90
  - test/Duration/Nanoseconds_test.rb
88
91
  - test/Duration/Numeric_test.rb
89
92
  - test/Duration/Seconds_test.rb
93
+ - test/Duration/VERSION_test.rb
90
94
  - test/Duration/Weeks_test.rb
95
+ - test/gemspec_test.rb
91
96
  - test/test_helper.rb
92
97
  homepage: http://github.com/thoran/duration.rb
93
98
  licenses: