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.
This commit is contained in:
Jack Nagel 2013-12-12 15:42:31 -06:00
parent 3516bb68d3
commit bc3ebd8343

View File

@ -319,16 +319,23 @@ class FormulaInstaller
post_install post_install
ohai "Summary" if ARGV.verbose? or show_summary_heading ohai "Summary" if ARGV.verbose? or show_summary_heading
unless ENV['HOMEBREW_NO_EMOJI'] puts summary
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
ensure ensure
unlock if hold_locks? unlock if hold_locks?
end 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 def build_time
@build_time ||= Time.now - @start_time unless pour_bottle? or ARGV.interactive? or @start_time.nil? @build_time ||= Time.now - @start_time unless pour_bottle? or ARGV.interactive? or @start_time.nil?
end end