ruby-changes:20992
From: drbrain <ko1@a...>
Date: Wed, 24 Aug 2011 08:04:49 +0900 (JST)
Subject: [ruby-changes:20992] drbrain:r33041 (ruby_1_9_3): * backport r32981 and r32982 from trunk.
drbrain 2011-08-24 08:04:38 +0900 (Wed, 24 Aug 2011) New Revision: 33041 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33041 Log: * backport r32981 and r32982 from trunk. * ext/dl: Add documentation. Patch by Vincent Batts. [Ruby 1.9 - Bug #5192] * ext/.document (fiddle): Remove duplicate entry * ext/fiddle: Complete documentation of Fiddle. Patch by Vincent Batts. [#5192] Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/NEWS branches/ruby_1_9_3/lib/rubygems/commands/uninstall_command.rb branches/ruby_1_9_3/lib/rubygems.rb branches/ruby_1_9_3/test/rubygems/test_gem_commands_uninstall_command.rb Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 33040) +++ ruby_1_9_3/ChangeLog (revision 33041) @@ -1,3 +1,10 @@ +Wed Aug 24 07:57:43 2011 Eric Hodel <drbrain@s...> + + * backport r33040 from trunk. + + * lib/rubygems: Update to RubyGems 1.8.9. Fixes uninstalling multiple + gems and gem cleanup. + Wed Aug 24 06:45:20 2011 Ryan Davis <ryand-ruby@z...> * backport r33036 from trunk. Index: ruby_1_9_3/lib/rubygems/commands/uninstall_command.rb =================================================================== --- ruby_1_9_3/lib/rubygems/commands/uninstall_command.rb (revision 33040) +++ ruby_1_9_3/lib/rubygems/commands/uninstall_command.rb (revision 33041) @@ -73,6 +73,8 @@ 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 @@ 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 Index: ruby_1_9_3/lib/rubygems.rb =================================================================== --- ruby_1_9_3/lib/rubygems.rb (revision 33040) +++ ruby_1_9_3/lib/rubygems.rb (revision 33041) @@ -118,7 +118,7 @@ # -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 @@ # 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 Index: ruby_1_9_3/NEWS =================================================================== --- ruby_1_9_3/NEWS (revision 33040) +++ ruby_1_9_3/NEWS (revision 33041) @@ -265,7 +265,7 @@ * Support Ruby native encoding mechanism and iconv dependency is dropped. * RubyGems - * RubyGems has been upgraded to version 1.8.6.1. For full release notes see + * RubyGems has been upgraded to version 1.8.9. For full release notes see http://rubygems.rubyforge.org/rubygems-update/History_txt.html * stringio Index: ruby_1_9_3/test/rubygems/test_gem_commands_uninstall_command.rb =================================================================== --- ruby_1_9_3/test/rubygems/test_gem_commands_uninstall_command.rb (revision 33040) +++ ruby_1_9_3/test/rubygems/test_gem_commands_uninstall_command.rb (revision 33041) @@ -17,6 +17,34 @@ @executable = File.join(@gemhome, 'bin', 'executable') end + def test_execute_mulitple + @other = quick_gem 'c' + util_make_exec @other + util_build_gem @other + + @other_installer = util_installer @other, @gemhome + + ui = Gem::MockGemUi.new + util_setup_gem ui + + build_rake_in do + use_ui ui do + @other_installer.install + end + end + + @cmd.options[:args] = [@spec.name, @other.name] + + use_ui @ui do + @cmd.execute + end + + output = @ui.output.split "\n" + + assert_includes output, "Successfully uninstalled #{@spec.full_name}" + assert_includes output, "Successfully uninstalled #{@other.full_name}" + end + def test_execute_removes_executable ui = Gem::MockGemUi.new util_setup_gem ui @@ -91,5 +119,6 @@ output = @ui.output assert_match(/Successfully uninstalled/, output) end + end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/