Skip to content

Commit

Permalink
add rake authors
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh committed Mar 15, 2011
1 parent 6d7c4c0 commit cbd32da
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions AUTHORS
Expand Up @@ -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`.
15 changes: 15 additions & 0 deletions Rakefile
Expand Up @@ -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)
Expand Down

0 comments on commit cbd32da

Please sign in to comment.