summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-04 07:31:57 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-04 07:31:57 +0000
commit2d08d23e9cdd13616d8819aa7a582d3a5838636f (patch)
tree0a7328679e178506827144d50fccede11dd6264f
parentf3b24b5b7f88ecfdefcd898f01ea1cfb2ee418f3 (diff)
* 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
-rw-r--r--ChangeLog18
-rw-r--r--lib/rubygems.rb2
-rw-r--r--lib/rubygems/doctor.rb19
-rw-r--r--test/rubygems/test_gem_commands_check_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_query_command.rb2
-rw-r--r--test/rubygems/test_gem_doctor.rb8
-rw-r--r--test/rubygems/test_gem_installer.rb4
-rw-r--r--test/rubygems/test_require.rb3
8 files changed, 36 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 73365742dd..eadfdcc80f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+Fri Jan 4 16:26:45 2013 Eric Hodel <drbrain@segment7.net>
+
+ * 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@segment7.net>
* lib/rdoc/cross_reference.rb: Fixed matching of C#=== or #===. RDoc
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
diff --git a/test/rubygems/test_gem_commands_check_command.rb b/test/rubygems/test_gem_commands_check_command.rb
index b28748623e..67db6a3206 100644
--- a/test/rubygems/test_gem_commands_check_command.rb
+++ b/test/rubygems/test_gem_commands_check_command.rb
@@ -45,7 +45,7 @@ class TestGemCommandsCheckCommand < Gem::TestCase
end
def test_doctor
- a = gem 'a'
+ gem 'a'
b = gem 'b'
FileUtils.rm b.spec_file
diff --git a/test/rubygems/test_gem_commands_query_command.rb b/test/rubygems/test_gem_commands_query_command.rb
index 09e6efcd07..c14fbc0099 100644
--- a/test/rubygems/test_gem_commands_query_command.rb
+++ b/test/rubygems/test_gem_commands_query_command.rb
@@ -405,8 +405,6 @@ pl \(1\)
@cmd.execute
end
- str = @ui.output
-
expected = <<-EOF
*** LOCAL GEMS ***
diff --git a/test/rubygems/test_gem_doctor.rb b/test/rubygems/test_gem_doctor.rb
index 2fa68b2448..0dce8c2eac 100644
--- a/test/rubygems/test_gem_doctor.rb
+++ b/test/rubygems/test_gem_doctor.rb
@@ -55,13 +55,13 @@ class TestGemDoctor < Gem::TestCase
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
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]
diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb
index 98f1878dfb..c531c60b29 100644
--- a/test/rubygems/test_gem_installer.rb
+++ b/test/rubygems/test_gem_installer.rb
@@ -261,7 +261,7 @@ load Gem.bin_path('a', 'executable', version)
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', version)
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
diff --git a/test/rubygems/test_require.rb b/test/rubygems/test_require.rb
index 9484901581..7553822319 100644
--- a/test/rubygems/test_require.rb
+++ b/test/rubygems/test_require.rb
@@ -57,9 +57,8 @@ class TestGemRequire < Gem::TestCase
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"