summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-02-22 11:07:39 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-02-25 21:09:10 +0100
commit289014761b510192863bfd9fc0fadac69819b456 (patch)
tree4ecb59b3a2db7275fc0d7b6a4cb1c5a0c2177fb8
parent2f712047bcaf61f690fa1795a0057ba7850aae93 (diff)
downloadbundler-289014761b510192863bfd9fc0fadac69819b456.tar.gz
Remove more unnecessary rubygems version checks
-rw-r--r--lib/bundler/installer.rb9
-rw-r--r--lib/bundler/stub_specification.rb42
-rw-r--r--spec/bundler/stub_specification_spec.rb10
-rw-r--r--spec/quality_spec.rb10
-rw-r--r--spec/realworld/parallel_spec.rb12
5 files changed, 27 insertions, 56 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
diff --git a/spec/bundler/stub_specification_spec.rb b/spec/bundler/stub_specification_spec.rb
index 5521d83769..7495b5d661 100644
--- a/spec/bundler/stub_specification_spec.rb
+++ b/spec/bundler/stub_specification_spec.rb
@@ -13,12 +13,10 @@ RSpec.describe Bundler::StubSpecification do
described_class.from_stub(gemspec)
end
- if Bundler.rubygems.provides?(">= 2.1")
- describe "#from_stub" do
- it "returns the same stub if already a Bundler::StubSpecification" do
- stub = described_class.from_stub(with_bundler_stub_spec)
- expect(stub).to be(with_bundler_stub_spec)
- end
+ describe "#from_stub" do
+ it "returns the same stub if already a Bundler::StubSpecification" do
+ stub = described_class.from_stub(with_bundler_stub_spec)
+ expect(stub).to be(with_bundler_stub_spec)
end
end
end
diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb
index cbeabb3b6e..8bdef33a79 100644
--- a/spec/quality_spec.rb
+++ b/spec/quality_spec.rb
@@ -226,14 +226,10 @@ RSpec.describe "The library itself" do
gem_command! :build, gemspec
end
- if Bundler.rubygems.provides?(">= 2.4")
- # there's no way around this warning
- last_command.stderr.sub!(/^YAML safe loading.*/, "")
+ # there's no way around this warning
+ last_command.stderr.sub!(/^YAML safe loading.*/, "")
- # older rubygems have weird warnings, and we won't actually be using them
- # to build the gem for releases anyways
- expect(last_command.stderr).to be_empty, "bundler should build as a gem without warnings, but\n#{err}"
- end
+ expect(last_command.stderr).to be_empty, "bundler should build as a gem without warnings, but\n#{err}"
ensure
# clean up the .gem generated
FileUtils.rm("bundler-#{Bundler::VERSION}.gem")
diff --git a/spec/realworld/parallel_spec.rb b/spec/realworld/parallel_spec.rb
index ed4430c68b..ebb7987e0b 100644
--- a/spec/realworld/parallel_spec.rb
+++ b/spec/realworld/parallel_spec.rb
@@ -11,11 +11,7 @@ RSpec.describe "parallel", :realworld => true, :sometimes => true do
bundle :install, :jobs => 4, :env => { "DEBUG" => "1" }
- if Bundler.rubygems.provides?(">= 2.1.0")
- expect(out).to match(/[1-3]: /)
- else
- expect(out).to include("is not threadsafe")
- end
+ expect(out).to match(/[1-3]: /)
bundle "info activesupport --path"
expect(out).to match(/activesupport/)
@@ -40,11 +36,7 @@ RSpec.describe "parallel", :realworld => true, :sometimes => true do
bundle :update, :jobs => 4, :env => { "DEBUG" => "1" }, :all => bundle_update_requires_all?
- if Bundler.rubygems.provides?(">= 2.1.0")
- expect(out).to match(/[1-3]: /)
- else
- expect(out).to include("is not threadsafe")
- end
+ expect(out).to match(/[1-3]: /)
bundle "info activesupport --path"
expect(out).to match(/activesupport-3\.2\.\d+/)