tyme 0.1.4 → 0.2.0

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: bed60e0d43071a1c6df7d36f250b87a3ad7bc6ef6a0e57b77cbf36bd1735e8ed
4
- data.tar.gz: c4de0c1da5e89deb5e2bdb7c3189d0d4f92607026a590b71d3d7546afc9cfa8d
3
+ metadata.gz: 6f401c3644db6ece8d9e393aaeb1addcfee16cd8e76845b35ec0368a8e223940
4
+ data.tar.gz: 4e3b80aef53ab8cd7d52ff8b3fa0956f8d197afa928ad3bbc1245b0584ad1f51
5
5
  SHA512:
6
- metadata.gz: 7abf31f78c6bc1a6840404c5a9cbd9784061c759d4d792869ecfed370d5c76f600b7773f1039a459fb8238df60ae2007841507529a8dd2d5c3909065ccca53e5
7
- data.tar.gz: 21cabe2c982a3410a72c06724917f524746a37eeda6b7babba76a446ef5e218aaa909712b3c8c7f128e8cbddde59fc47eb8abfd44868f280ea0a572b31963248
6
+ metadata.gz: cb28fe54bd112ba3df3375e89ea1b59c64a58f2efda4e161ed9da14e38255982371d6d9fc60ab5914c688469691cd0c7423a0cf420805fb8033edd75d1261066
7
+ data.tar.gz: ff7e87ea83f3ed0a2a49ccbfe443c5f2bc87eb420bbc16303533a851a92d3fc0a671e447aa38bc13ea6571ae90a6b668253e24e813e49a40dfd8735a45e0e1a2
@@ -16,3 +16,7 @@
16
16
 
17
17
  - Fix crash when several date present for the same user
18
18
 
19
+ **v0.2.0**:
20
+
21
+ - Fix crash when duration for a user is more than 1 day
22
+
@@ -34,9 +34,12 @@ module Tyme
34
34
  end
35
35
 
36
36
  def parse_line( line )
37
- values = line.scan( /(\S+)\s+tty\d+\s+(\S+)\s+-?\s+\S+\s+\((\d+):(\d+)\)/ )[0]
37
+ values = line.scan( /(\S+)\s+tty\d+\s+(\S+)\s+-?\s+\S+\s+\((\d\+)?(\d+):(\d+)\)/ )[0]
38
38
  date = DateTime.parse( values[1] ).strftime('%F')
39
- { user: values[0].to_sym, date: date.to_sym, duration: values[2].to_i*60 + values[3].to_i }
39
+ duration = values[3].to_i*60 + values[4].to_i
40
+ # case where duration is more than one day
41
+ duration += values[2].to_i*1440 if values[2]
42
+ { user: values[0].to_sym, date: date.to_sym, duration: duration }
40
43
  end
41
44
  end
42
45
  end
@@ -1,3 +1,3 @@
1
1
  module Tyme
2
- VERSION = "0.1.4"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tyme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Virlet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-03 00:00:00.000000000 Z
11
+ date: 2018-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler