This commit is contained in:
Tomasz Gieniusz 2012-10-20 22:41:50 +02:00
parent 35d03d9392
commit 99921c44ea

View file

@ -48,24 +48,16 @@ module GitStats
end end
end end
def lines_added_by_author [:lines_added_by_author, :lines_deleted_by_author].each do |method|
define_method method do
Chart.new do |f| Chart.new do |f|
f.column_hash_chart( f.column_hash_chart(
data: Hash[@repo.lines_added_by_author.map {|a, l| [a.email, l]}], data: Hash[@repo.send(method).map { |a, l| [a.email, l] }],
title: :lines_added_by_author.t, title: method.t,
y_text: :lines.t y_text: :lines.t
) )
end end
end end
def lines_deleted_by_author
Chart.new do |f|
f.column_hash_chart(
data: Hash[@repo.lines_deleted_by_author.map {|a, l| [a.email, l]}],
title: :lines_deleted_by_author.t,
y_text: :lines.t
)
end
end end
end end