Changing ruby warning level

Does anyone know how to change the warning level in Ruby?

Hi,

···

In message “Changing ruby warning level” on 02/11/07, “Carl Youngblood” carl@youngbloods.org writes:

Does anyone know how to change the warning level in Ruby?

There’s only 2 levels. -w for lousy, no -w for relatively quiet.
From the script, set $VERBOSE (or $-w) to boolean value.

						matz.

There’s only 2 levels. -w for lousy, no -w for relatively quiet.
From the script, set $VERBOSE (or $-w) to boolean value.

matz.

I assume then that scripts are usually in quiet mode by default, and this is
actually still too noisy for me. I want a way to turn off all output
temporarily and then turn it back on.

Thanks,
Carl

Okay, since I can’t change the warning level to where I need it to be, is
there a way of temporarily redirecting output to /dev/null or something?
I’m not sure how to do that from inside a ruby script.

Thanks,
Carl

···

----- Original Message -----
From: “Yukihiro Matsumoto” matz@ruby-lang.org
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Wednesday, November 06, 2002 7:45 PM
Subject: Re: Changing ruby warning level

Hi,

In message “Changing ruby warning level” on 02/11/07, “Carl Youngblood” carl@youngbloods.org writes:

Does anyone know how to change the warning level in Ruby?

There’s only 2 levels. -w for lousy, no -w for relatively quiet.
From the script, set $VERBOSE (or $-w) to boolean value.

matz.

Hi,

···

In message “Re: Changing ruby warning level” on 02/11/07, “Carl Youngblood” carl@youngbloods.org writes:

I assume then that scripts are usually in quiet mode by default, and this is
actually still too noisy for me. I want a way to turn off all output
temporarily and then turn it back on.

How “still too noisy” for you?

						matz.

Try:

olderr = $stderr.clone
$stderr.flush
$stderr.reopen(“/dev/null”, “w”)


$stderr.flush
$stderr.reopen(olderr)
$olderr.close

I believe “flush” should not be necessary but I needed it to make it work
(very quick test on Windows Ruby 1.6.7).

Dalibor Sramek

···

On Fri, Nov 08, 2002 at 03:47:23AM +0900, Carl Youngblood wrote:

Okay, since I can’t change the warning level to where I need it to be, is
there a way of temporarily redirecting output to /dev/null or something?
I’m not sure how to do that from inside a ruby script.