Sha256: 84cb79f56128dce9fedd8e12f42577803578b536ef28703380c741c47542cae1
Contents?: true
Size: 613 Bytes
Versions: 34
Compression:
Stored size: 613 Bytes
Contents
namespace :metric do desc 'committed changes per file according to git' task 'changes' do $stdout.sync = true out = lambda{|changes, rb| puts("%4d %s" % [changes, rb]) } changes = {} print 'counting changes ' Dir['lib/**/*.rb'].each do |rb| changes = `git-log --pretty=oneline '#{rb}'`.count("\n") print '.' # out[changes, rb] changes[rb] = changes end puts ' done.' sorted = changes.sort_by{|r,c| c }.reverse puts "Top 20:" sorted.first(20).each{|(r,c)| out[c,r] } puts "Bottom 20:" sorted.last(20).each{|(r,c)| out[c,r] } end end
Version data entries
34 entries across 34 versions & 6 rubygems