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

Version Path
makura-2010.08.26 tasks/metric_changes.rake
makura-2010.08 tasks/metric_changes.rake
ramaze-2010.06.18 tasks/metric_changes.rake
ramaze-2010.04.04 tasks/metric_changes.rake
ramaze-2010.04 tasks/metric_changes.rake
ramaze-2010.03 tasks/metric_changes.rake
ramaze-2010.01 tasks/metric_changes.rake
ramaze-2009.10 tasks/metric_changes.rake
ramaze-2009.07 tasks/metric_changes.rake
ramaze-2009.05 tasks/metric_changes.rake
ramaze-2009.04 tasks/metric_changes.rake
ramaze-2009.06 tasks/metric_changes.rake
ramaze-2009.06.04 tasks/metric_changes.rake
ramaze-2009.06.12 tasks/metric_changes.rake