Show
Ignore:
Timestamp:
12/12/07 23:44:29 (13 months ago)
Author:
walf443
Message:

lang/ruby/coderepos_stat/Rakefile: added task to count of commit by author.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/coderepos_stat/Rakefile

    r3041 r3094  
    66file 'svn_log.txt' do |t| 
    77  # FIXME: it's better to user can specify revision range and limit number 
    8   sh %{svn log --xml -v -r 1:HEAD --limit 100 http://svn.coderepos.org/share/ > svn_log.txt} 
     8  sh %[svn log --xml -v -r {2007-12-01}:HEAD http://svn.coderepos.org/share/ > svn_log.txt] 
    99end 
    1010 
     
    4444end 
    4545 
     46desc 'commit count by committer from svn_log.txt' 
     47task 'commit_ranking' => ['svn_log.txt'] do 
     48  require 'hpricot' 
     49 
     50  doc = Hpricot.parse(open('svn_log.txt').read) 
     51  commit_count_of = Hash.new(0) 
     52  doc.search('/log/logentry') do |logentry| 
     53    author = logentry.search('/author').inner_text 
     54    commit_count_of[author] += 1 
     55  end 
     56  commit_count_of.sort_by {|key,val| -1 * val }.each do |arr| 
     57    author, commit_count = *arr 
     58    puts "#{author}\t#{commit_count}" 
     59  end 
     60end 
     61 
    4662desc 'cleanbackup' 
    4763task :cleanbackup do