Project

General

Profile

Bug #17523

Updated by nobu (Nobuyoshi Nakada) almost 4 years ago

While `-w` option affects `$VERBOSE` for both the main and required scripts, but affects `Warning[]` values only in the main script. 

 In this example, `Warning[:deprecated]` should be consistent as well as `$VERBOSE`. 

 ##### v.rb 
 ```ruby 
 p $VERBOSE 
 p %i[deprecated experimental].to_h{|i|[i,Warning[i]]} 
 ``` 
 ##### result 
 ```sh 
 $ ruby -w -r./v -e 'p $VERBOSE, %i[deprecated experimental].to_h{|i|[i,Warning[i]]}' 
 true 
 {:deprecated=>false, :experimental=>true} 
 true 
 {:deprecated=>true, :experimental=>true} 
 ``` 

 ##### [patch](https://github.com/ruby/ruby/pull/4042)

Back