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

View File

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