makit 0.0.19 → 0.0.20

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: 88910903d0ee3682765921d29707827172202167578e33a9a157f04dbd72ed99
4
- data.tar.gz: bcd4999ce60281fc5564d434ab80e049a802623eca18c30edf660a43e74cf3b5
3
+ metadata.gz: 6907ebf24a2329adf0bba41970b506e5b1a21d0459c82a0c44aa721946015c42
4
+ data.tar.gz: 36276973efd109200ea9448bbf9a072d3f43f4c983d28b71f520442f0dcb9b96
5
5
  SHA512:
6
- metadata.gz: 8b567423abe3a7e111903b3a757422e6653933dd3e9703bbda4fc42071cae30ef5f2a550bb4915daf9380d60f580c44bcee54f9d6f1b362d067a1af5efd6caf4
7
- data.tar.gz: bef0ded70a5a597a216f4e90dfb05b0f12ec0e772e77f1aabe4939d86e83e91e50950ed0744cedd384de98ded97d46c58efe0e281c63ce0e3af2ff1610b3a4aa
6
+ metadata.gz: fecfe917f1dd787788af641b4b15a63a7f94dfe44b6efa0f008c1a8f90db5e1f61dc580a9a4fdb558f940c7b858138049e7912af094433a3c2b58aa49d884a2d
7
+ data.tar.gz: eade8504dd9d374edf17095af9a74dd10341c6092e861c1208a135f8973d5a6a9adf302245383d2849362c7397cf496d99dfd8612f0a5bd539f7a8badf14104f
@@ -86,8 +86,21 @@ module Makit
86
86
  "#{hours}h #{minutes}m #{seconds}s"
87
87
  end
88
88
 
89
- def self.get_humanized_duration(duration)
90
- get_protobuf_duration(duration)
89
+ def self.get_humanized_duration(seconds)
90
+ minutes = (seconds / 60).to_i
91
+ seconds = (seconds % 60).to_i
92
+ hours = (minutes / 60).to_i
93
+ minutes = minutes % 60
94
+ days = (hours / 24).to_i
95
+ hours = hours % 24
96
+
97
+ parts = []
98
+ parts << "#{days} days" if days > 0
99
+ parts << "#{hours} hours" if hours > 0
100
+ parts << "#{minutes} minutes" if minutes > 0
101
+ parts << "#{seconds} seconds" if seconds > 0
102
+
103
+ parts.join(", ")
91
104
  end
92
105
  end
93
106
  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.19"
4
+ VERSION = "0.0.20"
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.19
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow