Project

General

Profile

Feature #16018

Add a way to deprecate methods

Added by vo.x (Vit Ondruch) about 2 months ago. Updated 16 days ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:93902]

Description

Since #11398, We have Module#deprecate_constant available. But I wonder, why we don't have a way to deprecate methods? There is already Gem::Deprecate 1, so may be this could be extracted and made more generic?

This might be useful on several places in Ruby code:

$ find . -name \*.rb -type f -exec grep -r '[^_]warn.*deprecate' {} \; | wc -l
66

History

#1

Updated by jeremyevans0 (Jeremy Evans) about 2 months ago

  • Backport deleted (2.5: UNKNOWN, 2.6: UNKNOWN)
  • ruby -v deleted (ruby 2.6.3p62 (2019-04-16 revision 67580) [i386-linux])
  • Tracker changed from Bug to Feature

Updated by mame (Yusuke Endoh) 16 days ago

At the developers' meeting, no one was against this feature. It would be great if we can print a warning per a pair of callsite and callee (to suppress duplicated redundant warnings), but the implementation is not trivial (exploiting method call cache)?

Also available in: Atom PDF