mirror of
https://github.com/tomgi/git_stats.git
synced 2024-12-22 13:32:17 +01:00
refactor
This commit is contained in:
parent
450828a2e9
commit
c5de39697e
2 changed files with 4 additions and 4 deletions
|
@ -1,14 +1,14 @@
|
|||
class GitStats::GitActivity
|
||||
def by_hour
|
||||
@by_hour ||= Hash.new(0)
|
||||
@by_hour ||= Array.new(24, 0)
|
||||
end
|
||||
|
||||
def by_wday
|
||||
@by_wday ||= Hash.new(0)
|
||||
@by_wday ||= Array.new(7, 0)
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
def add_commit(date)
|
||||
|
|
|
@ -26,7 +26,7 @@ class GitStats::ViewData
|
|||
shadow: true
|
||||
)
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue