ruby-win32/lib/ruby/site_ruby/1.8/rubygems/uninstaller.rb
#
# 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.
#
: the spec of the gem to be uninstalled
list:: the list of all such gems

this method modifies the +list+ parameter.  Once it has
uninstalled a gem, it is removed from that list.
: the spec of the gem to be uninstalled list :: the list of all such gems this method modifies the + list + parameter . Once it has uninstalled a gem it is removed from that list .
def remove(spec, list)
    unless ok_to_remove? spec then
      raise Gem::DependencyRemovalException,
            "Uninstallation aborted due to dependent gem(s)"
    end
    raise Gem::FilePermissionError, spec.installation_path unless
      File.writable?(spec.installation_path)
    FileUtils.rm_rf spec.full_gem_path
    original_platform_name = [
      spec.name, spec.version, spec.original_platform].join '-'
    spec_dir = File.join spec.installation_path, 'specifications'
    gemspec = File.join spec_dir, "#{spec.full_name}.gemspec"
    unless File.exist? gemspec then
      gemspec = File.join spec_dir, "#{original_platform_name}.gemspec"
    end
    FileUtils.rm_rf gemspec
    cache_dir = File.join spec.installation_path, 'cache'
    gem = File.join cache_dir, "#{spec.full_name}.gem"
    unless File.exist? gem then
      gem = File.join cache_dir, "#{original_platform_name}.gem"
    end
    FileUtils.rm_rf gem
    Gem::DocManager.new(spec).uninstall_doc
    say "Successfully uninstalled #{spec.full_name}"
    list.delete spec
  end
def remove ( spec , list ) unless ok_to_remove? spec then raise Gem :: DependencyRemovalException , "Uninstallation aborted due to dependent gem(s)" end raise Gem :: FilePermissionError , spec . installation_path unless File . writable? ( spec . installation_path ) FileUtils . rm_rf spec . full_gem_path original_platform_name = [ spec . name , spec . version , spec . original_platform ] . join '-' spec_dir = File . join spec . installation_path , 'specifications' gemspec = File . join spec_dir , "#{spec.full_name}.gemspec" unless File . exist? gemspec then gemspec = File . join spec_dir , "#{original_platform_name}.gemspec" end FileUtils . rm_rf gemspec cache_dir = File . join spec . installation_path , 'cache' gem = File . join cache_dir , "#{spec.full_name}.gem" unless File . exist? gem then gem = File . join cache_dir , "#{original_platform_name}.gem" end FileUtils . rm_rf gem Gem :: DocManager . new ( spec ) . uninstall_doc say "Successfully uninstalled #{spec.full_name}" list . delete spec end
spec:: the spec of the gem to be uninstalled
list:: the list of all such gems
spec :: the spec of the gem to be uninstalled list :: the list of all such gems
spec
list