Class: Gem::Uninstaller

Class | Gem::Uninstaller
In: | lib/rubygems/uninstaller.rb
Parent: | Object

An Uninstaller.

The uninstaller fires pre and post uninstall hooks. Hooks can be added either through a rubygems_plugin.rb file in an installed gem or via a rubygems/defaults/#{RUBY_ENGINE}.rb or rubygems/defaults/operating_system.rb file. See Gem.pre_uninstall and Gem.post_uninstall for details.

### Methods

ask_if_ok dependencies_ok? new path_ok? remove remove_all remove_executables uninstall uninstall_gem

### Included Modules

Gem::UserInteraction

### Attributes

bin_dir | [R] | The directory a gem‘s executables will be installed into
gem_home | [R] | The gem repository the gem will be installed into
spec | [R] | The Gem::Specification for the gem being uninstalled, only set during uninstall_gem

### Public Class methods

new(gem, options = {})

Constructs an uninstaller that will uninstall `gem`

### Public Instance methods

ask_if_ok(spec)
dependencies_ok?(spec)
path_ok?(gem_dir, spec)

Is `spec` in `gem_dir`?

remove(spec, list)

spec: | the spec of the gem to be uninstalled
list: | the list of all such gems

Warning: this method modifies the `list` parameter. Once it has uninstalled a gem, it is removed from that list.

remove_all(list)

Removes all gems in `list`.

NOTE: removes uninstalled gems from `list`.

remove_executables(spec)

Removes installed executables and batch files (windows only) for `gemspec`.

uninstall()

Performs the uninstall of the gem. This removes the spec, the Gem directory, and the cached .gem file.

uninstall_gem(spec, specs)

Uninstalls gem `spec`

[Validate]