summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-23 22:58:06 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-23 22:58:06 +0000
commitcede48fd403ddb0631fafc49392350bb889c38ab (patch)
tree8f081045945e355b3f5992eb87b20e02d9eefb35 /lib
parentd1919daa4282b29d22240c7fee977afbcbc7ea58 (diff)
* lib/rubygems: Update to RubyGems 1.8.9. Fixes uninstalling multiple
gems and gem cleanup. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems.rb6
-rw-r--r--lib/rubygems/commands/uninstall_command.rb4
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 8a7bfea551..f469deb9a8 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -118,7 +118,7 @@ require "rubygems/deprecate"
# -The RubyGems Team
module Gem
- VERSION = '1.8.8'
+ VERSION = '1.8.9'
##
# Raised when RubyGems is unable to load or activate a gem. Contains the
@@ -1027,7 +1027,9 @@ module Gem
# Use the +home+ and +paths+ values for Gem.dir and Gem.path. Used mainly
# by the unit tests to provide environment isolation.
- def self.use_paths(home, paths=[])
+ def self.use_paths(home, *paths)
+ paths = nil if paths == [nil]
+ paths = paths.first if Array === Array(paths).first
self.paths = { "GEM_HOME" => home, "GEM_PATH" => paths }
# TODO: self.paths = home, paths
end
diff --git a/lib/rubygems/commands/uninstall_command.rb b/lib/rubygems/commands/uninstall_command.rb
index 61e55f196e..67a3d38bba 100644
--- a/lib/rubygems/commands/uninstall_command.rb
+++ b/lib/rubygems/commands/uninstall_command.rb
@@ -73,6 +73,8 @@ class Gem::Commands::UninstallCommand < Gem::Command
end
def execute
+ original_path = Gem.path
+
get_all_gem_names.each do |gem_name|
begin
Gem::Uninstaller.new(gem_name, options).uninstall
@@ -80,6 +82,8 @@ class Gem::Commands::UninstallCommand < Gem::Command
spec = e.spec
alert("In order to remove #{spec.name}, please execute:\n" \
"\tgem uninstall #{spec.name} --install-dir=#{spec.installation_path}")
+ ensure
+ Gem.use_paths(*original_path)
end
end
end