[前][次][番号順一覧][スレッド一覧]

ruby-changes:26060

From: drbrain <ko1@a...>
Date: Sat, 1 Dec 2012 18:52:49 +0900 (JST)
Subject: [ruby-changes:26060] drbrain:r38117 (trunk): * lib/rubygems/commands/cleanup_command.rb: Fix cleanup command for

drbrain	2012-12-01 18:52:39 +0900 (Sat, 01 Dec 2012)

  New Revision: 38117

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38117

  Log:
    * lib/rubygems/commands/cleanup_command.rb:  Fix cleanup command for
      multiple gems.  [ruby-trunk - #7481] by Kouhei Sutou
    * test/rubygems/test_gem_commands_cleanup_command.rb:  Test for above.
    * lib/rubygems.rb:  Autoload Gem::Source to prevent test failures

  Modified files:
    trunk/ChangeLog
    trunk/lib/rubygems/commands/cleanup_command.rb
    trunk/lib/rubygems.rb
    trunk/test/rubygems/test_gem_commands_cleanup_command.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38116)
+++ ChangeLog	(revision 38117)
@@ -1,3 +1,10 @@
+Sat Dec  1 18:52:22 2012  Eric Hodel  <drbrain@s...>
+
+	* lib/rubygems/commands/cleanup_command.rb:  Fix cleanup command for
+	  multiple gems.  [ruby-trunk - #7481] by Kouhei Sutou
+	* test/rubygems/test_gem_commands_cleanup_command.rb:  Test for above.
+	* lib/rubygems.rb:  Autoload Gem::Source to prevent test failures
+
 Sat Dec  1 18:17:00 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* complex.c (Init_Complex), time.c (Init_Time): make marshal methods
Index: lib/rubygems/commands/cleanup_command.rb
===================================================================
--- lib/rubygems/commands/cleanup_command.rb	(revision 38116)
+++ lib/rubygems/commands/cleanup_command.rb	(revision 38117)
@@ -66,6 +66,7 @@
 
     deps = deplist.strongly_connected_components.flatten.reverse
 
+    original_home = Gem.dir
     original_path = Gem.path
 
     deps.each do |spec|
@@ -97,7 +98,7 @@
       end
 
       # Restore path Gem::Uninstaller may have change
-      Gem.use_paths(*original_path)
+      Gem.use_paths(original_home, *original_path)
     end
 
     say "Clean Up Complete"
Index: lib/rubygems.rb
===================================================================
--- lib/rubygems.rb	(revision 38116)
+++ lib/rubygems.rb	(revision 38117)
@@ -1042,18 +1042,19 @@
 
   MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/"
 
-  autoload :Version,         'rubygems/version'
-  autoload :Requirement,     'rubygems/requirement'
-  autoload :Dependency,      'rubygems/dependency'
-  autoload :DependencyList,  'rubygems/dependency_list'
-  autoload :SourceList,      'rubygems/source_list'
-  autoload :SpecFetcher,     'rubygems/spec_fetcher'
-  autoload :Specification,   'rubygems/specification'
-  autoload :PathSupport,     'rubygems/path_support'
-  autoload :Platform,        'rubygems/platform'
-  autoload :ConfigFile,      'rubygems/config_file'
+  autoload :ConfigFile,         'rubygems/config_file'
+  autoload :Dependency,         'rubygems/dependency'
+  autoload :DependencyList,     'rubygems/dependency_list'
   autoload :DependencyResolver, 'rubygems/dependency_resolver'
-  autoload :RequestSet,      'rubygems/request_set'
+  autoload :PathSupport,        'rubygems/path_support'
+  autoload :Platform,           'rubygems/platform'
+  autoload :RequestSet,         'rubygems/request_set'
+  autoload :Requirement,        'rubygems/requirement'
+  autoload :SourceList,         'rubygems/source_list'
+  autoload :SpecFetcher,        'rubygems/spec_fetcher'
+  autoload :Specification,      'rubygems/specification'
+  autoload :Version,            'rubygems/version'
+  autoload :Source,             'rubygems/source'
 
   require "rubygems/specification"
 end
Index: test/rubygems/test_gem_commands_cleanup_command.rb
===================================================================
--- test/rubygems/test_gem_commands_cleanup_command.rb	(revision 38116)
+++ test/rubygems/test_gem_commands_cleanup_command.rb	(revision 38117)
@@ -24,6 +24,12 @@
   end
 
   def test_execute_all
+    gemhome2 = File.join @tempdir, 'gemhome2'
+
+    Gem.ensure_gem_subdirectories gemhome2
+
+    Gem.use_paths @gemhome, gemhome2
+
     @b_1 = quick_spec 'b', 1
     @b_2 = quick_spec 'b', 2
 
@@ -34,6 +40,9 @@
 
     @cmd.execute
 
+    assert_equal @gemhome, Gem.dir, 'GEM_HOME'
+    assert_equal [@gemhome, gemhome2], Gem.path.sort, 'GEM_PATH'
+
     refute_path_exists @a_1.gem_dir
     refute_path_exists @b_1.gem_dir
   end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]