diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-07-11 11:33:03 +0200 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-07-11 12:10:45 +0200 |
commit | 8ecd722b9fb80efb3c167f77c8ed307c02f1311d (patch) | |
tree | 706e0df22b3562489d7786a69f9932c22cac4d70 | |
parent | 062cd2be7cfc24e46e3a2608c279e6f55d715d6b (diff) | |
download | bundler-drop_rubygems_2_5_0_and_2_5_1_support.tar.gz |
Drop rubygems 2.5.0 and 2.5.1 supportdrop_rubygems_2_5_0_and_2_5_1_support
-rw-r--r-- | bundler.gemspec | 2 | ||||
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 14 | ||||
-rw-r--r-- | lib/bundler/source/git.rb | 10 | ||||
-rw-r--r-- | lib/bundler/stub_specification.rb | 6 | ||||
-rw-r--r-- | spec/commands/exec_spec.rb | 2 |
5 files changed, 8 insertions, 26 deletions
diff --git a/bundler.gemspec b/bundler.gemspec index 3b515caad9..898ac84a58 100644 --- a/bundler.gemspec +++ b/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.files = Dir.glob("{lib,exe}/**/*", File::FNM_DOTMATCH).reject {|f| File.directory?(f) } diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 734ac91bd9..421542587c 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 diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index 5d86df2b82..b01a31fb50 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -851,7 +851,7 @@ __FILE__: #{path.to_s.inspect} bundle :install, :system_bundler => true, :path => "vendor/bundler" end - it "overrides disable_shared_gems so bundler can be found", :ruby_repo, :rubygems => ">= 2.5.2" do + it "overrides disable_shared_gems so bundler can be found", :ruby_repo do system_gems :bundler file = bundled_app("file_that_bundle_execs.rb") create_file(file, <<-RB) |