Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::Commands::CleanupCommand#uninstall_dep
uninstall_dep(spec)
lib/rubygems/commands/cleanup_command.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/commands/cleanup_command.rb, line 151
def uninstall_dep(spec)
return unless @full.ok_to_remove?(spec.full_name, options[:check_dev])
if options[:dryrun]
say "Dry Run Mode: Would uninstall #{spec.full_name}"
return
end
say "Attempting to uninstall #{spec.full_name}"
uninstall_options = {
executables: false,
version: "= #{spec.version}",
}
uninstall_options[:user_install] = Gem.user_dir == spec.base_dir
uninstaller = Gem::Uninstaller.new spec.name, uninstall_options
begin
uninstaller.uninstall
rescue Gem::DependencyRemovalException, Gem::InstallError,
Gem::GemNotInHomeException, Gem::FilePermissionError => e
say "Unable to uninstall #{spec.full_name}:"
say "\t#{e.class}: #{e.message}"
end
end
No documentation available