mirror of https://github.com/tomgi/git_stats.git
refactor
This commit is contained in:
parent
28ca30ad78
commit
7ac6dcb6c4
|
@ -11,6 +11,14 @@ module GitStats
|
||||||
@commits ||= repo.commits.select { |commit| commit.author == self }
|
@commits ||= repo.commits.select { |commit| commit.author == self }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def insertions
|
||||||
|
short_stats.map(&:insertions).sum
|
||||||
|
end
|
||||||
|
|
||||||
|
def deletions
|
||||||
|
short_stats.map(&:deletions).sum
|
||||||
|
end
|
||||||
|
|
||||||
def commits_sum_by_date
|
def commits_sum_by_date
|
||||||
sum = 0
|
sum = 0
|
||||||
commits.map { |commit|
|
commits.map { |commit|
|
||||||
|
@ -20,10 +28,6 @@ module GitStats
|
||||||
end
|
end
|
||||||
|
|
||||||
[:insertions, :deletions].each do |method|
|
[:insertions, :deletions].each do |method|
|
||||||
define_method method do
|
|
||||||
short_stats.map { |s| s.send(method)} .sum
|
|
||||||
end
|
|
||||||
|
|
||||||
define_method "#{method}_by_date" do
|
define_method "#{method}_by_date" do
|
||||||
sum = 0
|
sum = 0
|
||||||
commits.map { |commit|
|
commits.map { |commit|
|
||||||
|
|
Loading…
Reference in New Issue