method
uninstall_dep
v2_6_3 -
Show latest stable
-
0 notes -
Class: CleanupCommand
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
uninstall_dep(spec)
public
Hide source
# File lib/rubygems/commands/cleanup_command.rb, line 154 def uninstall_dep(spec) return unless @full.ok_to_remove?(spec.full_name, options[:check_dev]) if options[:dryrun] say "Dry Run Mode: Would uninstall #{spec.full_name}" return end say "Attempting to uninstall #{spec.full_name}" uninstall_options = { :executables => false, :version => "= #{spec.version}", } uninstall_options[:user_install] = Gem.user_dir == spec.base_dir uninstaller = Gem::Uninstaller.new spec.name, uninstall_options begin uninstaller.uninstall rescue Gem::DependencyRemovalException, Gem::InstallError, Gem::GemNotInHomeException, Gem::FilePermissionError => e say "Unable to uninstall #{spec.full_name}:" say "\t#{e.class}: #{e.message}" end ensure # Restore path Gem::Uninstaller may have changed Gem.use_paths @original_home, *@original_path end