tyme 0.1.2 → 0.1.4

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: a2a46d1b9eacb9baa96ec64d263bc7db60354c41401e6c7f199b817ea6fdafe2
4
- data.tar.gz: 60f976a50ee01e9af0195c4f5fa7006f7ff6fe18bbb43607393ec975f7688661
3
+ metadata.gz: bed60e0d43071a1c6df7d36f250b87a3ad7bc6ef6a0e57b77cbf36bd1735e8ed
4
+ data.tar.gz: c4de0c1da5e89deb5e2bdb7c3189d0d4f92607026a590b71d3d7546afc9cfa8d
5
5
  SHA512:
6
- metadata.gz: 0b5cf177d55e080d45dc10f6f19027bdc0de2b4a8b94d9b5f5bcc6406365401ff3aafec14c8f5d24c21a1762614e4604c171ca977eb4ed2a9c7e7f28e101c264
7
- data.tar.gz: 4a1ca4cfd568f1607293fc620034efdc7a144f9fc017350f18eacd239bf3ac6eaa96b4a17f5e8934386102db6bfce59c4be6b6f46a702fe1dc75b9e99ef3f9fa
6
+ metadata.gz: 7abf31f78c6bc1a6840404c5a9cbd9784061c759d4d792869ecfed370d5c76f600b7773f1039a459fb8238df60ae2007841507529a8dd2d5c3909065ccca53e5
7
+ data.tar.gz: 21cabe2c982a3410a72c06724917f524746a37eeda6b7babba76a446ef5e218aaa909712b3c8c7f128e8cbddde59fc47eb8abfd44868f280ea0a572b31963248
data/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ ## ChangeLog
2
+
3
+ **v0.1.0**:
4
+
5
+ - intial version
6
+
7
+ **v0.1.2**:
8
+
9
+ - add `bin/tyme` and make it executable
10
+
11
+ **v0.1.3**:
12
+
13
+ - Create DB directory if it does not exist
14
+
15
+ **v0.1.4**:
16
+
17
+ - Fix crash when several date present for the same user
18
+
data/README.md CHANGED
@@ -53,15 +53,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/doc75/
53
53
  ## License
54
54
 
55
55
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
56
-
57
- ## ChangeLog
58
-
59
- **v0.1.0**:
60
-
61
- - intial version
62
-
63
- **v0.1.2**:
64
-
65
- - add `bin/tyme` and make it executable
66
-
67
-
data/lib/tyme/db.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  require 'yaml'
2
+ require 'pathname'
3
+ require 'fileutils'
2
4
 
3
5
  module Tyme
4
6
  class Db
@@ -6,6 +8,9 @@ module Tyme
6
8
  # structure
7
9
  # :user
8
10
  def initialize( file = '/var/lib/tyme/db.yml' )
11
+ # we check if directory exist, otherwise we create it
12
+ dir = Pathname.new(file).dirname
13
+ FileUtils.mkdir_p dir unless Dir.exist? dir
9
14
  @db_file = file
10
15
  @db = {}
11
16
  end
data/lib/tyme/last.rb CHANGED
@@ -26,7 +26,8 @@ module Tyme
26
26
  data.each do |elt|
27
27
  user = elt[:user]
28
28
  date = elt[:date]
29
- ret[user] ||= { date => 0 }
29
+ ret[user] ||= {}
30
+ ret[user][date] ||= 0
30
31
  ret[user][date] += elt[:duration]
31
32
  end
32
33
  ret
data/lib/tyme/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tyme
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tyme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Virlet
@@ -62,6 +62,7 @@ extra_rdoc_files: []
62
62
  files:
63
63
  - ".gitignore"
64
64
  - ".travis.yml"
65
+ - CHANGELOG.md
65
66
  - Gemfile
66
67
  - LICENSE.txt
67
68
  - README.md