mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 13:34:17 +02:00
[rubygems/rubygems] Modify files to use new version horizon deprecations
4fe5bb5bf3
This commit is contained in:
parent
42c91de9ce
commit
ff37dd7e9e
Notes:
git
2020-05-08 07:39:28 +09:00
8 changed files with 16 additions and 16 deletions
|
@ -41,7 +41,7 @@ class Gem::BasicSpecification
|
||||||
class << self
|
class << self
|
||||||
|
|
||||||
extend Gem::Deprecate
|
extend Gem::Deprecate
|
||||||
deprecate :default_specifications_dir, "Gem.default_specifications_dir", 2020, 02
|
deprecate :default_specifications_dir, "Gem.default_specifications_dir"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ require 'rubygems/deprecate'
|
||||||
class Gem::Commands::QueryCommand < Gem::Command
|
class Gem::Commands::QueryCommand < Gem::Command
|
||||||
|
|
||||||
extend Gem::Deprecate
|
extend Gem::Deprecate
|
||||||
deprecate_command(2020, 12)
|
deprecate_command
|
||||||
|
|
||||||
include Gem::QueryUtils
|
include Gem::QueryUtils
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ class Gem::DependencyInstaller
|
||||||
|
|
||||||
set
|
set
|
||||||
end
|
end
|
||||||
deprecate :find_gems_with_sources, :none, 2020, 12
|
deprecate :find_gems_with_sources
|
||||||
|
|
||||||
def in_background(what) # :nodoc:
|
def in_background(what) # :nodoc:
|
||||||
fork_happened = false
|
fork_happened = false
|
||||||
|
|
|
@ -422,7 +422,7 @@ class Gem::Installer
|
||||||
@gem_dir = directory
|
@gem_dir = directory
|
||||||
extract_files
|
extract_files
|
||||||
end
|
end
|
||||||
deprecate :unpack, :none, 2020, 04
|
deprecate :unpack
|
||||||
|
|
||||||
##
|
##
|
||||||
# The location of the spec file that is installed.
|
# The location of the spec file that is installed.
|
||||||
|
|
|
@ -720,7 +720,7 @@ class Gem::Specification < Gem::BasicSpecification
|
||||||
# Deprecated: You must now specify the executable name to Gem.bin_path.
|
# Deprecated: You must now specify the executable name to Gem.bin_path.
|
||||||
|
|
||||||
attr_writer :default_executable
|
attr_writer :default_executable
|
||||||
deprecate :default_executable=, :none, 2018, 12
|
deprecate :default_executable=
|
||||||
|
|
||||||
##
|
##
|
||||||
# Allows deinstallation of gems with legacy platforms.
|
# Allows deinstallation of gems with legacy platforms.
|
||||||
|
@ -733,7 +733,7 @@ class Gem::Specification < Gem::BasicSpecification
|
||||||
# Formerly used to set rubyforge project.
|
# Formerly used to set rubyforge project.
|
||||||
|
|
||||||
attr_writer :rubyforge_project
|
attr_writer :rubyforge_project
|
||||||
deprecate :rubyforge_project=, :none, 2019, 12
|
deprecate :rubyforge_project=
|
||||||
|
|
||||||
##
|
##
|
||||||
# The Gem::Specification version of this gemspec.
|
# The Gem::Specification version of this gemspec.
|
||||||
|
@ -1725,7 +1725,7 @@ class Gem::Specification < Gem::BasicSpecification
|
||||||
end
|
end
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
deprecate :default_executable, :none, 2018, 12
|
deprecate :default_executable
|
||||||
|
|
||||||
##
|
##
|
||||||
# The default value for specification attribute +name+
|
# The default value for specification attribute +name+
|
||||||
|
@ -1928,7 +1928,7 @@ class Gem::Specification < Gem::BasicSpecification
|
||||||
def has_rdoc # :nodoc:
|
def has_rdoc # :nodoc:
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
deprecate :has_rdoc, :none, 2018, 12
|
deprecate :has_rdoc
|
||||||
|
|
||||||
##
|
##
|
||||||
# Deprecated and ignored.
|
# Deprecated and ignored.
|
||||||
|
@ -1938,10 +1938,10 @@ class Gem::Specification < Gem::BasicSpecification
|
||||||
def has_rdoc=(ignored) # :nodoc:
|
def has_rdoc=(ignored) # :nodoc:
|
||||||
@has_rdoc = true
|
@has_rdoc = true
|
||||||
end
|
end
|
||||||
deprecate :has_rdoc=, :none, 2018, 12
|
deprecate :has_rdoc=
|
||||||
|
|
||||||
alias :has_rdoc? :has_rdoc # :nodoc:
|
alias :has_rdoc? :has_rdoc # :nodoc:
|
||||||
deprecate :has_rdoc?, :none, 2018, 12
|
deprecate :has_rdoc?
|
||||||
|
|
||||||
##
|
##
|
||||||
# True if this gem has files in test_files
|
# True if this gem has files in test_files
|
||||||
|
|
|
@ -50,7 +50,7 @@ class TestDeprecate < Gem::TestCase
|
||||||
def bar
|
def bar
|
||||||
@message = "bar"
|
@message = "bar"
|
||||||
end
|
end
|
||||||
deprecate :foo, :bar, 2099, 3
|
deprecate :foo, :bar
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ class TestDeprecate < Gem::TestCase
|
||||||
|
|
||||||
assert_equal "", out
|
assert_equal "", out
|
||||||
assert_match(/Thing#foo is deprecated; use bar instead\./, err)
|
assert_match(/Thing#foo is deprecated; use bar instead\./, err)
|
||||||
assert_match(/on or after 2099-03-01/, err)
|
assert_match(/in Rubygems [0-9]+/, err)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_deprecate_command
|
def test_deprecate_command
|
||||||
|
@ -78,7 +78,7 @@ class TestDeprecate < Gem::TestCase
|
||||||
foo_command = Class.new(Gem::Command) do
|
foo_command = Class.new(Gem::Command) do
|
||||||
extend Gem::Deprecate
|
extend Gem::Deprecate
|
||||||
|
|
||||||
deprecate_command(2099, 4)
|
deprecate_command
|
||||||
|
|
||||||
def execute
|
def execute
|
||||||
puts "pew pew!"
|
puts "pew pew!"
|
||||||
|
|
|
@ -281,7 +281,7 @@ class TestGemCommandManager < Gem::TestCase
|
||||||
foo_command = Class.new(Gem::Command) do
|
foo_command = Class.new(Gem::Command) do
|
||||||
extend Gem::Deprecate
|
extend Gem::Deprecate
|
||||||
|
|
||||||
deprecate_command(2099, 4)
|
deprecate_command
|
||||||
|
|
||||||
def execute
|
def execute
|
||||||
say "pew pew!"
|
say "pew pew!"
|
||||||
|
@ -296,7 +296,7 @@ class TestGemCommandManager < Gem::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_equal "pew pew!\n", @ui.output
|
assert_equal "pew pew!\n", @ui.output
|
||||||
assert_equal("WARNING: foo command is deprecated. It will be removed on or after 2099-04-01.\n", @ui.error)
|
assert_match(/WARNING: foo command is deprecated. It will be removed in Rubygems [0-9]+/, @ui.error)
|
||||||
ensure
|
ensure
|
||||||
Gem::Commands.send(:remove_const, :FooCommand)
|
Gem::Commands.send(:remove_const, :FooCommand)
|
||||||
end
|
end
|
||||||
|
|
|
@ -76,7 +76,7 @@ class TestGemGemRunner < Gem::TestCase
|
||||||
assert_nil @runner.run(args)
|
assert_nil @runner.run(args)
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_equal "WARNING: query command is deprecated. It will be removed on or after 2020-12-01.\n", @ui.error
|
assert_match /WARNING: query command is deprecated. It will be removed in Rubygems [0-9]+/, @ui.error
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_info_succeeds
|
def test_info_succeeds
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue