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
Pistos-ramaze-2009.04.08 tasks/metric_changes.rake
Pistos-ramaze-2009.06.12 tasks/metric_changes.rake
manveru-ramaze-2009.04.01 tasks/metric_changes.rake
manveru-ramaze-2009.04.08 tasks/metric_changes.rake
manveru-ramaze-2009.04.18 tasks/metric_changes.rake
manveru-ramaze-2009.04.22 tasks/metric_changes.rake
manveru-ramaze-2009.04 tasks/metric_changes.rake
manveru-ramaze-2009.05.08 tasks/metric_changes.rake
manveru-ramaze-2009.05 tasks/metric_changes.rake
manveru-ramaze-2009.06.04 tasks/metric_changes.rake
manveru-ramaze-2009.06.12 tasks/metric_changes.rake
manveru-ramaze-2009.06 tasks/metric_changes.rake
manveru-ramaze-2009.07 tasks/metric_changes.rake
rjspotter-ramaze-2009.06.29 tasks/metric_changes.rake
rjspotter-ramaze-2009.06.31 tasks/metric_changes.rake
seedling-0.0.6 lib/templates/core/tasks/metric_changes.rake
makura-2012.01 tasks/metric_changes.rake
ramaze-2011.01.30 tasks/metric_changes.rake
ramaze-2011.01 tasks/metric_changes.rake
makura-2011.01.21 tasks/metric_changes.rake