Class: CommitStats

Inherits:
CommitAccumulator show all
Defined in:
lib/gitstats/stats/commit.rb

Direct Known Subclasses

AuthorsCommitStats, HourCommitStats

Instance Attribute Summary

Attributes inherited from CommitAccumulator

#commits, #files_added, #files_deleted, #first_commit, #last_commit, #lines_added, #lines_deleted

Instance Method Summary collapse

Methods inherited from CommitAccumulator

#files, #lines

Constructor Details

#initializeCommitStats

Returns a new instance of CommitStats.



44
45
46
47
# File 'lib/gitstats/stats/commit.rb', line 44

def initialize
  super
  @days = {}
end

Instance Method Details

#daysObject



49
50
51
# File 'lib/gitstats/stats/commit.rb', line 49

def days
  @days.size
end

#daystatsObject



53
54
55
# File 'lib/gitstats/stats/commit.rb', line 53

def daystats
  @days
end

#update(commit) ⇒ Object



57
58
59
60
61
62
# File 'lib/gitstats/stats/commit.rb', line 57

def update(commit)
  super(commit)
  day = commit[:time].to_date
  @days[day] ||= CommitAccumulator.new
  @days[day].update(commit)
end