ruby-changes:68425
From: David <ko1@a...>
Date: Wed, 13 Oct 2021 16:22:01 +0900 (JST)
Subject: [ruby-changes:68425] d6627ab85c (master): [rubygems/rubygems] Remove unnecessary code
https://git.ruby-lang.org/ruby.git/commit/?id=d6627ab85c From d6627ab85c7e29a45ee61af350a38c37ea2bd83b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Mon, 11 Oct 2021 19:58:24 +0200 Subject: [rubygems/rubygems] Remove unnecessary code All supported rubygems versions implement this. https://github.com/rubygems/rubygems/commit/2130782ef6 --- lib/bundler/rubygems_integration.rb | 6 +----- lib/bundler/runtime.rb | 2 +- spec/bundler/commands/binstubs_spec.rb | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 789797d8d0..8589c14704 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -86,16 +86,12 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/rubygems_integration.rb#L86 def spec_missing_extensions?(spec, default = true) return spec.missing_extensions? if spec.respond_to?(:missing_extensions?) - return false if spec_default_gem?(spec) + return false if spec.default_gem? return false if spec.extensions.empty? default end - def spec_default_gem?(spec) - spec.respond_to?(:default_gem?) && spec.default_gem? - end - def spec_matches_for_glob(spec, glob) return spec.matches_for_glob(glob) if spec.respond_to?(:matches_for_glob) diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb index fbb8833cfb..31e71388a6 100644 --- a/lib/bundler/runtime.rb +++ b/lib/bundler/runtime.rb @@ -291,7 +291,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/runtime.rb#L291 return unless activated_spec = Bundler.rubygems.loaded_specs(spec.name) return if activated_spec.version == spec.version - suggestion = if Bundler.rubygems.spec_default_gem?(activated_spec) + suggestion = if activated_spec.default_gem? "Since #{spec.name} is a default gem, you can either remove your dependency on it" \ " or try updating to a newer version of bundler that supports #{spec.name} as a default gem." else diff --git a/spec/bundler/commands/binstubs_spec.rb b/spec/bundler/commands/binstubs_spec.rb index c8eef55266..1cd0e16d95 100644 --- a/spec/bundler/commands/binstubs_spec.rb +++ b/spec/bundler/commands/binstubs_spec.rb @@ -116,7 +116,7 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L116 s.executables = "print_loaded_gems" s.bindir = "exe" s.write "exe/print_loaded_gems", <<-R - specs = Gem.loaded_specs.values.reject {|s| Bundler.rubygems.spec_default_gem?(s) } + specs = Gem.loaded_specs.values.reject {|s| s.default_gem? } puts specs.map(&:full_name).sort.inspect R end -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/