diff options
| author | Jack Nagel | 2013-12-12 15:42:31 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-12-12 15:42:35 -0600 |
| commit | bc3ebd8343b938e6fb424857cf275e69803769a7 (patch) | |
| tree | fbf83d358445af7ab81bcf8e8f1882a2175c32de /Library/Homebrew | |
| parent | 3516bb68d3ca06d14fbcec343fa8792cef922792 (diff) | |
| download | brew-bc3ebd8343b938e6fb424857cf275e69803769a7.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/Homebrew')
| -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 |
