aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-07-11 11:33:03 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-03 09:29:58 +0900
commit31541d738924e714e9b580b33eb44608ea248486 (patch)
treeca2b6978863bf7662eaf437b327216e4f4bd4a27 /lib/bundler
parentfc42423b8df652e3f75436200e5bdfbacd167959 (diff)
downloadruby-31541d738924e714e9b580b33eb44608ea248486.tar.gz
[bundler/bundler] Drop rubygems 2.5.0 and 2.5.1 support
https://github.com/bundler/bundler/commit/8ecd722b9f
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/bundler.gemspec2
-rw-r--r--lib/bundler/rubygems_integration.rb14
-rw-r--r--lib/bundler/source/git.rb10
-rw-r--r--lib/bundler/stub_specification.rb6
4 files changed, 7 insertions, 25 deletions
diff --git a/lib/bundler/bundler.gemspec b/lib/bundler/bundler.gemspec
index f79ce7478c..741e5726bb 100644
--- a/lib/bundler/bundler.gemspec
+++ b/lib/bundler/bundler.gemspec
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
end
s.required_ruby_version = ">= 2.3.0"
- s.required_rubygems_version = ">= 2.5.0"
+ s.required_rubygems_version = ">= 2.5.2"
s.add_development_dependency "automatiek", "~> 0.1.0"
s.add_development_dependency "rake", "~> 12.0"
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 15771e6c0a..dcf0007ca2 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -314,19 +314,6 @@ module Bundler
end
end
- # RubyGems-generated binstubs call Kernel#gem
- def binstubs_call_gem?
- !provides?(">= 2.5.2")
- end
-
- # only 2.5.2+ has all of the stub methods we want to use, and since this
- # is a performance optimization _only_,
- # we'll restrict ourselves to the most
- # recent RG versions instead of all versions that have stubs
- def stubs_provide_full_functionality?
- provides?(">= 2.5.2")
- end
-
def replace_gem(specs, specs_by_name)
reverse_rubygems_kernel_mixin
@@ -335,7 +322,6 @@ module Bundler
kernel = (class << ::Kernel; self; end)
[kernel, ::Kernel].each do |kernel_class|
redefine_method(kernel_class, :gem) do |dep, *reqs|
- executables ||= specs.map(&:executables).flatten if ::Bundler.rubygems.binstubs_call_gem?
if executables && executables.include?(File.basename(caller.first.split(":").first))
break
end
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index ed16f4a4e0..73123622d4 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -314,12 +314,10 @@ module Bundler
# no-op, since we validate when re-serializing the gemspec
def validate_spec(_spec); end
- if Bundler.rubygems.stubs_provide_full_functionality?
- def load_gemspec(file)
- stub = Gem::StubSpecification.gemspec_stub(file, install_path.parent, install_path.parent)
- stub.full_gem_path = Pathname.new(file).dirname.expand_path(root).to_s.untaint
- StubSpecification.from_stub(stub)
- end
+ def load_gemspec(file)
+ stub = Gem::StubSpecification.gemspec_stub(file, install_path.parent, install_path.parent)
+ stub.full_gem_path = Pathname.new(file).dirname.expand_path(root).to_s.untaint
+ StubSpecification.from_stub(stub)
end
def git_scope
diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb
index bad69c9a14..d45f80a80a 100644
--- a/lib/bundler/stub_specification.rb
+++ b/lib/bundler/stub_specification.rb
@@ -63,10 +63,8 @@ module Bundler
stub.loaded_from
end
- if Bundler.rubygems.stubs_provide_full_functionality?
- def matches_for_glob(glob)
- stub.matches_for_glob(glob)
- end
+ def matches_for_glob(glob)
+ stub.matches_for_glob(glob)
end
def raw_require_paths