diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb index e9ee03b8a2b..c4706a504d8 100644 --- a/lib/bundler/gem_helper.rb +++ b/lib/bundler/gem_helper.rb @@ -100,13 +100,25 @@ def install_gem(built_gem_path = nil, local = false) protected def rubygem_push(path) - gem_command = %W[gem push #{path}] - gem_command << "--key" << gem_key if gem_key - gem_command << "--host" << allowed_push_host if allowed_push_host + args = ["gem", "push", path] + args += ["--key", gem_key] if gem_key + args += ["--host", allowed_push_host] if allowed_push_host + unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file? raise "Your rubygems.org credentials aren't set. Run `gem push` to set them." end - sh(gem_command) + + Bundler.ui.debug(args.join(" ")) + SharedHelpers.chdir(base) do + IO.popen(args, :in => :in) do |io| + Thread.new { puts io.gets until io.eof? }.join + io.close + end + end + + code = $?.exitstatus + exit code unless code.zero? + Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_push_host}" end