Skip to content

Commit 51f88f9

Browse files
committed
[rubygems/rubygems] Added ability for changing deprecated version from only next major
rubygems/rubygems@15177de84e
1 parent 19336a6 commit 51f88f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rubygems/deprecate.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def deprecate(name, repl, year, month)
126126
# telling the user of +repl+ (unless +repl+ is :none) and the
127127
# Rubygems version that it is planned to go away.
128128

129-
def rubygems_deprecate(name, replacement=:none)
129+
def rubygems_deprecate(name, replacement=:none, version=Gem::Deprecate.next_rubygems_major_version)
130130
class_eval do
131131
old = "_deprecated_#{name}"
132132
alias_method old, name
@@ -136,7 +136,7 @@ def rubygems_deprecate(name, replacement=:none)
136136
msg = [
137137
"NOTE: #{target}#{name} is deprecated",
138138
replacement == :none ? " with no replacement" : "; use #{replacement} instead",
139-
". It will be removed in Rubygems #{Gem::Deprecate.next_rubygems_major_version}",
139+
". It will be removed in Rubygems #{version}",
140140
"\n#{target}#{name} called from #{Gem.location_of_caller.join(":")}",
141141
]
142142
warn "#{msg.join}." unless Gem::Deprecate.skip

0 commit comments

Comments
 (0)