Turning Off Warnings In Code

Discussion in 'Ruby' started by Sean O'Dell, Aug 25, 2004.

  1. Sean O'Dell

    Sean O'Dell Guest

    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
     
    Sean O'Dell, Aug 25, 2004
    #1
    1. Advertising

  2. 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.


    $VERBOSE = nil

    --
    Running Debian GNU/Linux Sid (unstable)
    batsman dot geo at yahoo dot com
     
    Mauricio Fernández, Aug 25, 2004
    #2
    1. Advertising

  3. "Mauricio Fernández" <> schrieb im Newsbeitrag
    news:-stuttgart.de...
    > 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.

    >
    > $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
     
    Robert Klemme, Aug 26, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Santosh

    Turning Off ASPSession Objects

    Santosh, Jun 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    520
    George
    Jun 15, 2004
  2. DC Gringo
    Replies:
    2
    Views:
    6,490
    DC Gringo
    Nov 18, 2004
  3. UJ
    Replies:
    1
    Views:
    351
    Kevin Spencer
    Aug 8, 2005
  4. Paulo Pinto

    Turning off warnings

    Paulo Pinto, Dec 1, 2003, in forum: Python
    Replies:
    3
    Views:
    393
    Martin Franklin
    Dec 1, 2003
  5. Ivan Shevanski

    Turning off syntax warnings?

    Ivan Shevanski, Sep 30, 2005, in forum: Python
    Replies:
    0
    Views:
    248
    Ivan Shevanski
    Sep 30, 2005
Loading...

Share This Page