diff options
| author | Jack Nagel | 2013-12-12 15:42:31 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-12-12 15:42:35 -0600 |
| commit | 87172bd30bfd0492ff03fd74216aa698172fc637 (patch) | |
| tree | 63f295275b697b5512766986a0eb48efeda33432 /Library | |
| parent | 8a40b00435354a1577406c04efd6a33132194134 (diff) | |
| download | homebrew-87172bd30bfd0492ff03fd74216aa698172fc637.tar.bz2 | |
Build install summary in a separate method and print all at once
This prevents interleaved output, e.g. when running with Ruby warnings
turned on.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 7b4771810..a78fd0d13 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -319,16 +319,23 @@ class FormulaInstaller post_install ohai "Summary" if ARGV.verbose? or show_summary_heading - unless ENV['HOMEBREW_NO_EMOJI'] - print "#{ENV['HOMEBREW_INSTALL_BADGE'] || "\xf0\x9f\x8d\xba"} " if MacOS.version >= :lion - end - print "#{f.prefix}: #{f.prefix.abv}" - print ", built in #{pretty_duration build_time}" if build_time - puts + puts summary ensure unlock if hold_locks? end + def emoji + ENV['HOMEBREW_INSTALL_BADGE'] || "\xf0\x9f\x8d\xba" + end + + def summary + s = "" + s << "#{emoji} " if MacOS.version >= :lion and not ENV['HOMEBREW_NO_EMOJI'] + s << "#{f.prefix}: #{f.prefix.abv}" + s << ", built in #{pretty_duration build_time}" if build_time + s + end + def build_time @build_time ||= Time.now - @start_time unless pour_bottle? or ARGV.interactive? or @start_time.nil? end |
