Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Gem::Uninstaller.new
new(gem, options = {})
lib/rubygems/uninstaller.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/rubygems/uninstaller.rb, line 48
def initialize(gem, options = {})
# TODO: document the valid options
@gem = gem
@version = options[:version] || Gem::Requirement.default
@gem_home = File.realpath(options[:install_dir] || Gem.dir)
@plugins_dir = Gem.plugindir(@gem_home)
@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 options[:install_dir]
# Optimization: populated during #uninstall
@default_specs_matching_uninstall_params = []
end
Constructs an uninstaller that will uninstall gem