@@ -126,13 +126,14 @@ def deprecate(name, repl, year, month)
126
126
# telling the user of +repl+ (unless +repl+ is :none) and the
127
127
# Rubygems version that it is planned to go away.
128
128
129
- def rubygems_deprecate ( name , replacement = :none , version = Gem :: Deprecate . next_rubygems_major_version )
129
+ def rubygems_deprecate ( name , replacement = :none , version = nil )
130
130
class_eval do
131
131
old = "_deprecated_#{ name } "
132
132
alias_method old , name
133
133
define_method name do |*args , &block |
134
134
klass = is_a? Module
135
135
target = klass ? "#{ self } ." : "#{ self . class } #"
136
+ version ||= Gem ::Deprecate . next_rubygems_major_version
136
137
msg = [
137
138
"NOTE: #{ target } #{ name } is deprecated" ,
138
139
replacement == :none ? " with no replacement" : "; use #{ replacement } instead" ,
@@ -147,13 +148,14 @@ def rubygems_deprecate(name, replacement=:none, version=Gem::Deprecate.next_ruby
147
148
end
148
149
149
150
# Deprecation method to deprecate Rubygems commands
150
- def rubygems_deprecate_command ( version = Gem :: Deprecate . next_rubygems_major_version )
151
+ def rubygems_deprecate_command ( version = nil )
151
152
class_eval do
152
153
define_method "deprecated?" do
153
154
true
154
155
end
155
156
156
157
define_method "deprecation_warning" do
158
+ version ||= Gem ::Deprecate . next_rubygems_major_version
157
159
msg = [
158
160
"#{ command } command is deprecated" ,
159
161
". It will be removed in Rubygems #{ version } .\n " ,
0 commit comments