add rake authors

This commit is contained in:
Konstantin Haase 2011-03-15 18:18:50 +01:00
parent 6d7c4c001d
commit cbd32dae0a
2 changed files with 17 additions and 0 deletions

View File

@ -54,3 +54,5 @@ and last but not least:
* Frank Sinatra (chairman of the board) for having so much class he
deserves a web-framework named after him.
For a complete list of all contributors to Sinatra itself, run `rake authors`.

View File

@ -80,6 +80,21 @@ task :thanks, [:release,:backports] do |t, a|
"(based on commits included in #{a.release}, but not in #{a.backports})"
end
task :authors, [:format, :sep] do |t, a|
a.with_defaults :format => "%s (%d)", :sep => ', '
authors = Hash.new { |h,k| h[k] = 0 }
blake = "Blake Mizerany"
mapping = {
"blake.mizerany@gmail.com" => blake, "bmizerany" => blake,
"a_user@mac.com" => blake, "ichverstehe" => "Harry Vangberg",
"Wu Jiang (nouse)" => "Wu Jiang" }
`git shortlog -s`.lines.map do |line|
num, name = line.split("\t", 2).map(&:strip)
authors[mapping[name] || name] += num.to_i
end
puts authors.sort_by { |n,c| -c }.map { |e| a.format % e }.join(a.sep)
end
# PACKAGING ============================================================
if defined?(Gem)