mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 13:34:17 +02:00
Merge RubyGems 3.0.0.beta1.
* It drop to support < Ruby 2.2 * Cleanup deprecated methods and classes. * Mark obsoleted methods to deprecate. * and other enhancements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c5cb386eba
commit
8da8d4b043
101 changed files with 2105 additions and 1869 deletions
|
@ -129,11 +129,7 @@ that is a dependency of an existing gem. You can use the
|
|||
|
||||
specs.each do |spec|
|
||||
options[:version] = spec.version
|
||||
|
||||
begin
|
||||
Gem::Uninstaller.new(spec.name, options).uninstall
|
||||
rescue Gem::InstallError
|
||||
end
|
||||
uninstall_gem spec.name
|
||||
end
|
||||
|
||||
alert "Uninstalled all gems in #{options[:install_dir]}"
|
||||
|
@ -153,14 +149,27 @@ that is a dependency of an existing gem. You can use the
|
|||
deps = deplist.strongly_connected_components.flatten.reverse
|
||||
|
||||
deps.map(&:name).uniq.each do |gem_name|
|
||||
begin
|
||||
Gem::Uninstaller.new(gem_name, options).uninstall
|
||||
rescue Gem::GemNotInHomeException => e
|
||||
spec = e.spec
|
||||
alert("In order to remove #{spec.name}, please execute:\n" +
|
||||
"\tgem uninstall #{spec.name} --install-dir=#{spec.installation_path}")
|
||||
end
|
||||
uninstall_gem(gem_name)
|
||||
end
|
||||
end
|
||||
|
||||
def uninstall_gem(gem_name)
|
||||
uninstall(gem_name)
|
||||
rescue Gem::InstallError
|
||||
nil
|
||||
rescue Gem::GemNotInHomeException => e
|
||||
spec = e.spec
|
||||
alert("In order to remove #{spec.name}, please execute:\n" +
|
||||
"\tgem uninstall #{spec.name} --install-dir=#{spec.installation_path}")
|
||||
rescue Gem::UninstallError => e
|
||||
spec = e.spec
|
||||
alert_error("Error: unable to successfully uninstall '#{spec.name}' which is " +
|
||||
"located at '#{spec.full_gem_path}'. This is most likely because" +
|
||||
"the current user does not have the appropriate permissions")
|
||||
terminate_interaction 1
|
||||
end
|
||||
|
||||
def uninstall(gem_name)
|
||||
Gem::Uninstaller.new(gem_name, options).uninstall
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue