From 2d08d23e9cdd13616d8819aa7a582d3a5838636f Mon Sep 17 00:00:00 2001 From: drbrain Date: Fri, 4 Jan 2013 07:31:57 +0000 Subject: * 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems.rb | 2 +- lib/rubygems/doctor.rb | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/rubygems.rb b/lib/rubygems.rb index 77d1650056..3722e10780 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -98,7 +98,7 @@ 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 diff --git a/lib/rubygems/doctor.rb b/lib/rubygems/doctor.rb index 198c758b00..4fb399e24c 100644 --- a/lib/rubygems/doctor.rb +++ b/lib/rubygems/doctor.rb @@ -19,16 +19,17 @@ class Gem::Doctor # 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 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 -- cgit v1.2.1