# File lib/buildr/core/progressbar.rb, line 110 def human(bytes) magnitude = (0..3).find { |i| bytes < (1024 << i * 10) } || 3 return '%dB' % bytes if magnitude == 0 return '%.1f%s' % [ bytes.to_f / (1 << magnitude * 10), [nil, 'KB', 'MB', 'GB'][magnitude] ] end