[#97319] [Ruby master Feature#16667] Allow parameters to Symbol#to_proc and Method#to_proc — jgomo3@...

Issue #16667 has been reported by jgomo3 (Jes俍 Gez).

10 messages 2020/03/01

[#97344] [Ruby master Feature#16670] Reverse order of `expression` in `pattern` for 1-line pattern matching while it's still experimental — ttilberg@...

Issue #16670 has been reported by ttilberg (Tim Tilberg).

9 messages 2020/03/03

[#97355] [Ruby master Misc#16671] BASERUBY version policy — ko1@...

Issue #16671 has been reported by ko1 (Koichi Sasada).

10 messages 2020/03/04

[#97359] [Ruby master Bug#16672] net/http leaves original content-length header intact after inflating response — justin.reid@...

Issue #16672 has been reported by jmreid (Justin Reid).

15 messages 2020/03/04

[#97390] [Ruby master Bug#16677] Negative integer powered (**) to a float number results in a complex — camille.drapier@...

Issue #16677 has been reported by CamilleDrapier (Camille Drapier).

25 messages 2020/03/07

[#97410] [Ruby master Bug#16680] [Breaking Change] Ruby 2.7 not support symlinks folder in $LOAD_PATH to work with autoload. — vil963@...

Issue #16680 has been reported by zw963 (Wei Zheng).

8 messages 2020/03/07

[#97416] [Ruby master Bug#16682] Ruby 2.7.0p0 crash on exit if there is an active RUBY_INTERNAL_EVENT_GC_EXIT tracepoint — jean.boussier@...

Issue #16682 has been reported by byroot (Jean Boussier).

16 messages 2020/03/09

[#97448] [Ruby master Feature#16688] Allow #to_path object as argument to system() — daniel@...42.com

Issue #16688 has been reported by Dan0042 (Daniel DeLorme).

12 messages 2020/03/11

[#97528] [Ruby master Misc#16693] DevelopersMeeting20200410Japan — mame@...

Issue #16693 has been reported by mame (Yusuke Endoh).

12 messages 2020/03/16

[#97536] [Ruby master Bug#16694] JIT vs hardened GCC with PCH — v.ondruch@...

Issue #16694 has been reported by vo.x (Vit Ondruch).

11 messages 2020/03/18

[#97538] [Ruby master Bug#16695] Stack consistency error when using the return value — s.wakeup31@...

Issue #16695 has been reported by s4ichi (takamasa saichi).

10 messages 2020/03/18

[#97554] [Ruby master Bug#16697] Hash.ruby2_keywords_hash?(value) should support any object — eregontp@...

Issue #16697 has been reported by Eregon (Benoit Daloze).

12 messages 2020/03/19

[#97609] [Ruby master Bug#16740] Deprecating and removing the broken Process.clock_getres — eregontp@...

Issue #16740 has been reported by Eregon (Benoit Daloze).

14 messages 2020/03/28

[#97621] [Ruby master Bug#16743] problem with multi threading [BUG] Segmentation fault — pauloo.jansen@...

Issue #16743 has been reported by paulorja (paulo jansen).

12 messages 2020/03/29

[#97629] [Ruby master Feature#16744] Flag to load current bundle without using bundle exec — headius@...

Issue #16744 has been reported by headius (Charles Nutter).

11 messages 2020/03/30

[ruby-core:97557] [Ruby master Feature#16699] Consider providing ruby developers with a way to specifically silence/ignore particular warnings from some parts of the code (in a .rb file)

From: shevegen@...
Date: 2020-03-19 20:54:40 UTC
List: ruby-core #97557
Issue #16699 has been reported by shevegen (Robert A. Heiler).

----------------------------------------
Feature #16699: Consider providing ruby developers with a way to specifically silence/ignore particular warnings from some parts of the code (in a .rb file)
https://bugs.ruby-lang.org/issues/16699

* Author: shevegen (Robert A. Heiler)
* Status: Open
* Priority: Normal
----------------------------------------
In ruby it is possible to silence a specific warning, such as:

    SOME_CONSTANT = 42
    old_verbose_value = $VERBOSE
    $VERBOSE = nil
    SOME_CONSTANT = 24
    $VERBOSE = old_verbose_value

I recently needed to do so for re-defining a method. I had to add an instance
variable to that method. There are alternatives, e. g. including a module, or
subclassing, but I actually really wanted to just re-define the method as-is,
without incurring a warning message on the commandline. So I would like to
make that possible for ruby users, that they can enable or disable a warning.

I found out that rails has this:

    https://apidock.com/rails/Kernel/silence_warnings

I do not use rails myself, but I think I may not be the only one who thinks
that it may be more elegant to have a method.

I don't really care that much where this method will reside, be it in
Kernel, or in Warnings, or what particular name it has (although silence_warnings
is not a bad name). I think the more important question is whether matz feels
that the use case for being able to briefly silence a particular warning is
ok to have and worth a code addition/change, or not.

The above way to re-assign $VERBOSE works fine. It should be kept. At the same
time, though, looking at $variables is not that elegant, and it feels a tiny
bit hackish too; plus, it may be useful if ruby users may use a more common
idiom for this procedure.

Note that it is proposed primarily that we can modify a constant, or a method.
There may be more use cases for being able to disable warnings briefly, but
right now I am only thinking about these two use cases.

Do note that I refer ONLY to situations where the ruby developer at hand KNOWS that
he/she wants to silence a warning specifically. (Personally I run with -w all the
time, but not every warning is equally useful to me.)

If you, as a ruby developer, have had a use case for something like this in the
past, it may be helpful if you could comment; and either way, it may be 
helpful if others comment too, to state whether the use case may be useful
or not, so that the ruby core team gets a broader view as to how important
that would be (or how much used it could be; I think we can only settle for
a single method though, and it should be short, because otherwise the 
current way would be better).



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next