diff options
author | Hiroshi SHIBATA <[email protected]> | 2024-05-30 12:46:19 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2024-05-30 12:46:19 +0900 |
commit | ba8e6e77fd81f039f3bc85b2c1fb72aa93499b14 (patch) | |
tree | b59add7c0c0824968f5b0bf10eceef79b84e7cef /lib | |
parent | 974ed1408c516d1e8f992f0b304e2de6f8bd5c1f (diff) |
Revert "[rubygems/rubygems] Fix `gem pristine` sometimes failing to pristine user installed gems"
This reverts commit a3edc4abc574b04bcacfae2af188cce7d27bfcf1.
That commit caused test failure with Windows platform.
* https://github.com/ruby/ruby/actions/runs/9289018414/job/25561871390
* https://github.com/ruby/ruby/actions/runs/9289018425/job/25561873060
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems/basic_specification.rb | 13 | ||||
-rw-r--r-- | lib/rubygems/commands/pristine_command.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/specification_record.rb | 1 |
3 files changed, 4 insertions, 16 deletions
diff --git a/lib/rubygems/basic_specification.rb b/lib/rubygems/basic_specification.rb index f25756f92c..0380fceece 100644 --- a/lib/rubygems/basic_specification.rb +++ b/lib/rubygems/basic_specification.rb @@ -144,19 +144,6 @@ class Gem::BasicSpecification end ## - # Returns the full name of this Gem (see `Gem::BasicSpecification#full_name`). - # Information about where the gem is installed is also included if not - # installed in the default GEM_HOME. - - def full_name_with_location - if base_dir != Gem.dir - "#{full_name} in #{base_dir}" - else - full_name - end - end - - ## # Full paths in the gem to add to <code>$LOAD_PATH</code> when this gem is # activated. diff --git a/lib/rubygems/commands/pristine_command.rb b/lib/rubygems/commands/pristine_command.rb index 999c9fef0f..b272a15b6c 100644 --- a/lib/rubygems/commands/pristine_command.rb +++ b/lib/rubygems/commands/pristine_command.rb @@ -148,7 +148,7 @@ extensions will be restored. end unless spec.extensions.empty? || options[:extensions] || options[:only_executables] || options[:only_plugins] - say "Skipped #{spec.full_name_with_location}, it needs to compile an extension" + say "Skipped #{spec.full_name}, it needs to compile an extension" next end @@ -157,7 +157,7 @@ extensions will be restored. unless File.exist?(gem) || options[:only_executables] || options[:only_plugins] require_relative "../remote_fetcher" - say "Cached gem for #{spec.full_name_with_location} not found, attempting to fetch..." + say "Cached gem for #{spec.full_name} not found, attempting to fetch..." dep = Gem::Dependency.new spec.name, spec.version found, _ = Gem::SpecFetcher.fetcher.spec_for_dependency dep @@ -201,7 +201,7 @@ extensions will be restored. installer.install end - say "Restored #{spec.full_name_with_location}" + say "Restored #{spec.full_name}" end end end diff --git a/lib/rubygems/specification_record.rb b/lib/rubygems/specification_record.rb index 664d506265..dd6aa7eafa 100644 --- a/lib/rubygems/specification_record.rb +++ b/lib/rubygems/specification_record.rb @@ -68,6 +68,7 @@ module Gem installed_stubs = installed_stubs(pattern) installed_stubs.select! {|s| Gem::Platform.match_spec? s } if match_platform stubs = installed_stubs + Gem::Specification.default_stubs(pattern) + stubs = stubs.uniq(&:full_name) Gem::Specification._resort!(stubs) stubs end |