1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
drbrain 2013-01-04 07:31:57 +00:00
parent f3b24b5b7f
commit 2d08d23e9c
8 changed files with 36 additions and 22 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -405,8 +405,6 @@ pl \(1\)
@cmd.execute
end
str = @ui.output
expected = <<-EOF
*** LOCAL GEMS ***

View file

@ -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]

View file

@ -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

View file

@ -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"