duration.rb 0.7.0 → 0.7.1
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 +4 -4
- data/CHANGELOG +8 -0
- data/lib/Duration/VERSION.rb +1 -1
- data/test/duration-numeric_test.rb +29 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cd64d51ef7949fafc8a03a0e9108d059ac0eff61dda04b4c482d0f2a4255a9ea
|
|
4
|
+
data.tar.gz: e00ccca7b07dee2b94693c26903f96eebdf885a3d71bf7699459b595b037863c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a9f0e9c40dadeebbc81a1dbcfdc5f152724cc970e8dc141aa09237e157a7b3b16f9c0ae68db1361858b23984cb8740a6f812f16ac7fa1f1e9599a2d89d1a3a38
|
|
7
|
+
data.tar.gz: b71f208a50b552a2a956affcbbcb9210be78687b6cb3edc1a8320dd22107c77038be900d60d0e22862825f694b07404369e7c1cefb580da3d10eb16f45f1a2a8
|
data/CHANGELOG
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 20260822
|
|
4
|
+
|
|
5
|
+
0.7.1: + test/duration-numeric_test.rb.
|
|
6
|
+
|
|
7
|
+
1. + test/duration-numeric_test.rb: that requiring the file gives the Numeric sugar, brings the core with it, and names nothing at the top level. Duration::Numeric was covered by test/Duration/Numeric_test.rb, which requires the module directly and so steps over the file which requires it for you — a path nothing else took, where a wrong require would have shipped unnoticed. The third runs in a process of its own, being a question about what a fresh top level holds.
|
|
8
|
+
2. ~ Duration::VERSION: /0.7.0/0.7.1/
|
|
9
|
+
|
|
10
|
+
|
|
3
11
|
## 20260822
|
|
4
12
|
|
|
5
13
|
0.7.0: + Duration::Common#to_s, #inspect.
|
data/lib/Duration/VERSION.rb
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# test/duration-numeric_test.rb
|
|
2
|
+
|
|
3
|
+
require_relative './test_helper'
|
|
4
|
+
require_relative '../lib/duration-numeric'
|
|
5
|
+
|
|
6
|
+
# Duration::Numeric is covered by test/Duration/Numeric_test.rb, which requires
|
|
7
|
+
# the module directly. This covers the file which requires it for you, that
|
|
8
|
+
# being a path nothing else takes.
|
|
9
|
+
|
|
10
|
+
describe 'duration-numeric' do
|
|
11
|
+
it "gives the Numeric sugar" do
|
|
12
|
+
_(5.minutes.to_s).must_equal '5 minutes'
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "brings the core with it" do
|
|
16
|
+
_(Duration::Days.new(1).to_s).must_equal '1 day'
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# A process of its own: this one has required duration-classes as well, which
|
|
20
|
+
# names the units at the top level and cannot be undone within a process.
|
|
21
|
+
it "names nothing at the top level" do
|
|
22
|
+
lib = File.expand_path('../lib', __dir__)
|
|
23
|
+
named = IO.popen(['ruby', "-I#{lib}", '-e',
|
|
24
|
+
'require "duration-numeric"; ' \
|
|
25
|
+
'print Duration.constants.select{|n| Duration.const_get(n).is_a?(Class)}.any?{|n| Object.const_defined?(n, false)}'],
|
|
26
|
+
err: [:child, :out]){|io| io.read}.strip
|
|
27
|
+
_(named).must_equal 'false'
|
|
28
|
+
end
|
|
29
|
+
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.7.
|
|
4
|
+
version: 0.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- thoran
|
|
@@ -92,6 +92,7 @@ files:
|
|
|
92
92
|
- test/Duration/Seconds_test.rb
|
|
93
93
|
- test/Duration/VERSION_test.rb
|
|
94
94
|
- test/Duration/Weeks_test.rb
|
|
95
|
+
- test/duration-numeric_test.rb
|
|
95
96
|
- test/gemspec_test.rb
|
|
96
97
|
- test/loading_test.rb
|
|
97
98
|
- test/test_helper.rb
|