diff options
| author | Max Howell | 2009-06-15 01:41:53 +0100 |
|---|---|---|
| committer | Max Howell | 2009-06-15 01:41:53 +0100 |
| commit | ebd9d173d42836c8e207504b9f9a18be0f6878f5 (patch) | |
| tree | e01314d37da28709bbacc423ab2a15a0b142f5d3 | |
| parent | 02e53d44cb23e5f798897ac97df357353c0e6242 (diff) | |
| download | brew-ebd9d173d42836c8e207504b9f9a18be0f6878f5.tar.bz2 | |
pretty_duration function
| -rwxr-xr-x | bin/brew | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -182,6 +182,13 @@ def abv keg='' `find #{keg} -type f | wc -l`.strip+' files, '+`du -hd0 #{keg} | cut -d"\t" -f1`.strip end +######################################################################## utils +def pretty_duration s + return "#{(s*1000).to_i} milliseconds" if s < 3 + return "#{s.to_i} seconds" if s < 10*60 + return "#{(s/60).to_i} minutes" +end + ######################################################################### impl begin case ARGV.shift @@ -228,7 +235,7 @@ begin puts o.caveats ohai "Summary" end - puts "#{o.prefix}: "+abv(name)+", built in #{Time.now - beginning} seconds" + puts "#{o.prefix}: "+abv(name)+", built in #{pretty_duration Time.now-beginning}" rescue Exception FileUtils.rm_rf o.prefix raise |
