mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[rubygems/rubygems] Added ability for changing deprecated version from only next major
15177de84e
This commit is contained in:
parent
19336a6392
commit
51f88f9922
1 changed files with 2 additions and 2 deletions
|
@ -126,7 +126,7 @@ module Gem
|
||||||
# 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 rubygems_deprecate(name, replacement=:none)
|
def rubygems_deprecate(name, replacement=:none, version=Gem::Deprecate.next_rubygems_major_version)
|
||||||
class_eval do
|
class_eval do
|
||||||
old = "_deprecated_#{name}"
|
old = "_deprecated_#{name}"
|
||||||
alias_method old, name
|
alias_method old, name
|
||||||
|
@ -136,7 +136,7 @@ module Gem
|
||||||
msg = [
|
msg = [
|
||||||
"NOTE: #{target}#{name} is deprecated",
|
"NOTE: #{target}#{name} is deprecated",
|
||||||
replacement == :none ? " with no replacement" : "; use #{replacement} instead",
|
replacement == :none ? " with no replacement" : "; use #{replacement} instead",
|
||||||
". It will be removed in Rubygems #{Gem::Deprecate.next_rubygems_major_version}",
|
". It will be removed in Rubygems #{version}",
|
||||||
"\n#{target}#{name} called from #{Gem.location_of_caller.join(":")}",
|
"\n#{target}#{name} called from #{Gem.location_of_caller.join(":")}",
|
||||||
]
|
]
|
||||||
warn "#{msg.join}." unless Gem::Deprecate.skip
|
warn "#{msg.join}." unless Gem::Deprecate.skip
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue