diff options
| author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-02-22 11:07:39 +0100 |
|---|---|---|
| committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-02-25 21:09:10 +0100 |
| commit | 289014761b510192863bfd9fc0fadac69819b456 (patch) | |
| tree | 4ecb59b3a2db7275fc0d7b6a4cb1c5a0c2177fb8 /lib | |
| parent | 2f712047bcaf61f690fa1795a0057ba7850aae93 (diff) | |
| download | bundler-289014761b510192863bfd9fc0fadac69819b456.tar.gz | |
Remove more unnecessary rubygems version checks
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/bundler/installer.rb | 9 | ||||
| -rw-r--r-- | lib/bundler/stub_specification.rb | 42 |
2 files changed, 18 insertions, 33 deletions
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index dd30bd5b64..49143b38f9 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -275,14 +275,7 @@ module Bundler end def can_install_in_parallel? - if Bundler.rubygems.provides?(">= 2.1.0") - true - else - Bundler.ui.warn "RubyGems #{Gem::VERSION} is not threadsafe, so your "\ - "gems will be installed one at a time. Upgrade to RubyGems 2.1.0 " \ - "or higher to enable parallel gem installation." - false - end + true end def install_in_parallel(size, standalone, force = false) diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb index 0dd024024a..bef94b505e 100644 --- a/lib/bundler/stub_specification.rb +++ b/lib/bundler/stub_specification.rb @@ -13,17 +13,13 @@ module Bundler attr_accessor :stub, :ignored - # Pre 2.2.0 did not include extension_dir - # https://github.com/rubygems/rubygems/commit/9485ca2d101b82a946d6f327f4bdcdea6d4946ea - if Bundler.rubygems.provides?(">= 2.2.0") - def source=(source) - super - # Stub has no concept of source, which means that extension_dir may be wrong - # This is the case for git-based gems. So, instead manually assign the extension dir - return unless source.respond_to?(:extension_dir_name) - path = File.join(stub.extensions_dir, source.extension_dir_name) - stub.extension_dir = File.expand_path(path) - end + def source=(source) + super + # Stub has no concept of source, which means that extension_dir may be wrong + # This is the case for git-based gems. So, instead manually assign the extension dir + return unless source.respond_to?(:extension_dir_name) + path = File.join(stub.extensions_dir, source.extension_dir_name) + stub.extension_dir = File.expand_path(path) end def to_yaml @@ -32,11 +28,9 @@ module Bundler # @!group Stub Delegates - if Bundler.rubygems.provides?(">= 2.3") - # This is defined directly to avoid having to load every installed spec - def missing_extensions? - stub.missing_extensions? - end + # This is defined directly to avoid having to load every installed spec + def missing_extensions? + stub.missing_extensions? end def activated @@ -57,16 +51,14 @@ module Bundler stub.full_gem_path || method_missing(:full_gem_path) end - if Bundler.rubygems.provides?(">= 2.2.0") - def full_require_paths - stub.full_require_paths - end + def full_require_paths + stub.full_require_paths + end - # This is what we do in bundler/rubygems_ext - # full_require_paths is always implemented in >= 2.2.0 - def load_paths - full_require_paths - end + # This is what we do in bundler/rubygems_ext + # full_require_paths is always implemented + def load_paths + full_require_paths end def loaded_from |
