Refactor contributor hash

to keep track of the number of commits per
project per user.

it's useful information!
This commit is contained in:
Dan Bode
2013-01-29 22:25:27 -08:00
parent f48d0fc990
commit 4519c15572

View File

@@ -63,9 +63,13 @@ module Puppetlabs
if x =~ /^Author:\s+(.*)?\s+<((\S+)@(\S+))>$/
unless ['root', 'vagrant', 'Dan'].include?($1)
if contributors[$1]
contributors[$1][:repos] = contributors[$1][:repos] | [module_name]
if contributors[$1][:repos][module_name]
contributors[$1][:repos][module_name] += 1
else
contributors[$1][:repos][module_name] = 1
end
else
contributors[$1] = {:email => $2, :repos => [module_name] }
contributors[$1] = {:email => $2, :repos => {module_name => 1} }
end
else
# trimming out extra users