summaryrefslogtreecommitdiff
path: root/lib/rubygems/deprecate.rb
diff options
context:
space:
mode:
authorbronzdoc <[email protected]>2020-03-28 17:46:20 -0600
committerHiroshi SHIBATA <[email protected]>2020-05-08 07:38:50 +0900
commit42c91de9ce97556a9be2c702f317cf1d6107bc03 ()
tree52ad9b3b844289444b35612156564a71e7c8ed3d /lib/rubygems/deprecate.rb
parentfeb297400039e18637f31b8972eb3616d9bc9287 (diff)
[rubygems/rubygems] Use the next major version as default for deprecations
https://.com/rubygems/rubygems/commit/b679ab27af
Notes: Merged: https://.com/ruby/ruby/pull/3087
-rw-r--r--lib/rubygems/deprecate.rb13
1 files changed, 9 insertions, 4 deletions
@@ -47,7 +47,10 @@ module Gem::Deprecate
# telling the user of +repl+ (unless +repl+ is :none) and the
# Rubygems version that it is planned to go away.
- def deprecate(name:, replacement:)
class_eval do
old = "_deprecated_#{name}"
alias_method old, name
@@ -55,8 +58,8 @@ module Gem::Deprecate
klass = self.kind_of? Module
target = klass ? "#{self}." : "#{self.class}#"
msg = [ "NOTE: #{target}#{name} is deprecated",
- repl == :none ? " with no replacement" : "; use #{replacement} instead",
- ". It will be removed in Rubygems #{rubygems_version}",
"\n#{target}#{name} called from #{Gem.location_of_caller.join(":")}",
]
warn "#{msg.join}." unless Gem::Deprecate.skip
@@ -67,7 +70,9 @@ module Gem::Deprecate
# Deprecation method to deprecate Rubygems commands
def deprecate_command
- next_rubygems_major_version = Gem.rubygems_version + 1
class_eval do
define_method "deprecated?" do
true