Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Core Classes/Modules
-
Labels:None
-
Number of attachments :
Description
$-W corresponds to the warning level set forth by the -W flag.
The behavior of this variable is rather strange. If -W is not given, the value is 1:
$ ruby1.9 -e 'p $-W' 1
But if you give any of -v, -w or -W (without the argument), the value is 2:
$ ruby1.9 -v -e 'p $-W' ruby 2.0.0dev (2011-11-21 trunk 33804) [x86_64-darwin11.2.0] 2 $ ruby1.9 -W -e 'p $-W' 2 $ ruby1.9 -w -e 'p $-W' 2
If you pass an argument to -W, that value is respected:
$ ruby1.9 -W0 -e 'p $-W' 0 $ ruby1.9 -W1 -e 'p $-W' 1 $ ruby1.9 -W2 -e 'p $-W' 2
I am not entirely sure how this variable is supposed to influence the warning output, however.
This is fixed in bdd8acd.