summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-23 06:34:28 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-23 06:34:28 +0000
commited9690bba519982b694d03cdce536a3c5bcaf774 (patch)
treeefd3fbae27fdf79f631abccfe2af6c5e64a6f190
parent1777eaa523e48fa8023b0ab23e83f2c3187e62c5 (diff)
Fix warnings in RubyGems
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--lib/rubygems/commands/sources_command.rb4
-rw-r--r--lib/rubygems/commands/specification_command.rb4
-rw-r--r--lib/rubygems/specification.rb1
-rw-r--r--test/rubygems/gemutilities.rb10
-rw-r--r--test/rubygems/test_gem_specification.rb14
-rw-r--r--test/rubygems/test_package.rb4
7 files changed, 24 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 662e9862be..94214ea5b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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])