git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2007-12-23 06:34:28 +00:00
Родитель 1777eaa523
Коммит ed9690bba5
7 изменённых файлов: 24 добавлений и 17 удалений

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

@ -1,3 +1,7 @@
Sun Dec 23 15:28:37 2007 Eric Hodel <drbrain@segment7.net>
* lib/rubygems, test/rubygems: Fix new 1.9 warnings.
Sun Dec 23 14:43:10 2007 Eric Hodel <drbrain@segment7.net>
* gem_prelude.rb: Use require to load rubygems.rb so the correct path

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

@ -92,8 +92,8 @@ class Gem::Commands::SourcesCommand < Gem::Command
say "*** CURRENT SOURCES ***"
say
Gem.sources.each do |source_uri|
say source_uri
Gem.sources.each do |source|
say source
end
end
end

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

@ -58,12 +58,12 @@ class Gem::Commands::SpecificationCommand < Gem::Command
terminate_interaction 1
end
output = lambda { |spec| say spec.to_yaml; say "\n" }
output = lambda { |s| say s.to_yaml; say "\n" }
if options[:all] then
specs.each(&output)
else
spec = specs.sort_by { |spec| spec.version }.last
spec = specs.sort_by { |s| s.version }.last
output[spec]
end
end

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

@ -535,6 +535,7 @@ module Gem
@new_platform = nil
assign_defaults
@loaded = false
@loaded_from = nil
@@list << self
yield self if block_given?

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

@ -205,15 +205,15 @@ class RubyGemTestCase < Test::Unit::TestCase
end
def util_make_gems
spec = proc do |s|
init = proc do |s|
s.files = %w[lib/code.rb]
s.require_paths = %w[lib]
end
@a1 = quick_gem('a', '1', &spec)
@a2 = quick_gem('a', '2', &spec)
@b2 = quick_gem('b', '2', &spec)
@c1_2 = quick_gem('c', '1.2', &spec)
@a1 = quick_gem('a', '1', &init)
@a2 = quick_gem('a', '2', &init)
@b2 = quick_gem('b', '2', &init)
@c1_2 = quick_gem('c', '1.2', &init)
@pl1 = quick_gem 'pl', '1' do |s| # l for legacy
s.files = %w[lib/code.rb]
s.require_paths = %w[lib]

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

@ -120,13 +120,13 @@ end
end
def test_self_load_legacy_ruby
s = eval LEGACY_RUBY_SPEC
assert_equal 'keyedlist', s.name
assert_equal '0.4.0', s.version.to_s
assert_equal true, s.has_rdoc?
assert_equal Gem::Specification::TODAY, s.date
assert s.required_ruby_version.satisfied_by?(Gem::Version.new('1'))
assert_equal false, s.has_unit_tests?
spec = eval LEGACY_RUBY_SPEC
assert_equal 'keyedlist', spec.name
assert_equal '0.4.0', spec.version.to_s
assert_equal true, spec.has_rdoc?
assert_equal Gem::Specification::TODAY, spec.date
assert spec.required_ruby_version.satisfied_by?(Gem::Version.new('1'))
assert_equal false, spec.has_unit_tests?
end
def test_self_load_legacy_yaml

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

@ -488,15 +488,17 @@ class TestTarWriter < TarTestCase
self.string.send(meth, *a)
end
end
os = Gem::Package::TarWriter.new dummyos
content1 = ('a'..'z').to_a.join("") # 26
content2 = ('aa'..'zz').to_a.join("") # 1352
Gem::Package::TarWriter.new(dummyos) do |os|
os.add_file("lib/foo/bar", 0644) {|f| f.write "a" * 10 }
os.add_file("lib/bar/baz", 0644) {|f| f.write content1 }
os.add_file("lib/bar/baz", 0644) {|f| f.write content2 }
os.add_file("lib/bar/baz", 0644) {|f| }
end
assert_headers_equal(tar_file_header("lib/foo/bar", "", 0644, 10),
dummyos[0,512])
assert_equal("a" * 10 + "\0" * 502, dummyos[512,512])