From: "shevegen (markus heiler)" Date: 2013-02-21T20:23:38+09:00 Subject: [ruby-core:52620] [ruby-trunk - Bug #7899][Open] Add feature similar to: perl use warnings Issue #7899 has been reported by shevegen (markus heiler). ---------------------------------------- Bug #7899: Add feature similar to: perl use warnings https://bugs.ruby-lang.org/issues/7899 Author: shevegen (markus heiler) Status: Open Priority: Low Assignee: Category: Target version: ruby -v: 1.9.3p385 shevy: It would be nice ruby had a way to enable warnings within the code - like perl's `use warnings;` Hi, Background to this is that maasha had problems with shebang, /usr/bin/env and "ruby -w" as part of the shebangs. He was able to workaround this by setting RUBYOPT: shevy: I think the conclusion is that one needs to set: export RUBYOPT=-w A bit background is here: http://stackoverflow.com/questions/4303128/how-to-use-multiple-arguments-with-a-shebang-i-e Now one suggestion is to set $VERBOSE to 2 or true. But I am not sure whether this is the best or most elegant solution. Could there be a way to enable and disable warnings globally within a .rb script? Kernel.enable_warnings Kernel.disable_warnings Something like that? Then users could specifically choose to ignore certain warnings, if they want to (like during development when they dont care about all warnings in every .rb file of a project). -- http://bugs.ruby-lang.org/