mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Make the deprecate_command method recieve a Rubygems version instead of a date
https://github.com/rubygems/rubygems/commit/bf95b1de78
This commit is contained in:
parent
2f7865bb6e
commit
a7a7e7bea0
Notes:
git
2020-05-08 07:39:30 +09:00
1 changed files with 17 additions and 0 deletions
|
@ -65,6 +65,23 @@ module Gem::Deprecate
|
|||
end
|
||||
end
|
||||
|
||||
# Deprecation method to deprecate Rubygems commands
|
||||
def deprecate_command(rubygems_version:)
|
||||
class_eval do
|
||||
define_method "deprecated?" do
|
||||
true
|
||||
end
|
||||
|
||||
define_method "deprecation_warning" do
|
||||
msg = [ "#{self.command} command is deprecated",
|
||||
". It will be removed in Rubygems #{rubygems_version}.\n",
|
||||
]
|
||||
|
||||
alert_warning "#{msg.join}" unless Gem::Deprecate.skip
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
##
|
||||
# Simple deprecation method that deprecates +name+ by wrapping it up
|
||||
# in a dummy method. It warns on each call to the dummy method
|
||||
|
|
Loading…
Add table
Reference in a new issue