ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: nobu@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:101991] [Ruby master Bug#17523] Inconsistent Warning[] values in scripts loaded by -r option
Date: Sat, 09 Jan 2021 07:52:29 +0000 (UTC)	[thread overview]
Message-ID: <redmine.issue-17523.20210109075228.4@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-17523.20210109075228.4@ruby-lang.org

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/

       reply	other threads:[~2021-01-09  7:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-09  7:52 nobu [this message]
2021-02-01 12:35 ` [ruby-core:102353] [Ruby master Bug#17523] Inconsistent Warning[] values in scripts loaded by -r option naruse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.issue-17523.20210109075228.4@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).