* 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


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2012-12-01 09:52:39 +00:00
Родитель 018d8261ce
Коммит 4090ec1017
4 изменённых файлов: 30 добавлений и 12 удалений

Просмотреть файл

@ -1,3 +1,10 @@
Sat Dec 1 18:52:22 2012 Eric Hodel <drbrain@segment7.net>
* 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@ruby-lang.org>
* complex.c (Init_Complex), time.c (Init_Time): make marshal methods

Просмотреть файл

@ -1042,18 +1042,19 @@ module Gem
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

Просмотреть файл

@ -66,6 +66,7 @@ are not removed.
deps = deplist.strongly_connected_components.flatten.reverse
original_home = Gem.dir
original_path = Gem.path
deps.each do |spec|
@ -97,7 +98,7 @@ are not removed.
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"

Просмотреть файл

@ -24,6 +24,12 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
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 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
@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