Gauntlet
# File lib/gauntlet_flay.rb, line 37 def display_report max good_data = {} bad_count = 0 zero_count = 0 @data.each do |name, flay| case when flay < 0 then bad_count += 1 when flay == 0 then zero_count += 1 else good_data[name] = flay end end scores = good_data.values # SWEET JESUS: # # without zeros: # average flay: 1487.23 +/- 7800.16 # with zeros: # average flay: 988.69 +/- 6398.45 puts "broken projects : %d" % bad_count puts "great projects : %d" % zero_count puts "bad projects : %d" % good_data.size puts "average flay : %.2f +/- %.2f" % [scores.average, scores.stddev] top = good_data.sort_by { |name,flay| -flay }.first max puts top.each_with_index do |(name, flay), i| puts "%3d: %10.2f: %s" % [ i, flay, name ] end end
# File lib/gauntlet_flay.rb, line 31 def run name warn name self.data[name] = score_for '.' self.dirty = true end
OTHER
# File lib/gauntlet_flay.rb, line 79 def score_for dir # files = `find #{dir} -name \\*.rb | grep -v gen.*templ`.split(/\n/) flayer = Flay.new dirs = %(app lib test spec).reject { |f| ! File.directory? f } flay = Flay.new flay.process(*Flay.expand_dirs_to_files(dirs)) flay.total rescue Interrupt # let us break out rescue Exception -1 end
Generated with the Darkfish Rdoc Generator 2.