Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Removed compatibility hack for old rubies.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Mar 1, 2018
1 parent c4fc79a commit 4e142c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 34 deletions.
10 changes: 2 additions & 8 deletions lib/bundler/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,8 @@ def self.read_file(filename)

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
Expand Down
29 changes: 7 additions & 22 deletions lib/bundler/gem_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,28 +192,13 @@ def sh_with_code(cmd, &block)
[outbuf, (status && status.exitstatus) || -1]
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

Expand Down
4 changes: 0 additions & 4 deletions lib/bundler/installer/parallel_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ def initialize(installer, all_specs, size, standalone, force)
end

def call
# Since `autoload` has the potential for threading issues on 1.8.7
# TODO: remove in bundler 2.0
require "bundler/gem_remote_fetcher" if RUBY_VERSION < "1.9"

check_for_corrupt_lockfile

if @size > 1
Expand Down

0 comments on commit 4e142c6

Please sign in to comment.