summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-01-23 11:31:32 +0000
committerColby Swandale <me@colby.fyi>2019-04-01 22:46:35 +1100
commit0bddeb6ecc87842d2876c103c7b7b61e892b5ba5 (patch)
tree390cab894c3d8d9c7febf78537c8350129aca2b2
parent9bca235729444a35c8759dc6be5446d089272fa2 (diff)
downloadbundler-0bddeb6ecc87842d2876c103c7b7b61e892b5ba5.tar.gz
Merge #6315
6315: Removed compatibility hack for old rubies. r=hsbt a=hsbt Nothing. Bundler will never use them in version 2. Co-authored-by: SHIBATA Hiroshi <hsbt@ruby-lang.org> (cherry picked from commit 1b2559ab57da944e92f93db61a0a322642cd0b31)
-rw-r--r--lib/bundler/env.rb10
-rw-r--r--lib/bundler/gem_helper.rb10
2 files changed, 6 insertions, 14 deletions
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb
index 51738139fa..9cd9b8baca 100644
--- a/lib/bundler/env.rb
+++ b/lib/bundler/env.rb
@@ -70,14 +70,8 @@ module Bundler
def self.ruby_version
str = String.new("#{RUBY_VERSION}")
- if RUBY_VERSION < "1.9"
- str << " (#{RUBY_RELEASE_DATE}"
- str << " patchlevel #{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
- str << ") [#{RUBY_PLATFORM}]"
- else
- str << "p#{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
- str << " (#{RUBY_RELEASE_DATE} revision #{RUBY_REVISION}) [#{RUBY_PLATFORM}]"
- end
+ str << "p#{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
+ str << " (#{RUBY_RELEASE_DATE} revision #{RUBY_REVISION}) [#{RUBY_PLATFORM}]"
end
def self.git_version
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb
index 55f484f723..27243a9821 100644
--- a/lib/bundler/gem_helper.rb
+++ b/lib/bundler/gem_helper.rb
@@ -181,14 +181,12 @@ module Bundler
out
end
- def sh_with_code(cmd, &block)
- cmd += " 2>&1"
- outbuf = String.new
+ def sh_with_status(cmd, &block)
Bundler.ui.debug(cmd)
SharedHelpers.chdir(base) do
- outbuf = `#{cmd}`
- status = $?.exitstatus
- block.call(outbuf) if status.zero? && block
+ outbuf = IO.popen(cmd, :err => [:child, :out], &:read)
+ status = $?
+ block.call(outbuf) if status.success? && block
[outbuf, status]
end
end