[ruby-core:101991] [Ruby master Bug#17523] Inconsistent Warning[] values in scripts loaded by -r option
From:
nobu@...
Date:
2021-01-09 07:52:29 UTC
List:
ruby-core #101991
Issue #17523 has been reported by nobu (Nobuyoshi Nakada).
----------------------------------------
Bug #17523: Inconsistent Warning[] values in scripts loaded by -r option
https://bugs.ruby-lang.org/issues/17523
* Author: nobu (Nobuyoshi Nakada)
* Status: Open
* Priority: Normal
* Backport: 2.5: DONTNEED, 2.6: DONTNEED, 2.7: REQUIRED, 3.0: REQUIRED
----------------------------------------
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}
```
--
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>