38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
# File 'lib/gauntlet_flay.rb', line 38
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
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
|