diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-07-13 12:56:36 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-07-13 14:11:55 +0900 |
commit | 437a5ae9d6d60bd1972641167a98204007bd1c0b (patch) | |
tree | 79b9ea49442fe896dbd8ef59a8622ea010fb3fb7 /lib/rubygems | |
parent | e3a988a29c2cfa4a7e2e045d82989a7342955be8 (diff) | |
download | ruby-437a5ae9d6d60bd1972641167a98204007bd1c0b.tar.gz |
Merge RubyGems and Bundler master
Diffstat (limited to 'lib/rubygems')
-rw-r--r-- | lib/rubygems/gem_runner.rb | 10 | ||||
-rw-r--r-- | lib/rubygems/installer.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/platform.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/specification.rb | 15 |
4 files changed, 23 insertions, 8 deletions
diff --git a/lib/rubygems/gem_runner.rb b/lib/rubygems/gem_runner.rb index 89b23b26aa..b3f925773b 100644 --- a/lib/rubygems/gem_runner.rb +++ b/lib/rubygems/gem_runner.rb @@ -10,11 +10,6 @@ require_relative 'command_manager' require_relative 'deprecate' ## -# Load additional plugins from $LOAD_PATH - -Gem.load_env_plugins rescue nil - -## # Run an instance of the gem program. # # Gem::GemRunner is only intended for internal use by RubyGems itself. It @@ -37,6 +32,9 @@ class Gem::GemRunner do_configuration args + Gem.load_env_plugins rescue nil + Gem.load_plugins + cmd = @command_manager_class.instance cmd.command_names.each do |command_name| @@ -75,5 +73,3 @@ class Gem::GemRunner Gem::Command.extra_args = Gem.configuration[:gem] end end - -Gem.load_plugins diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index 0613399890..7484145467 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -340,7 +340,7 @@ class Gem::Installer say spec.post_install_message if options[:post_install_message] && !spec.post_install_message.nil? - Gem::Specification.reset + Gem::Specification.add_spec(spec) run_post_install_hooks diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb index f48f4bdc76..8fcabf164d 100644 --- a/lib/rubygems/platform.rb +++ b/lib/rubygems/platform.rb @@ -159,6 +159,10 @@ class Gem::Platform def ===(other) return nil unless Gem::Platform === other + # universal-mingw32 matches x64-mingw-ucrt + return true if (@cpu == 'universal' or other.cpu == 'universal') and + @os.start_with?('mingw') and other.os.start_with?('mingw') + # cpu ([nil,'universal'].include?(@cpu) or [nil, 'universal'].include?(other.cpu) or @cpu == other.cpu or (@cpu == 'arm' and other.cpu.start_with?("arm"))) and diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 56db0945eb..f6704cbc17 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -883,6 +883,21 @@ class Gem::Specification < Gem::BasicSpecification end ## + # Adds +spec+ to the known specifications, keeping the collection + # properly sorted. + + def self.add_spec(spec) + return if _all.include? spec + + _all << spec + stubs << spec + (@@stubs_by_name[spec.name] ||= []) << spec + + _resort!(@@stubs_by_name[spec.name]) + _resort!(stubs) + end + + ## # Returns all specifications. This method is discouraged from use. # You probably want to use one of the Enumerable methods instead. |