ruby-changes:61065
From: bronzdoc <ko1@a...>
Date: Fri, 8 May 2020 07:39:35 +0900 (JST)
Subject: [ruby-changes:61065] a7a7e7bea0 (master): [rubygems/rubygems] Make the deprecate_command method recieve a Rubygems version instead of a date
https://git.ruby-lang.org/ruby.git/commit/?id=a7a7e7bea0 From a7a7e7bea0183b0f7a21ffd60010563a97cf67e9 Mon Sep 17 00:00:00 2001 From: bronzdoc <lsagastume1990@g...> Date: Sun, 22 Mar 2020 18:37:38 -0600 Subject: [rubygems/rubygems] Make the deprecate_command method recieve a Rubygems version instead of a date https://github.com/rubygems/rubygems/commit/bf95b1de78 diff --git a/lib/rubygems/deprecate.rb b/lib/rubygems/deprecate.rb index 3504dbe..d80bde0 100644 --- a/lib/rubygems/deprecate.rb +++ b/lib/rubygems/deprecate.rb @@ -65,6 +65,23 @@ module Gem::Deprecate https://github.com/ruby/ruby/blob/trunk/lib/rubygems/deprecate.rb#L65 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/