This commit is contained in:
Tomasz Gieniusz 2012-10-09 14:19:58 +02:00
parent 450828a2e9
commit c5de39697e
2 changed files with 4 additions and 4 deletions

View file

@ -1,14 +1,14 @@
class GitStats::GitActivity class GitStats::GitActivity
def by_hour def by_hour
@by_hour ||= Hash.new(0) @by_hour ||= Array.new(24, 0)
end end
def by_wday def by_wday
@by_wday ||= Hash.new(0) @by_wday ||= Array.new(7, 0)
end end
def by_wday_hour def by_wday_hour
@by_wday_hour ||= Hash.new { |h, k| h[k] = Hash.new(0) } @by_wday_hour ||= Array.new(7) { Array.new(24, 0) }
end end
def add_commit(date) def add_commit(date)

View file

@ -26,7 +26,7 @@ class GitStats::ViewData
shadow: true shadow: true
) )
git_data.authors.each do |email, author| git_data.authors.each do |email, author|
f.series(:name => email, :data => author.activity.by_wday.inject([]) { |acc, (k, v)| acc[k] = v; acc }) f.series(:name => email, :data => author.activity.by_wday)
end end
end end
end end