ruby-changes:26640
From: drbrain <ko1@a...>
Date: Fri, 4 Jan 2013 16:32:59 +0900 (JST)
Subject: [ruby-changes:26640] drbrain:r38691 (trunk): * lib/rubygems/doctor.rb: Process directories in order in case the
drbrain 2013-01-04 16:31:57 +0900 (Fri, 04 Jan 2013) New Revision: 38691 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38691 Log: * lib/rubygems/doctor.rb: Process directories in order in case the filesystem doesn't. [ruby-trunk - Bug #7618] Process specifications before other directories in case of bugs. * test/rubygems/test_gem_doctor.rb: Test for above. * lib/rubygems.rb: Updated version. * test/rubygems/test_require.rb: Fixed double require of benchmark.rb. RubyGems bug #420. * test/rubygems/test_gem_commands_check_command.rb: Fixed unused variable warnings. * test/rubygems/test_gem_commands_query_command.rb: ditto * test/rubygems/test_gem_installer.rb: ditto Modified files: trunk/ChangeLog trunk/lib/rubygems/doctor.rb trunk/lib/rubygems.rb trunk/test/rubygems/test_gem_commands_check_command.rb trunk/test/rubygems/test_gem_commands_query_command.rb trunk/test/rubygems/test_gem_doctor.rb trunk/test/rubygems/test_gem_installer.rb trunk/test/rubygems/test_require.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 38690) +++ ChangeLog (revision 38691) @@ -1,3 +1,21 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Jan 4 16:26:45 2013 Eric Hodel <drbrain@s...> + + * lib/rubygems/doctor.rb: Process directories in order in case the + filesystem doesn't. [ruby-trunk - Bug #7618] + + Process specifications before other directories in case of bugs. + * test/rubygems/test_gem_doctor.rb: Test for above. + + * lib/rubygems.rb: Updated version. + + * test/rubygems/test_require.rb: Fixed double require of + benchmark.rb. RubyGems bug #420. + + * test/rubygems/test_gem_commands_check_command.rb: Fixed unused + variable warnings. + * test/rubygems/test_gem_commands_query_command.rb: ditto + * test/rubygems/test_gem_installer.rb: ditto + Fri Jan 4 15:05:25 2013 Eric Hodel <drbrain@s...> * lib/rdoc/cross_reference.rb: Fixed matching of C#=== or #===. RDoc Index: lib/rubygems/doctor.rb =================================================================== --- lib/rubygems/doctor.rb (revision 38690) +++ lib/rubygems/doctor.rb (revision 38691) @@ -19,16 +19,17 @@ class Gem::Doctor https://github.com/ruby/ruby/blob/trunk/lib/rubygems/doctor.rb#L19 # Maps a gem subdirectory to the files that are expected to exist in the # subdirectory. - REPOSITORY_EXTENSION_MAP = { # :nodoc: - 'build_info' => '.info', - 'cache' => '.gem', - 'doc' => '', - 'gems' => '', - 'specifications' => '.gemspec' - } + REPOSITORY_EXTENSION_MAP = [ # :nodoc: + ['specifications', '.gemspec'], + ['build_info', '.info'], + ['cache', '.gem'], + ['doc', ''], + ['gems', ''], + ] raise 'Update REPOSITORY_EXTENSION_MAP' unless - Gem::REPOSITORY_SUBDIRECTORIES == REPOSITORY_EXTENSION_MAP.keys.sort + Gem::REPOSITORY_SUBDIRECTORIES.sort == + REPOSITORY_EXTENSION_MAP.map { |(k,_)| k }.sort ## # Creates a new Gem::Doctor that will clean up +gem_repository+. Only one @@ -97,7 +98,7 @@ class Gem::Doctor https://github.com/ruby/ruby/blob/trunk/lib/rubygems/doctor.rb#L98 def doctor_child sub_directory, extension # :nodoc: directory = @gem_repository + sub_directory - directory.each_child do |child| + directory.children.sort.each do |child| next unless child.exist? basename = child.basename(extension).to_s Index: lib/rubygems.rb =================================================================== --- lib/rubygems.rb (revision 38690) +++ lib/rubygems.rb (revision 38691) @@ -98,7 +98,7 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems.rb#L98 require 'rbconfig' module Gem - VERSION = '2.0.0.preview3' + VERSION = '2.0.0.preview3.1' end # Must be first since it unloads the prelude from 1.9.2 Index: test/rubygems/test_require.rb =================================================================== --- test/rubygems/test_require.rb (revision 38690) +++ test/rubygems/test_require.rb (revision 38691) @@ -57,9 +57,8 @@ class TestGemRequire < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_require.rb#L57 end def test_activate_via_require_respects_loaded_files + require 'benchmark' # stdlib save_loaded_features do - require 'benchmark' # stdlib - a1 = new_spec "a", "1", {"b" => ">= 1"}, "lib/a.rb" b1 = new_spec "b", "1", nil, "lib/benchmark.rb" b2 = new_spec "b", "2", nil, "lib/benchmark.rb" Index: test/rubygems/test_gem_doctor.rb =================================================================== --- test/rubygems/test_gem_doctor.rb (revision 38690) +++ test/rubygems/test_gem_doctor.rb (revision 38691) @@ -55,13 +55,13 @@ class TestGemDoctor < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_doctor.rb#L55 expected = <<-OUTPUT Checking #{@gemhome} +Removed file specifications/c-2.gemspec Removed directory gems/b-2 Removed directory gems/c-2 -Removed file specifications/c-2.gemspec OUTPUT - assert_equal expected.lines.sort, @ui.output.lines.sort + assert_equal expected, @ui.output assert_equal Gem.dir, @userhome assert_equal Gem.path, [@gemhome, @userhome] @@ -108,13 +108,13 @@ Removed file specifications/c-2.gemspec https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_doctor.rb#L108 expected = <<-OUTPUT Checking #{@gemhome} +Extra file specifications/c-2.gemspec Extra directory gems/b-2 Extra directory gems/c-2 -Extra file specifications/c-2.gemspec OUTPUT - assert_equal expected.lines.sort, @ui.output.lines.sort + assert_equal expected, @ui.output assert_equal Gem.dir, @userhome assert_equal Gem.path, [@gemhome, @userhome] Index: test/rubygems/test_gem_commands_query_command.rb =================================================================== --- test/rubygems/test_gem_commands_query_command.rb (revision 38690) +++ test/rubygems/test_gem_commands_query_command.rb (revision 38691) @@ -405,8 +405,6 @@ pl \(1\) https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_query_command.rb#L405 @cmd.execute end - str = @ui.output - expected = <<-EOF *** LOCAL GEMS *** Index: test/rubygems/test_gem_commands_check_command.rb =================================================================== --- test/rubygems/test_gem_commands_check_command.rb (revision 38690) +++ test/rubygems/test_gem_commands_check_command.rb (revision 38691) @@ -45,7 +45,7 @@ class TestGemCommandsCheckCommand < Gem: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_check_command.rb#L45 end def test_doctor - a = gem 'a' + gem 'a' b = gem 'b' FileUtils.rm b.spec_file Index: test/rubygems/test_gem_installer.rb =================================================================== --- test/rubygems/test_gem_installer.rb (revision 38690) +++ test/rubygems/test_gem_installer.rb (revision 38691) @@ -261,7 +261,7 @@ load Gem.bin_path('a', 'executable', ver https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L261 end def test_ensure_loadable_spec_security_policy - a, a_gem = util_gem 'a', 2 do |s| + _, a_gem = util_gem 'a', 2 do |s| s.add_dependency 'garbage ~> 5' end @@ -1015,8 +1015,6 @@ load Gem.bin_path('a', 'executable', ver https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L1015 installer = Gem::Installer.new gem, :install_dir => gemhome2 - gem_home = Gem.dir - build_rake_in do use_ui @ui do assert installer.pre_install_checks -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/