Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Gem::Uninstaller.new
() -> ::Gem::Uninstaller
new(gem, options = {})
lib/rubygems/uninstaller.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/rubygems/uninstaller.rb, line 47
def initialize(gem, options = {})
# TODO: document the valid options
@gem = gem
@version = options[:version] || Gem::Requirement.default
@install_dir = options[:install_dir]
@gem_home = File.realpath(@install_dir || Gem.dir)
@user_dir = File.exist?(Gem.user_dir) ? File.realpath(Gem.user_dir) : Gem.user_dir
@force_executables = options[:executables]
@force_all = options[:all]
@force_ignore = options[:ignore]
@bin_dir = options[:bin_dir]
@format_executable = options[:format_executable]
@abort_on_dependent = options[:abort_on_dependent]
# Indicate if development dependencies should be checked when
# uninstalling. (default: false)
#
@check_dev = options[:check_dev]
if options[:force]
@force_all = true
@force_ignore = true
end
# only add user directory if install_dir is not set
@user_install = false
@user_install = options[:user_install] unless @install_dir
# Optimization: populated during #uninstall
@default_specs_matching_uninstall_params = []
end
Constructs an uninstaller that will uninstall gem