diff options
Diffstat (limited to 'lib/bundler/gem_helper.rb')
-rw-r--r-- | lib/bundler/gem_helper.rb | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb index 8ed1af231f..ca39f122e9 100644 --- a/lib/bundler/gem_helper.rb +++ b/lib/bundler/gem_helper.rb @@ -187,28 +187,13 @@ module Bundler out end - if RUBY_VERSION >= "1.9" - def sh_with_status(cmd, &block) - Bundler.ui.debug(cmd) - SharedHelpers.chdir(base) do - outbuf = IO.popen(cmd, :err => [:child, :out], &:read) - status = $? - block.call(outbuf) if status.success? && block - [outbuf, status] - end - end - else - def sh_with_status(cmd, &block) - cmd = cmd.shelljoin if cmd.respond_to?(:shelljoin) - cmd += " 2>&1" - outbuf = String.new - Bundler.ui.debug(cmd) - SharedHelpers.chdir(base) do - outbuf = `#{cmd}` - status = $? - block.call(outbuf) if status.success? && block - [outbuf, status] - end + def sh_with_status(cmd, &block) + Bundler.ui.debug(cmd) + SharedHelpers.chdir(base) do + outbuf = IO.popen(cmd, :err => [:child, :out], &:read) + status = $? + block.call(outbuf) if status.success? && block + [outbuf, status] end end |