Project

General

Profile

Feature #16018

Add a way to deprecate methods

Added by vo.x (Vit Ondruch) 12 months ago. Updated 10 months 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

Related issues

Related to Ruby master - Feature #16345: Don't emit deprecation warnings by default.ClosedActions
#1

Updated by jeremyevans0 (Jeremy Evans) 12 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) 10 months 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)?

#3

Updated by vo.x (Vit Ondruch) 7 months ago

  • Related to Feature #16345: Don't emit deprecation warnings by default. added

Also available in: Atom PDF