1
0
Fork 0
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:
bronzdoc 2020-03-22 18:37:38 -06:00 committed by Hiroshi SHIBATA
parent 2f7865bb6e
commit a7a7e7bea0
Notes: git 2020-05-08 07:39:30 +09:00

View file

@ -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