mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Rename version horizon deprecation methods
6afd914fda
This commit is contained in:
parent
361ed8d0a6
commit
7db538a7c9
Notes:
git
2020-05-08 07:39:27 +09:00
8 changed files with 17 additions and 17 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"
|
rubygems_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
|
rubygems_deprecate_command
|
||||||
|
|
||||||
include Gem::QueryUtils
|
include Gem::QueryUtils
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ class Gem::DependencyInstaller
|
||||||
|
|
||||||
set
|
set
|
||||||
end
|
end
|
||||||
deprecate :find_gems_with_sources
|
rubygems_deprecate :find_gems_with_sources
|
||||||
|
|
||||||
def in_background(what) # :nodoc:
|
def in_background(what) # :nodoc:
|
||||||
fork_happened = false
|
fork_happened = false
|
||||||
|
|
|
@ -51,7 +51,7 @@ module Gem::Deprecate
|
||||||
# telling the user of +repl+ (unless +repl+ is :none) and the
|
# telling the user of +repl+ (unless +repl+ is :none) and the
|
||||||
# Rubygems version that it is planned to go away.
|
# Rubygems version that it is planned to go away.
|
||||||
|
|
||||||
def deprecate(name, replacement=:none)
|
def rubygems_deprecate(name, replacement=:none)
|
||||||
class_eval do
|
class_eval do
|
||||||
old = "_deprecated_#{name}"
|
old = "_deprecated_#{name}"
|
||||||
alias_method old, name
|
alias_method old, name
|
||||||
|
@ -70,7 +70,7 @@ module Gem::Deprecate
|
||||||
end
|
end
|
||||||
|
|
||||||
# Deprecation method to deprecate Rubygems commands
|
# Deprecation method to deprecate Rubygems commands
|
||||||
def deprecate_command
|
def rubygems_deprecate_command
|
||||||
class_eval do
|
class_eval do
|
||||||
define_method "deprecated?" do
|
define_method "deprecated?" do
|
||||||
true
|
true
|
||||||
|
@ -86,6 +86,6 @@ module Gem::Deprecate
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
module_function :deprecate, :deprecate_command, :skip_during
|
module_function :rubygems_deprecate, :rubygems_deprecate_command, :skip_during
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -422,7 +422,7 @@ class Gem::Installer
|
||||||
@gem_dir = directory
|
@gem_dir = directory
|
||||||
extract_files
|
extract_files
|
||||||
end
|
end
|
||||||
deprecate :unpack
|
rubygems_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=
|
rubygems_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=
|
rubygems_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
|
rubygems_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
|
rubygems_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=
|
rubygems_deprecate :has_rdoc=
|
||||||
|
|
||||||
alias :has_rdoc? :has_rdoc # :nodoc:
|
alias :has_rdoc? :has_rdoc # :nodoc:
|
||||||
deprecate :has_rdoc?
|
rubygems_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
|
rubygems_deprecate :foo, :bar
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -73,12 +73,12 @@ class TestDeprecate < Gem::TestCase
|
||||||
assert_match(/in Rubygems [0-9]+/, err)
|
assert_match(/in Rubygems [0-9]+/, err)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_deprecate_command
|
def test_rubygems_deprecate_command
|
||||||
require 'rubygems/command'
|
require 'rubygems/command'
|
||||||
foo_command = Class.new(Gem::Command) do
|
foo_command = Class.new(Gem::Command) do
|
||||||
extend Gem::Deprecate
|
extend Gem::Deprecate
|
||||||
|
|
||||||
deprecate_command
|
rubygems_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
|
rubygems_deprecate_command
|
||||||
|
|
||||||
def execute
|
def execute
|
||||||
say "pew pew!"
|
say "pew pew!"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue