Turning Off Warnings In Code

This seems like something really simple, but I can't figure out it's done.

How do you turn warnings off in code? Meaning, not launching Ruby with -w0,
just turning them off with Ruby code.

Sean O'Dell

$VERBOSE = nil

···

On Thu, Aug 26, 2004 at 03:49:54AM +0900, Sean O'Dell wrote:

This seems like something really simple, but I can't figure out it's done.

How do you turn warnings off in code? Meaning, not launching Ruby with -w0,
just turning them off with Ruby code.

--
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

"Mauricio Fernández" <batsman.geo@yahoo.com> schrieb im Newsbeitrag
news:20040825190102.GA26316@student.ei.uni-stuttgart.de...

> This seems like something really simple, but I can't figure out it's

done.

>
> How do you turn warnings off in code? Meaning, not launching Ruby

with -w0,

> just turning them off with Ruby code.

$VERBOSE = nil

Or how about:

module Kernel
  private
  def no_warn
    old = $VERBOSE
    begin
      yield
    ensure
      $VERBOSE = old
    end
  end
end

Both variants don't seem to help agains syntax warnings though (which is
completely logical if you keep in mind when they appear).

Kind regards

    robert

···

On Thu, Aug 26, 2004 at 03:49:54AM +0900, Sean O'Dell wrote: