This commit is contained in:
Tomasz Gieniusz 2012-10-21 23:04:48 +02:00
parent 28ca30ad78
commit 7ac6dcb6c4
1 changed files with 8 additions and 4 deletions

View File

@ -11,6 +11,14 @@ module GitStats
@commits ||= repo.commits.select { |commit| commit.author == self }
end
def insertions
short_stats.map(&:insertions).sum
end
def deletions
short_stats.map(&:deletions).sum
end
def commits_sum_by_date
sum = 0
commits.map { |commit|
@ -20,10 +28,6 @@ module GitStats
end
[:insertions, :deletions].each do |method|
define_method method do
short_stats.map { |s| s.send(method)} .sum
end
define_method "#{method}_by_date" do
sum = 0
commits.map { |commit|