mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 14:05:02 +02:00
[rubygems/rubygems] Avoid more warnings when using RubyGems with old Bundler
We were only avoiding them when the RUBYGEMS_GEMDEPS variable is used.
Avoid the warnings in general, whenever the entrypoint to Bundler is
`require`.
8683faef36
This commit is contained in:
parent
a93c684077
commit
c3d41492e1
2 changed files with 7 additions and 6 deletions
|
@ -640,9 +640,8 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
||||||
# Load Bundler extensions to RubyGems, making sure to avoid redefinition
|
# Load Bundler extensions to RubyGems, making sure to avoid redefinition
|
||||||
# warnings in platform constants
|
# warnings in platform constants
|
||||||
|
|
||||||
def self.load_bundler_extensions
|
def self.load_bundler_extensions(version)
|
||||||
require "bundler/version"
|
return unless version <= "2.6.9"
|
||||||
return if Bundler::VERSION >= "2.6.9"
|
|
||||||
|
|
||||||
previous_platforms = {}
|
previous_platforms = {}
|
||||||
|
|
||||||
|
@ -1169,7 +1168,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
||||||
|
|
||||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path(path)
|
ENV["BUNDLE_GEMFILE"] ||= File.expand_path(path)
|
||||||
require_relative "rubygems/user_interaction"
|
require_relative "rubygems/user_interaction"
|
||||||
Gem.load_bundler_extensions
|
|
||||||
require "bundler"
|
require "bundler"
|
||||||
begin
|
begin
|
||||||
Gem::DefaultUserInteraction.use_ui(ui) do
|
Gem::DefaultUserInteraction.use_ui(ui) do
|
||||||
|
|
|
@ -64,8 +64,11 @@ module Kernel
|
||||||
rp
|
rp
|
||||||
end
|
end
|
||||||
|
|
||||||
Kernel.send(:gem, name, Gem::Requirement.default_prerelease) unless
|
next if resolved_path
|
||||||
resolved_path
|
|
||||||
|
Kernel.send(:gem, name, Gem::Requirement.default_prerelease)
|
||||||
|
|
||||||
|
Gem.load_bundler_extensions(Gem.loaded_specs[name].version) if name == "bundler"
|
||||||
|
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue