time-duration 0.1.3 → 0.1.4
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/.github/dependabot.yml +7 -0
- data/.github/workflows/ruby.yml +22 -0
- data/Gemfile.lock +14 -15
- data/lib/time_duration/duration.rb +4 -4
- data/lib/time_duration/version.rb +1 -1
- data/time_duration.gemspec +1 -2
- metadata +10 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a26a627502171812a05f09fee9c25d42774f827b296206090a0a559b653cfe2
|
4
|
+
data.tar.gz: 4317eb5b20a7c18a8ece93eb37579d893a2fc641ce920866f566e10a11357aca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bdfc52761ab4f60bb788cda44955a7017e743cf332d0fa572e6164bca51082ed899b3b2f370c3b3d93b125d12cff7c4fc1e7dc34d81f28f9db9b57b7c102e7a
|
7
|
+
data.tar.gz: f6803e8c7a572b45c2dbdd5b3c0171702568d648106392c8b55968bb7577e135f3f07267ff04da69334353f680c215634264dc1ba52fa96aaaeb823ec6d218d4
|
@@ -0,0 +1,22 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby: ['2.5.x', '2.6.x', '2.7.x', '3.0.x']
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v1
|
13
|
+
- name: Set up Ruby
|
14
|
+
uses: actions/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: ${{ matrix.ruby }}
|
17
|
+
- name: Build and test with Rake
|
18
|
+
run: |
|
19
|
+
gem install bundler
|
20
|
+
bundle update --bundler
|
21
|
+
bundle install --jobs 4 --retry 3
|
22
|
+
bundle exec rake
|
data/Gemfile.lock
CHANGED
@@ -7,29 +7,28 @@ GEM
|
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
diff-lcs (1.3)
|
10
|
-
rake (
|
11
|
-
rspec (3.
|
12
|
-
rspec-core (~> 3.
|
13
|
-
rspec-expectations (~> 3.
|
14
|
-
rspec-mocks (~> 3.
|
15
|
-
rspec-core (3.
|
16
|
-
rspec-support (~> 3.
|
17
|
-
rspec-expectations (3.
|
10
|
+
rake (13.0.1)
|
11
|
+
rspec (3.9.0)
|
12
|
+
rspec-core (~> 3.9.0)
|
13
|
+
rspec-expectations (~> 3.9.0)
|
14
|
+
rspec-mocks (~> 3.9.0)
|
15
|
+
rspec-core (3.9.0)
|
16
|
+
rspec-support (~> 3.9.0)
|
17
|
+
rspec-expectations (3.9.0)
|
18
18
|
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
-
rspec-support (~> 3.
|
20
|
-
rspec-mocks (3.
|
19
|
+
rspec-support (~> 3.9.0)
|
20
|
+
rspec-mocks (3.9.0)
|
21
21
|
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
-
rspec-support (~> 3.
|
23
|
-
rspec-support (3.
|
22
|
+
rspec-support (~> 3.9.0)
|
23
|
+
rspec-support (3.9.0)
|
24
24
|
|
25
25
|
PLATFORMS
|
26
26
|
ruby
|
27
27
|
|
28
28
|
DEPENDENCIES
|
29
|
-
|
30
|
-
rake (~> 10.0)
|
29
|
+
rake (~> 13.0)
|
31
30
|
rspec (~> 3.0)
|
32
31
|
time-duration!
|
33
32
|
|
34
33
|
BUNDLED WITH
|
35
|
-
1.
|
34
|
+
2.1.4
|
@@ -2,7 +2,7 @@ module TimeDuration
|
|
2
2
|
class Duration
|
3
3
|
include Comparable
|
4
4
|
|
5
|
-
|
5
|
+
attr_reader :second
|
6
6
|
|
7
7
|
# TODO: format指定できるようにする
|
8
8
|
def self.parse(time_as_string, format: '%H:%M')
|
@@ -18,16 +18,16 @@ module TimeDuration
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def hour
|
21
|
-
minute / 60 + second / 3600
|
21
|
+
minute / 60 + second.abs / 3600
|
22
22
|
end
|
23
23
|
|
24
24
|
def minute
|
25
|
-
(second / 60) % 60
|
25
|
+
(second.abs / 60) % 60
|
26
26
|
end
|
27
27
|
|
28
28
|
# TODO: format指定できるようにする
|
29
29
|
def to_s
|
30
|
-
"%d:%02d" % [hour, minute]
|
30
|
+
"#{'-' if second < 0}%d:%02d" % [hour, minute]
|
31
31
|
end
|
32
32
|
|
33
33
|
def +(time_duration)
|
data/time_duration.gemspec
CHANGED
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
|
-
spec.add_development_dependency "
|
26
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
27
26
|
spec.add_development_dependency "rspec", "~> 3.0"
|
28
27
|
end
|
metadata
CHANGED
@@ -1,43 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: time-duration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daiki Matoba
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.17'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.17'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rake
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
19
|
+
version: '13.0'
|
34
20
|
type: :development
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
24
|
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
26
|
+
version: '13.0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rspec
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,6 +45,8 @@ executables: []
|
|
59
45
|
extensions: []
|
60
46
|
extra_rdoc_files: []
|
61
47
|
files:
|
48
|
+
- ".github/dependabot.yml"
|
49
|
+
- ".github/workflows/ruby.yml"
|
62
50
|
- ".gitignore"
|
63
51
|
- ".rspec"
|
64
52
|
- ".travis.yml"
|
@@ -75,7 +63,7 @@ files:
|
|
75
63
|
homepage: https://github.com/d-mato/time_duration
|
76
64
|
licenses: []
|
77
65
|
metadata: {}
|
78
|
-
post_install_message:
|
66
|
+
post_install_message:
|
79
67
|
rdoc_options: []
|
80
68
|
require_paths:
|
81
69
|
- lib
|
@@ -90,8 +78,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
78
|
- !ruby/object:Gem::Version
|
91
79
|
version: '0'
|
92
80
|
requirements: []
|
93
|
-
rubygems_version: 3.
|
94
|
-
signing_key:
|
81
|
+
rubygems_version: 3.2.32
|
82
|
+
signing_key:
|
95
83
|
specification_version: 4
|
96
84
|
summary: This module provides functions for expressing durations
|
97
85
|
test_files: []
|