herodot 0.1.6 → 0.1.7

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
  SHA1:
3
- metadata.gz: ebfdde53fd5b240fd01329bb4d91789578a5ce6b
4
- data.tar.gz: 3fc435c77a76fe726bf8f1966ca35e38f59f4d76
3
+ metadata.gz: 01a3b43aff308c8da024870cb12c96fb19b1dbb7
4
+ data.tar.gz: 534a1faf059dada2df482fcc3a7a8f7ea28e1ea9
5
5
  SHA512:
6
- metadata.gz: e94626888ca7b234b4f481b91fc8c3ed0b4f2b542fed6b78e21356bff2cf822de36b472d81294a729f8a2063243fa79650ab55b9bc81264839dcdb14f2213520
7
- data.tar.gz: 924fe536287b0e56d69a038ef3dc8dac20561771a1e59b8bbc42dbd91ebf2c09b2785ef44620ea24f61b420c3e1fdf70db5ed9f7cd90f6a00766a5fa51e37950
6
+ metadata.gz: 1fd244e8f79a85020fbfcc7809acefeb17b7ddd3af8918e89719a960b3d60b6d041b4250036630353c19a9879242db09d2930255c3aaee8c9aeb532eed0d6a22
7
+ data.tar.gz: 6789ce7512930e6deefb6f9484de39ae52cd658b64bd1f64b042ddcdbe56a5ce3713aa0727d48380d0203ad481e7101c3db9d472c8dd08a1eca75c7d0987df23
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+ .DS_Store
@@ -26,6 +26,7 @@ class Herodot::Commands
26
26
  %w(post-checkout post-commit).each do |name|
27
27
  File.open("#{hooks}/#{name}", 'w') { |file| file.write(SCRIPT) }
28
28
  File.chmod(0o755, "#{hooks}/#{name}")
29
+ FileUtils.touch(config.worklog_file)
29
30
  end
30
31
  end
31
32
  end
@@ -12,8 +12,8 @@ class Herodot::Configuration
12
12
  }
13
13
  }.freeze
14
14
 
15
- def initialize
16
- @worklog_file = '~/worklog'
15
+ def initialize(worklog_file = '~/worklog')
16
+ @worklog_file = worklog_file
17
17
  if File.exist?(CONFIG_FILE)
18
18
  @config = load_configuration
19
19
  else
@@ -1,5 +1,4 @@
1
1
  require 'csv'
2
- require 'pry'
3
2
 
4
3
  class Herodot::Parser
5
4
  NO_SUCH_FILE = Rainbow('Worklog missing.').red +
data/lib/herodot/table.rb CHANGED
@@ -3,8 +3,8 @@ require 'terminal-table'
3
3
  class Herodot::Table
4
4
  HEADERS = %w(Project Branch Time).freeze
5
5
  EMPTY_WORKLOG_MESSAGE = Rainbow('Not enough entries in the worklog.').red +
6
- ' On a tracked repository `git checkouts`'\
7
- ' and `git commits` will add entries.'.freeze
6
+ ' On a tracked repository `git checkout`'\
7
+ ' and `git commit` will add entries.'.freeze
8
8
  COLORS = %i(green yellow blue magenta cyan aqua silver aliceblue indianred).freeze
9
9
 
10
10
  class << self
@@ -1,3 +1,3 @@
1
1
  module Herodot
2
- VERSION = '0.1.6'.freeze
2
+ VERSION = '0.1.7'.freeze
3
3
  end
@@ -62,12 +62,11 @@ class Herodot::Worklog
62
62
 
63
63
  def work_time_events
64
64
  dates.flat_map do |date|
65
- @config.work_times.map do |event, (hour, minute)|
66
- {
67
- id: event,
68
- time: Time.new(date.year, date.month, date.day, hour, minute)
69
- }
70
- end
65
+ @config.work_times.map { |event, (hour, minute)|
66
+ time = Time.new(date.year, date.month, date.day, hour, minute)
67
+ next if time > Time.now
68
+ { id: event, time: time }
69
+ }.compact
71
70
  end
72
71
  end
73
72
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: herodot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - bitcrowd