diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/rubygems/commands/sources_command.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/commands/specification_command.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/specification.rb | 1 | ||||
-rw-r--r-- | test/rubygems/gemutilities.rb | 10 | ||||
-rw-r--r-- | test/rubygems/test_gem_specification.rb | 14 | ||||
-rw-r--r-- | test/rubygems/test_package.rb | 4 |
7 files changed, 24 insertions, 17 deletions
@@ -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 diff --git a/lib/rubygems/commands/sources_command.rb b/lib/rubygems/commands/sources_command.rb index def9c01a3f..a0977f90dc 100644 --- a/lib/rubygems/commands/sources_command.rb +++ b/lib/rubygems/commands/sources_command.rb @@ -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 diff --git a/lib/rubygems/commands/specification_command.rb b/lib/rubygems/commands/specification_command.rb index 954b38ac37..1ab2ad9260 100644 --- a/lib/rubygems/commands/specification_command.rb +++ b/lib/rubygems/commands/specification_command.rb @@ -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 diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 35f2ffdffe..6338e73a1d 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -535,6 +535,7 @@ module Gem @new_platform = nil assign_defaults @loaded = false + @loaded_from = nil @@list << self yield self if block_given? diff --git a/test/rubygems/gemutilities.rb b/test/rubygems/gemutilities.rb index 460d8f2080..fb41210ac8 100644 --- a/test/rubygems/gemutilities.rb +++ b/test/rubygems/gemutilities.rb @@ -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] diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index 723e566a24..20eb12479f 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -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 diff --git a/test/rubygems/test_package.rb b/test/rubygems/test_package.rb index 641e3957d1..60ab76aa3b 100644 --- a/test/rubygems/test_package.rb +++ b/test/rubygems/test_package.rb @@ -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]) |