remain_timer 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf79b68f663dac0480ec619ac7106bc9104cf73abf0a1609c1876d5e4da5e2c5
4
- data.tar.gz: 3f73f57a2b9c74e7bfdaff55f42c2c48b8faa2c50d439284744777886605ea0e
3
+ metadata.gz: e3d0bc3d38b63ce3b3923d86737eaed7f61296b102b5eb4729de54a07ae01274
4
+ data.tar.gz: baa712ffedfe022772890ee429f6f90c28ffbba37cdf54a1493a0e5e35a3695b
5
5
  SHA512:
6
- metadata.gz: 9754dbda73dceee8b0ab1795d35faf7ce2739eef0127cf8e68d01d8deb70fe8dce3032cb6f4460bad82f7f95e7e3d169d3a99de27e3ceaae9b88b29273589aac
7
- data.tar.gz: 8156c44039acf3741b542d26d944d5149c166e6af12f3704888fcd10fd39b633e927eff0adc52958529c43459beb667505074bd7becdd310c60062528c64a46d
6
+ metadata.gz: 5586a064d99470d80f0b876aa6b8a6ce907c76a93683ea9bbcc4b82d12f2369a252d175a8a14996ca7a3ae7320a39587e32f7a27676b956cac01ea41e665490b
7
+ data.tar.gz: f3060a14aa86ebb7a8dbd174625a9186bfc993308785dc656bb2c5971fb2a14805e8641db426b8d82a88b9fe3c59392044de959bab4f50ef57cad75209263300
@@ -3,7 +3,12 @@ class DurationFormat
3
3
  SECONDS_PER_HOUR = 3600
4
4
  SECONDS_PER_MINUTE = 60
5
5
  PARTS = %i[day hour min sec].freeze
6
- PARTS_IN_SECONDS = { sec: 1, min: SECONDS_PER_MINUTE, hour: SECONDS_PER_HOUR, day: SECONDS_PER_DAY }.freeze
6
+ PARTS_IN_SECONDS = {
7
+ sec: 1,
8
+ min: SECONDS_PER_MINUTE,
9
+ hour: SECONDS_PER_HOUR,
10
+ day: SECONDS_PER_DAY,
11
+ }.freeze
7
12
 
8
13
  def self.build_parts(value)
9
14
  parts = {}
@@ -23,18 +28,7 @@ class DurationFormat
23
28
 
24
29
  def self.format(value)
25
30
  parts = build_parts(value)
26
- (parts[:day] > 0 ? "#{parts[:day]}day " : "") + sprintf('%02d:%02d:%02d', parts[:hour], parts[:min], parts[:sec].round)
27
- end
28
- end
29
-
30
- class Integer
31
- def duration_format
32
- DurationFormat.format(self)
33
- end
34
- end
35
-
36
- class Float
37
- def duration_format
38
- DurationFormat.format(self)
31
+ (parts[:day] > 0 ? "#{parts[:day]}day " : "") +
32
+ sprintf('%02d:%02d:%02d', parts[:hour], parts[:min], parts[:sec].round)
39
33
  end
40
34
  end
@@ -1,3 +1,3 @@
1
1
  class RemainTimer
2
- VERSION = "0.2.1".freeze
2
+ VERSION = "0.2.2".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remain_timer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Narazaka