diff options
author | David RodrÃguez <[email protected]> | 2024-09-26 11:24:23 +0200 |
---|---|---|
committer | git <[email protected]> | 2024-09-30 05:07:58 +0000 |
commit | 82f250af45f676b3d0a22f00d01cd29bfaa2761c () | |
tree | 273fd392b4139a309d337a2f803e0873d3d53a76 /lib/rubygems/commands | |
parent | d4ac5c573b3b57dc4e62b684be297269defceba2 (diff) |
[rubygems/rubygems] `gem cleanup` no longer needs to reset paths
Since `Gem::Uninstaller` no longer changes paths either. https://.com/rubygems/rubygems/commit/427059d45f
-rw-r--r-- | lib/rubygems/commands/cleanup_command.rb | 12 |
1 files changed, 1 insertions, 11 deletions
@@ -38,8 +38,6 @@ class Gem::Commands::CleanupCommand < Gem::Command @default_gems = [] @full = nil @gems_to_cleanup = nil - @original_home = nil - @original_path = nil @primary_gems = nil end @@ -95,9 +93,6 @@ If no gems are named all gems in GEM_HOME are cleaned. end def clean_gems - @original_home = Gem.dir - @original_path = Gem.path - get_primary_gems get_candidate_gems get_gems_to_cleanup @@ -112,8 +107,6 @@ If no gems are named all gems in GEM_HOME are cleaned. deps.reverse_each do |spec| uninstall_dep spec end - - Gem::Specification.reset end def get_candidate_gems @@ -133,7 +126,7 @@ If no gems are named all gems in GEM_HOME are cleaned. default_gems, gems_to_cleanup = gems_to_cleanup.partition(&:default_gem?) - uninstall_from = options[:user_install] ? Gem.user_dir : @original_home gems_to_cleanup = gems_to_cleanup.select do |spec| spec.base_dir == uninstall_from @@ -181,8 +174,5 @@ If no gems are named all gems in GEM_HOME are cleaned. say "Unable to uninstall #{spec.full_name}:" say "\t#{e.class}: #{e.message}" end - ensure - # Restore path Gem::Uninstaller may have changed - Gem.use_paths @original_home, *@original_path end end |