Safer way to redirect puts to a file

This commit is contained in:
Max Howell 2012-09-28 09:49:05 -04:00
parent 7a75915345
commit cddc3649a7

View File

@ -113,10 +113,11 @@ module Homebrew extend self
end
def write_build_config f
$f = f
def Homebrew.puts(*foo); $f.puts(*foo); end
stdout = $stdout
$stdout = f
Homebrew.dump_build_config
class << Homebrew; undef :puts; end
ensure
$stdout = stdout
end
def dump_verbose_config