makit 0.0.37 → 0.0.38

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: 302737c6fffa07aa87668fc9a01ec04d49623b95d16642fd48b5c7318c2e41c3
4
- data.tar.gz: '01280acfdf6509404427b7847280a7759070fc604996f55aa3161c3b1c4705f3'
3
+ metadata.gz: c27f269da0b90889675df5626377f39ea4041da3fd699c55b38cb11765b8f25c
4
+ data.tar.gz: 0c38c29372bc46db6fe59fc71791d2ade93a324cb79e7b104b2070ff8e69e326
5
5
  SHA512:
6
- metadata.gz: 7c3d87b426715f7ff3adfb22674f9478b6249fe8bed2b5e76568bd790bee2cf3345381d7620dcd940cf4e3198905f2ed6b79a1dd0b400e7bde6710cfd10051b8
7
- data.tar.gz: a8fa4bdb2442681e26fdbe3dc595db7e1f956f23c542a2b19f8581fb866d0db6b243acaf4b5bbf1275968a01eeaddfbaa47afaa79b61047b51f9a51706a0a0dd
6
+ metadata.gz: 457c42044259e99d39778189f620bc631b9326f4e85fd632420bb906fd714f9af5caf883492a007f19085fc8d517882ff26aabe2e7ba130eaa79296caed1608d
7
+ data.tar.gz: 6dc2f0740d5516062053aa379f039a48bfa02fc44ec2b0f53ab4d2ca16fa01346e56f25bb87cfb96c3eb7fc017b089e0356fce2eb137f7d18d9dc36504b12fce
@@ -91,21 +91,38 @@ module Makit
91
91
  "#{hours}h #{minutes}m #{seconds}s"
92
92
  end
93
93
 
94
- def self.get_humanized_duration(seconds)
95
- minutes = (seconds / 60).to_i
96
- seconds = (seconds % 60).to_i
94
+ def self.get_humanized_duration(seconds_value)
95
+ minutes = (seconds_value / 60).to_i
96
+ seconds = (seconds_value % 60).to_i
97
97
  hours = (minutes / 60).to_i
98
98
  minutes = minutes % 60
99
99
  days = (hours / 24).to_i
100
100
  hours = hours % 24
101
- milliseconds = (seconds % 1 * 1000).to_i
101
+ milliseconds = (seconds_value % 1 * 1000).to_i
102
102
 
103
103
  parts = []
104
104
  parts << "#{days} days" if days > 0
105
105
  parts << "#{hours} hours" if hours > 0
106
- parts << "#{minutes} minutes" if minutes > 0
107
- parts << "#{seconds} seconds" if seconds > 0
106
+ if(minutes > 0)
107
+ if(minutes == 1)
108
+ parts << "1 minute"
109
+ else
110
+ parts << "#{minutes} minutes"
111
+ end
112
+ end
113
+ if(seconds > 0)
114
+ if(seconds == 1)
115
+ parts << "1 second"
116
+ else
117
+ parts << "#{seconds} seconds"
118
+ end
119
+ end
120
+ #parts << "#{seconds} seconds" if seconds > 0
108
121
  parts << "#{milliseconds} milliseconds" if milliseconds > 0 && seconds < 1
122
+
123
+ if(parts.length == 0)
124
+ parts << "0 seconds"
125
+ end
109
126
  parts.join(", ")
110
127
  end
111
128
  end
data/lib/makit/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Makit
4
- VERSION = "0.0.37"
4
+ VERSION = "0.0.38"
5
5
 
6
6
  class Version
7
7
  # given an array of version strings, return the highest version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: makit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.37
4
+ version: 0.0.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow