Class: Aardi::Timekeeper

Inherits:
Object
  • Object
show all
Defined in:
lib/aardi/timekeeper.rb

Overview

:reek:TooManyInstanceVariables

Instance Method Summary collapse

Constructor Details

#initializeTimekeeper

Returns a new instance of Timekeeper.



8
9
10
11
12
13
14
15
# File 'lib/aardi/timekeeper.rb', line 8

def initialize
  @repo = Git.open(Dir.pwd)
  @commit_log = @repo.log(:all).all
  @files = tracked_files_by_mtime
  @files_count = @files.count
  @updated = 0
  @prior_summary_length = 0
end

Instance Method Details

#runObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/aardi/timekeeper.rb', line 17

def run
  @files.each.with_index do |path, index|
    @prior_summary_length = print_progress(index, path)

    commit_date = author_date(path)
    next unless commit_date

    @updated += 1 if fix_mtime?(path, commit_date)
  end
end