From 90dfc8f99e774e5ed71b4ed09a14bb75febca936 Mon Sep 17 00:00:00 2001 From: drbrain Date: Mon, 3 Oct 2011 22:15:47 +0000 Subject: [PATCH] * lib/rubygems: Update to RubyGems 1.8.11. Move Deprecate into the Gem namespace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 ++ lib/rubygems.rb | 6 +- lib/rubygems/commands/dependency_command.rb | 2 +- lib/rubygems/commands/query_command.rb | 2 +- lib/rubygems/dependency.rb | 2 +- lib/rubygems/dependency_list.rb | 2 +- lib/rubygems/deprecate.rb | 92 +++++++++++---------- lib/rubygems/gem_path_searcher.rb | 2 +- lib/rubygems/indexer.rb | 2 +- lib/rubygems/platform.rb | 2 +- lib/rubygems/server.rb | 2 +- lib/rubygems/source_index.rb | 12 +-- lib/rubygems/specification.rb | 4 +- test/rubygems/test_gem.rb | 6 +- test/rubygems/test_gem_dependency.rb | 6 +- test/rubygems/test_gem_dependency_list.rb | 2 +- test/rubygems/test_gem_gem_path_searcher.rb | 18 ++-- test/rubygems/test_gem_platform.rb | 2 +- test/rubygems/test_gem_server.rb | 12 +-- test/rubygems/test_gem_source_index.rb | 28 +++---- test/rubygems/test_gem_specification.rb | 8 +- 21 files changed, 112 insertions(+), 105 deletions(-) diff --git a/ChangeLog b/ChangeLog index 894186f8bc..43c3ecd56c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Oct 4 07:15:17 2011 Eric Hodel + + * lib/rubygems: Update to RubyGems 1.8.11. Move Deprecate into the + Gem namespace. + Tue Oct 4 06:43:47 2011 Aaron Patterson * ext/psych/lib/psych.rb: update psych version. diff --git a/lib/rubygems.rb b/lib/rubygems.rb index 632b5e0a60..c8f969224c 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -118,7 +118,7 @@ require "rubygems/deprecate" # -The RubyGems Team module Gem - VERSION = '1.8.10' + VERSION = '1.8.11' ## # Raised when RubyGems is unable to load or activate a gem. Contains the @@ -956,7 +956,7 @@ module Gem # Returns the Gem::SourceIndex of specifications that are in the Gem.path def self.source_index - @@source_index ||= Deprecate.skip_during do + @@source_index ||= Gem::Deprecate.skip_during do SourceIndex.new Gem::Specification.dirs end end @@ -1262,7 +1262,7 @@ require 'rubygems/custom_require' module Gem class << self - extend Deprecate + extend Gem::Deprecate deprecate :activate_dep, "Specification#activate", 2011, 6 deprecate :activate_spec, "Specification#activate", 2011, 6 deprecate :cache, "Gem::source_index", 2011, 8 diff --git a/lib/rubygems/commands/dependency_command.rb b/lib/rubygems/commands/dependency_command.rb index f493d40289..67cbbc1d5e 100644 --- a/lib/rubygems/commands/dependency_command.rb +++ b/lib/rubygems/commands/dependency_command.rb @@ -59,7 +59,7 @@ class Gem::Commands::DependencyCommand < Gem::Command end # TODO: deprecate for real damnit - dependency = Deprecate.skip_during { + dependency = Gem::Deprecate.skip_during { Gem::Dependency.new pattern, options[:version] } dependency.prerelease = options[:prerelease] diff --git a/lib/rubygems/commands/query_command.rb b/lib/rubygems/commands/query_command.rb index 1033b83447..725da8787b 100644 --- a/lib/rubygems/commands/query_command.rb +++ b/lib/rubygems/commands/query_command.rb @@ -79,7 +79,7 @@ class Gem::Commands::QueryCommand < Gem::Command req = Gem::Requirement.default # TODO: deprecate for real - dep = Deprecate.skip_during { Gem::Dependency.new name, req } + dep = Gem::Deprecate.skip_during { Gem::Dependency.new name, req } if local? then if prerelease and not both? then diff --git a/lib/rubygems/dependency.rb b/lib/rubygems/dependency.rb index 1e1663678e..0caf65c6c4 100644 --- a/lib/rubygems/dependency.rb +++ b/lib/rubygems/dependency.rb @@ -35,7 +35,7 @@ class Gem::Dependency if Regexp === name then msg = ["NOTE: Dependency.new w/ a regexp is deprecated.", "Dependency.new called from #{Gem.location_of_caller.join(":")}"] - warn msg.join("\n") unless Deprecate.skip + warn msg.join("\n") unless Gem::Deprecate.skip end type = Symbol === requirements.last ? requirements.pop : :runtime diff --git a/lib/rubygems/dependency_list.rb b/lib/rubygems/dependency_list.rb index d54b659b66..9f1da9166c 100644 --- a/lib/rubygems/dependency_list.rb +++ b/lib/rubygems/dependency_list.rb @@ -246,7 +246,7 @@ end class Gem::DependencyList class << self - extend Deprecate + extend Gem::Deprecate deprecate :from_source_index, "from_specs", 2011, 11 end end diff --git a/lib/rubygems/deprecate.rb b/lib/rubygems/deprecate.rb index 4827a05ad4..a78208ec24 100644 --- a/lib/rubygems/deprecate.rb +++ b/lib/rubygems/deprecate.rb @@ -11,58 +11,60 @@ # # ... # end # -# extend Deprecate +# extend Gem::Deprecate # deprecate :instance_method, "X.z", 2011, 4 # # class << self -# extend Deprecate +# extend Gem::Deprecate # deprecate :klass_method, :none, 2011, 4 # end # end -module Deprecate +module Gem + module Deprecate - def self.skip # :nodoc: - @skip ||= false + def self.skip # :nodoc: + @skip ||= false + end + + def self.skip= v # :nodoc: + @skip = v + end + + ## + # Temporarily turn off warnings. Intended for tests only. + + def skip_during + Gem::Deprecate.skip, original = true, Gem::Deprecate.skip + yield + ensure + Gem::Deprecate.skip = original + end + + ## + # Simple deprecation method that deprecates +name+ by wrapping it up + # in a dummy method. It warns on each call to the dummy method + # telling the user of +repl+ (unless +repl+ is :none) and the + # year/month that it is planned to go away. + + def deprecate name, repl, year, month + class_eval { + old = "_deprecated_#{name}" + alias_method old, name + define_method name do |*args, &block| # TODO: really works on 1.8.7? + klass = self.kind_of? Module + target = klass ? "#{self}." : "#{self.class}#" + msg = [ "NOTE: #{target}#{name} is deprecated", + repl == :none ? " with no replacement" : ", use #{repl}", + ". It will be removed on or after %4d-%02d-01." % [year, month], + "\n#{target}#{name} called from #{Gem.location_of_caller.join(":")}", + ] + warn "#{msg.join}." unless Gem::Deprecate.skip + send old, *args, &block + end + } + end + + module_function :deprecate, :skip_during end - - def self.skip= v # :nodoc: - @skip = v - end - - ## - # Temporarily turn off warnings. Intended for tests only. - - def skip_during - Deprecate.skip, original = true, Deprecate.skip - yield - ensure - Deprecate.skip = original - end - - ## - # Simple deprecation method that deprecates +name+ by wrapping it up - # in a dummy method. It warns on each call to the dummy method - # telling the user of +repl+ (unless +repl+ is :none) and the - # year/month that it is planned to go away. - - def deprecate name, repl, year, month - class_eval { - old = "_deprecated_#{name}" - alias_method old, name - define_method name do |*args, &block| # TODO: really works on 1.8.7? - klass = self.kind_of? Module - target = klass ? "#{self}." : "#{self.class}#" - msg = [ "NOTE: #{target}#{name} is deprecated", - repl == :none ? " with no replacement" : ", use #{repl}", - ". It will be removed on or after %4d-%02d-01." % [year, month], - "\n#{target}#{name} called from #{Gem.location_of_caller.join(":")}", - ] - warn "#{msg.join}." unless Deprecate.skip - send old, *args, &block - end - } - end - - module_function :deprecate, :skip_during end diff --git a/lib/rubygems/gem_path_searcher.rb b/lib/rubygems/gem_path_searcher.rb index 1d67d75149..814b5fb0e5 100644 --- a/lib/rubygems/gem_path_searcher.rb +++ b/lib/rubygems/gem_path_searcher.rb @@ -160,7 +160,7 @@ class Gem::GemPathSearcher spec.require_paths end - extend Deprecate + extend Gem::Deprecate deprecate :initialize, :none, 2011, 10 deprecate :find, :none, 2011, 10 diff --git a/lib/rubygems/indexer.rb b/lib/rubygems/indexer.rb index 23c0167be8..e87e5a3632 100644 --- a/lib/rubygems/indexer.rb +++ b/lib/rubygems/indexer.rb @@ -377,7 +377,7 @@ class Gem::Indexer # Collect specifications from .gem files from the gem directory. def collect_specs(gems = gem_file_list) - Deprecate.skip_during do + Gem::Deprecate.skip_during do index = Gem::SourceIndex.new map_gems_to_specs(gems).each do |spec| diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb index 4b5b6ef81a..4a4e3c1b35 100644 --- a/lib/rubygems/platform.rb +++ b/lib/rubygems/platform.rb @@ -186,7 +186,7 @@ class Gem::Platform CURRENT = 'current' - extend Deprecate + extend Gem::Deprecate deprecate :empty?, :none, 2011, 11 end diff --git a/lib/rubygems/server.rb b/lib/rubygems/server.rb index 9c49d1ff85..47fa7c562d 100644 --- a/lib/rubygems/server.rb +++ b/lib/rubygems/server.rb @@ -462,7 +462,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; } add_date res - index = Deprecate.skip_during { Marshal.dump Gem.source_index } + index = Gem::Deprecate.skip_during { Marshal.dump Gem.source_index } if req.request_method == 'HEAD' then res['content-length'] = index.length diff --git a/lib/rubygems/source_index.rb b/lib/rubygems/source_index.rb index 7ddbc23485..1fe92c0a80 100644 --- a/lib/rubygems/source_index.rb +++ b/lib/rubygems/source_index.rb @@ -72,7 +72,7 @@ class Gem::SourceIndex # loaded spec. def self.load_specification(file_name) - Deprecate.skip_during do + Gem::Deprecate.skip_during do Gem::Specification.load Gem::Path.new(file_name) end end @@ -121,7 +121,7 @@ class Gem::SourceIndex spec_files = Dir[File.join(spec_dir, "*.gemspec")] spec_files.each do |spec_file| - gemspec = Deprecate.skip_during do + gemspec = Gem::Deprecate.skip_during do Gem::Specification.load spec_file end add_spec gemspec if gemspec @@ -193,7 +193,7 @@ class Gem::SourceIndex # Add gem specifications to the source index. def add_specs(*gem_specs) - Deprecate.skip_during do + Gem::Deprecate.skip_during do gem_specs.each do |spec| add_spec spec end @@ -251,7 +251,7 @@ class Gem::SourceIndex def find_name(gem_name, requirement = Gem::Requirement.default) dep = Gem::Dependency.new gem_name, requirement - Deprecate.skip_during do + Gem::Deprecate.skip_during do search dep end end @@ -364,7 +364,7 @@ module Gem end class Gem::SourceIndex - extend Deprecate + extend Gem::Deprecate deprecate :all_gems, :none, 2011, 10 @@ -394,7 +394,7 @@ class Gem::SourceIndex deprecate :specification, "Specification.find", 2011, 11 class << self - extend Deprecate + extend Gem::Deprecate deprecate :from_gems_in, :none, 2011, 10 deprecate :from_installed_gems, :none, 2011, 10 diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 2059e0762d..97db19e69a 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -329,7 +329,7 @@ class Gem::Specification def self.all warn "NOTE: Specification.all called from #{caller.first}" unless - Deprecate.skip + Gem::Deprecate.skip _all end @@ -2104,7 +2104,7 @@ class Gem::Specification self.platform = Gem::Platform.new @platform end - extend Deprecate + extend Gem::Deprecate deprecate :test_suite_file, :test_file, 2011, 10 deprecate :test_suite_file=, :test_file=, 2011, 10 diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index bbb61bfa49..436d14c927 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -435,7 +435,7 @@ class TestGem < Gem::TestCase def test_self_available? util_make_gems - Deprecate.skip_during do + Gem::Deprecate.skip_during do assert(Gem.available?("a")) assert(Gem.available?("a", "1")) assert(Gem.available?("a", ">1")) @@ -937,7 +937,7 @@ class TestGem < Gem::TestCase end def test_self_source_index - Deprecate.skip_during do + Gem::Deprecate.skip_during do assert_kind_of Gem::SourceIndex, Gem.source_index end end @@ -1093,7 +1093,7 @@ class TestGem < Gem::TestCase # @abin_path = File.join spec.full_gem_path, spec.bindir, 'abin' # FileUtils.mkdir_p File.join(stem, "gems", "test-3") - Deprecate.skip_during do + Gem::Deprecate.skip_during do expected = [File.join(@gemhome, "gems", "a-4", "lib")] assert_equal expected, Gem.latest_load_paths end diff --git a/test/rubygems/test_gem_dependency.rb b/test/rubygems/test_gem_dependency.rb index a79287414e..e1ba5ffbe7 100644 --- a/test/rubygems/test_gem_dependency.rb +++ b/test/rubygems/test_gem_dependency.rb @@ -63,7 +63,7 @@ class TestGemDependency < Gem::TestCase assert_match dep("a", ">= 0"), dep("a", "1"), "match version" refute_match dep("a"), Object.new - Deprecate.skip_during do + Gem::Deprecate.skip_during do assert_match dep(/a/, ">= 0"), d, "match simple regexp" assert_match dep(/a|b/, ">= 0"), d, "match scary regexp" refute_match dep(/a/), dep("b") @@ -72,7 +72,7 @@ class TestGemDependency < Gem::TestCase def test_equals_tilde_escape refute_match dep("a|b"), dep("a", "1") - Deprecate.skip_during do + Gem::Deprecate.skip_during do assert_match dep(/a|b/), dep("a", "1") end end @@ -88,7 +88,7 @@ class TestGemDependency < Gem::TestCase def test_equals_tilde_spec assert_match dep("a", ">= 0"), spec("a", "0") assert_match dep("a", "1"), spec("a", "1") - Deprecate.skip_during do + Gem::Deprecate.skip_during do assert_match dep(/a/, ">= 0"), spec("a", "0") assert_match dep(/a|b/, ">= 0"), spec("b", "0") refute_match dep(/a/, ">= 0"), spec("b", "0") diff --git a/test/rubygems/test_gem_dependency_list.rb b/test/rubygems/test_gem_dependency_list.rb index 8b920a8f9f..b6d1b2f754 100644 --- a/test/rubygems/test_gem_dependency_list.rb +++ b/test/rubygems/test_gem_dependency_list.rb @@ -28,7 +28,7 @@ class TestGemDependencyList < Gem::TestCase util_clear_gems install_specs @a1, @b2 - deps = Deprecate.skip_during { Gem::DependencyList.from_source_index } + deps = Gem::Deprecate.skip_during { Gem::DependencyList.from_source_index } assert_equal %w[b-2 a-1], deps.dependency_order.map { |s| s.full_name } end diff --git a/test/rubygems/test_gem_gem_path_searcher.rb b/test/rubygems/test_gem_gem_path_searcher.rb index cb2afcdd26..dfabc0b885 100644 --- a/test/rubygems/test_gem_gem_path_searcher.rb +++ b/test/rubygems/test_gem_gem_path_searcher.rb @@ -29,23 +29,23 @@ class TestGemGemPathSearcher < Gem::TestCase @fetcher = Gem::FakeFetcher.new Gem::RemoteFetcher.fetcher = @fetcher - @gps = Deprecate.skip_during { Gem::GemPathSearcher.new } + @gps = Gem::Deprecate.skip_during { Gem::GemPathSearcher.new } end def test_find - Deprecate.skip_during do + Gem::Deprecate.skip_during do assert_equal @foo1, @gps.find('foo') end end def test_find_all - Deprecate.skip_during do + Gem::Deprecate.skip_during do assert_equal [@foo1], @gps.find_all('foo') end end def test_init_gemspecs - Deprecate.skip_during do + Gem::Deprecate.skip_during do util_clear_gems util_setup_spec_fetcher @foo1, @foo2, @bar1, @bar2 expected = [@bar2, @bar1, @foo2, @foo1].map(&:full_name) @@ -55,7 +55,7 @@ class TestGemGemPathSearcher < Gem::TestCase end def test_lib_dirs_for - Deprecate.skip_during do + Gem::Deprecate.skip_during do lib_dirs = @gps.lib_dirs_for(@foo1) expected = File.join @gemhome, 'gems', @foo1.full_name, '{lib,lib2}' @@ -64,20 +64,20 @@ class TestGemGemPathSearcher < Gem::TestCase end def test_lib_dirs_for_nil_require_paths - Deprecate.skip_during do + Gem::Deprecate.skip_during do assert_nil @gps.lib_dirs_for(@nrp) end end def test_matching_file_eh - Deprecate.skip_during do + Gem::Deprecate.skip_during do refute @gps.matching_file?(@foo1, 'bar') assert @gps.matching_file?(@foo1, 'foo') end end def test_matching_files - Deprecate.skip_during do + Gem::Deprecate.skip_during do assert_equal [], @gps.matching_files(@foo1, 'bar') expected = File.join @foo1.full_gem_path, 'lib', 'foo.rb' @@ -87,7 +87,7 @@ class TestGemGemPathSearcher < Gem::TestCase end def test_matching_files_nil_require_paths - Deprecate.skip_during do + Gem::Deprecate.skip_during do assert_empty @gps.matching_files(@nrp, 'foo') end end diff --git a/test/rubygems/test_gem_platform.rb b/test/rubygems/test_gem_platform.rb index 4cb2f067c1..bd09b89f0a 100644 --- a/test/rubygems/test_gem_platform.rb +++ b/test/rubygems/test_gem_platform.rb @@ -138,7 +138,7 @@ class TestGemPlatform < Gem::TestCase def test_empty platform = Gem::Platform.new 'cpu-other_platform1' assert_respond_to platform, :empty? - assert_equal false, Deprecate.skip_during { platform.empty? } + assert_equal false, Gem::Deprecate.skip_during { platform.empty? } end def test_to_s diff --git a/test/rubygems/test_gem_server.rb b/test/rubygems/test_gem_server.rb index 82b3a5c948..f11840db06 100644 --- a/test/rubygems/test_gem_server.rb +++ b/test/rubygems/test_gem_server.rb @@ -33,7 +33,7 @@ class TestGemServer < Gem::TestCase data = StringIO.new "GET /Marshal.#{Gem.marshal_version} HTTP/1.0\r\n\r\n" @req.parse data - Deprecate.skip_during do + Gem::Deprecate.skip_during do @server.Marshal @req, @res end @@ -41,7 +41,7 @@ class TestGemServer < Gem::TestCase assert_match %r| \d\d:\d\d:\d\d |, @res['date'] assert_equal 'application/octet-stream', @res['content-type'] - Deprecate.skip_during do + Gem::Deprecate.skip_during do si = Gem::SourceIndex.new si.add_specs @a1, @a2 @@ -53,7 +53,7 @@ class TestGemServer < Gem::TestCase data = StringIO.new "GET /Marshal.#{Gem.marshal_version}.Z HTTP/1.0\r\n\r\n" @req.parse data - Deprecate.skip_during do + Gem::Deprecate.skip_during do @server.Marshal @req, @res end @@ -61,7 +61,7 @@ class TestGemServer < Gem::TestCase assert_match %r| \d\d:\d\d:\d\d |, @res['date'] assert_equal 'application/x-deflate', @res['content-type'] - Deprecate.skip_during do + Gem::Deprecate.skip_during do si = Gem::SourceIndex.new si.add_specs @a1, @a2 @@ -73,7 +73,7 @@ class TestGemServer < Gem::TestCase data = StringIO.new "GET /latest_specs.#{Gem.marshal_version} HTTP/1.0\r\n\r\n" @req.parse data - Deprecate.skip_during do + Gem::Deprecate.skip_during do @server.latest_specs @req, @res end @@ -88,7 +88,7 @@ class TestGemServer < Gem::TestCase data = StringIO.new "GET /latest_specs.#{Gem.marshal_version}.gz HTTP/1.0\r\n\r\n" @req.parse data - Deprecate.skip_during do + Gem::Deprecate.skip_during do @server.latest_specs @req, @res end diff --git a/test/rubygems/test_gem_source_index.rb b/test/rubygems/test_gem_source_index.rb index 8d0885c860..b4c225ec6c 100644 --- a/test/rubygems/test_gem_source_index.rb +++ b/test/rubygems/test_gem_source_index.rb @@ -9,11 +9,11 @@ class TestGemSourceIndex < Gem::TestCase util_setup_fake_fetcher - @source_index = Deprecate.skip_during { Gem.source_index } + @source_index = Gem::Deprecate.skip_during { Gem.source_index } end def test_find_name - Deprecate.skip_during do + Gem::Deprecate.skip_during do assert_equal [@a1, @a2, @a3a], @source_index.find_name('a') assert_equal [@a2], @source_index.find_name('a', '= 2') assert_equal [], @source_index.find_name('bogusstring') @@ -31,7 +31,7 @@ class TestGemSourceIndex < Gem::TestCase end def test_find_name_empty_cache - Deprecate.skip_during do + Gem::Deprecate.skip_during do empty_source_index = Gem::SourceIndex.new assert_equal [], empty_source_index.find_name("foo") end @@ -39,7 +39,7 @@ class TestGemSourceIndex < Gem::TestCase # HACK: deprecated impl is failing tests, but I may want to port it over def test_latest_specs - Deprecate.skip_during do + Gem::Deprecate.skip_during do p1_ruby = quick_spec 'p', '1' p1_platform = quick_spec 'p', '1' do |spec| spec.platform = Gem::Platform::CURRENT @@ -87,7 +87,7 @@ class TestGemSourceIndex < Gem::TestCase end def test_load_gems_in - Deprecate.skip_during do + Gem::Deprecate.skip_during do spec_dir1 = File.join @gemhome, 'specifications' spec_dir2 = File.join @tempdir, 'gemhome2', 'specifications' @@ -118,7 +118,7 @@ class TestGemSourceIndex < Gem::TestCase # REFACTOR: move to test_gem_commands_outdated_command.rb def test_outdated - Deprecate.skip_during do + Gem::Deprecate.skip_during do util_setup_spec_fetcher assert_equal [], @source_index.outdated @@ -139,7 +139,7 @@ class TestGemSourceIndex < Gem::TestCase end def test_prerelease_specs_kept_in_right_place - Deprecate.skip_during do + Gem::Deprecate.skip_during do gem_a1_alpha = quick_spec 'abba', '1.a' @source_index.add_spec gem_a1_alpha @@ -151,7 +151,7 @@ class TestGemSourceIndex < Gem::TestCase end def test_refresh_bang - Deprecate.skip_during do + Gem::Deprecate.skip_during do a1_spec = File.join @gemhome, "specifications", @a1.spec_name FileUtils.mv a1_spec, @tempdir @@ -171,7 +171,7 @@ class TestGemSourceIndex < Gem::TestCase end def test_remove_spec - Deprecate.skip_during do + Gem::Deprecate.skip_during do si = Gem.source_index expected = si.gems.keys.sort @@ -189,7 +189,7 @@ class TestGemSourceIndex < Gem::TestCase end def test_search - Deprecate.skip_during do + Gem::Deprecate.skip_during do requirement = Gem::Requirement.create '= 9' with_version = Gem::Dependency.new(/^a/, requirement) assert_equal [@a_evil9], @source_index.search(with_version) @@ -203,7 +203,7 @@ class TestGemSourceIndex < Gem::TestCase end def test_search_platform - Deprecate.skip_during do + Gem::Deprecate.skip_during do util_set_arch 'x86-my_platform1' a1 = quick_spec 'a', '1' @@ -226,7 +226,7 @@ class TestGemSourceIndex < Gem::TestCase end def test_signature - Deprecate.skip_during do + Gem::Deprecate.skip_during do sig = @source_index.gem_signature('foo-1.2.3') assert_equal 64, sig.length assert_match(/^[a-f0-9]{64}$/, sig) @@ -234,7 +234,7 @@ class TestGemSourceIndex < Gem::TestCase end def test_specification - Deprecate.skip_during do + Gem::Deprecate.skip_during do assert_equal @a1, @source_index.specification(@a1.full_name) assert_nil @source_index.specification("foo-1.2.4") @@ -242,7 +242,7 @@ class TestGemSourceIndex < Gem::TestCase end def test_index_signature - Deprecate.skip_during do + Gem::Deprecate.skip_during do sig = @source_index.index_signature assert_match(/^[a-f0-9]{64}$/, sig) end diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index 717710b940..a5d5baaa8e 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -222,7 +222,7 @@ bindir: end def test_self_load_legacy_ruby - spec = Deprecate.skip_during do + spec = Gem::Deprecate.skip_during do eval LEGACY_RUBY_SPEC end assert_equal 'keyedlist', spec.name @@ -404,7 +404,7 @@ bindir: assert @a2.activated? - Deprecate.skip_during do + Gem::Deprecate.skip_during do assert @a2.loaded? end end @@ -677,7 +677,7 @@ bindir: end def test_installation_path - Deprecate.skip_during do + Gem::Deprecate.skip_during do assert_equal @gemhome, @a1.installation_path @a1.instance_variable_set :@loaded_from, nil @@ -977,7 +977,7 @@ end end def test_to_ruby_legacy - gemspec1 = Deprecate.skip_during do + gemspec1 = Gem::Deprecate.skip_during do eval LEGACY_RUBY_SPEC end ruby_code = gemspec1.to_ruby