From cbd32dae0a48ffac8ef74d942f1065fba28974a8 Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Tue, 15 Mar 2011 18:18:50 +0100 Subject: [PATCH] add rake authors --- AUTHORS | 2 ++ Rakefile | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/AUTHORS b/AUTHORS index 65cc6192..b88b76fa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -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`. diff --git a/Rakefile b/Rakefile index a662b965..657c5e15 100644 --- a/Rakefile +++ b/Rakefile @@ -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)