Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- times = ARGV.map { |f| [f.split(?.).first, File.readlines(f).map { |l| l.split[-1].to_f }] }.to_h
- def colour(s, rat)
- code = if rat == 1
- 34
- elsif rat <= 2
- 32
- elsif rat <= 5
- 33
- else
- 31
- end
- "\e[1;#{code}m#{s}\e[0m"
- end
- puts ' ' + times.keys.map { |k| '%6s' % k }.join(' ')
- 25.times { |n|
- left = '%2d ' % (n + 1)
- mintime = times.values.map { |vs| vs[n] }.min
- ratios = times.values.map { |vs| vs[n] / mintime }
- puts left + ratios.map { |r| colour('%6.2f' % r, r) }.join(' ')
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement