From ddaebc287b5250d94ba1fcf36ca875ee8ba02ac8 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Tue, 9 Apr 2019 19:24:01 +1000 Subject: fix breaking gem helper specs --- lib/bundler/gem_helper.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb index 69bff769d7..718a6a41d4 100644 --- a/lib/bundler/gem_helper.rb +++ b/lib/bundler/gem_helper.rb @@ -192,13 +192,15 @@ module Bundler def sh_with_status(cmd, &block) Bundler.ui.debug(cmd) SharedHelpers.chdir(base) do - outbuf = IO.popen(cmd, :err => [:child, :out]) do |io| - Thread.new { print io.getc until io.eof? }.join + outbuf = StringIO.new + IO.popen(cmd, :err => [:child, :out]) do |io| + print outbuf.putc(io.getc) until io.eof? io.close end status = $? - block.call(outbuf) if status.success? && block - [outbuf, status] + output = outbuf.string + block.call(output) if status.success? && block + [output, status] end end -- cgit v1.2.1