def remove(spec, list)
if( ! ok_to_remove?(spec)) then
raise DependencyRemovalException.new(
"Uninstallation aborted due to dependent gem(s)")
end
raise Gem::FilePermissionError.new(spec.installation_path) unless
File.writable?(spec.installation_path)
FileUtils.rm_rf spec.full_gem_path
FileUtils.rm_rf File.join(
spec.installation_path,
'specifications',
"#{spec.full_name}.gemspec")
FileUtils.rm_rf File.join(
spec.installation_path,
'cache',
"#{spec.full_name}.gem")
DocManager.new(spec).uninstall_doc
say "Successfully uninstalled #{spec.name} version #{spec.version}"
list.delete(spec)
end