how to ignore warning

Discussion in 'Ruby' started by Pokkai Dokkai, Oct 11, 2007.

  1. Pokkai Dokkai, Oct 11, 2007
    #1
    1. Advertising

  2. Pokkai Dokkai

    Konrad Meyer Guest

    --nextPart4556932.xkjDy9Dhri
    Content-Type: text/plain;
    charset="utf-8"
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: inline

    Quoth Pokkai Dokkai:
    > how to ignore warning messages in ruby (when executing ruby code)


    Close your eyes and tap your heels thrice.
    No, really, ignoring things is as easy as not looking at them. (In all=20
    likelihood you should fix your code to not have warnings instead.)

    Regards,
    =2D-=20
    Konrad Meyer <> http://konrad.sobertillnoon.com/

    --nextPart4556932.xkjDy9Dhri
    Content-Type: application/pgp-signature; name=signature.asc
    Content-Description: This is a digitally signed message part.

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.7 (GNU/Linux)

    iD8DBQBHDZf0CHB0oCiR2cwRAqVcAKDV4DXbcgpBMTwPhVEERar3/a0YKQCdG19K
    +b9s3GD77BwalkZRhjMiuno=
    =gcF6
    -----END PGP SIGNATURE-----

    --nextPart4556932.xkjDy9Dhri--
     
    Konrad Meyer, Oct 11, 2007
    #2
    1. Advertising

  3. On 11 Oct 2007, at 12:26, Konrad Meyer wrote:

    > Quoth Pokkai Dokkai:
    >> how to ignore warning messages in ruby (when executing ruby code)

    >
    > Close your eyes and tap your heels thrice.
    > No, really, ignoring things is as easy as not looking at them. (In all
    > likelihood you should fix your code to not have warnings instead.)


    I agree with Konrad that you should probably fix warnings rather than
    ignore, but -W is the command line flag you want. -W1 is standard, -
    W2 is verbose, -W0 is no warnings whatsoever.

    Alex Gutteridge

    Bioinformatics Center
    Kyoto University
     
    Alex Gutteridge, Oct 11, 2007
    #3
  4. Alex Gutteridge wrote:

    > I agree with Konrad that you should probably fix warnings rather than
    > ignore, but -W is the command line flag you want. -W1 is standard, -
    > W2 is verbose, -W0 is no warnings whatsoever.
    >
    > Alex Gutteridge
    >
    > Bioinformatics Center
    > Kyoto University


    thank you Alex
    --
    Posted via http://www.ruby-forum.com/.
     
    Pokkai Dokkai, Oct 11, 2007
    #4
  5. Alex Gutteridge wrote:
    > -W is the command line flag you want. -W1 is standard, -
    > W2 is verbose, -W0 is no warnings whatsoever.


    Is there a possibility to ignore warnings dynamically? - I mean,
    sometimes it's helpful to redefine constants, which will always produce
    a warning. I want to suppress warnings for these lines only.

    Wolfgang Nádasi-Donner
    --
    Posted via http://www.ruby-forum.com/.
     
    Wolfgang Nádasi-Donner, Oct 11, 2007
    #5
  6. Hi,

    Am Donnerstag, 11. Okt 2007, 12:48:22 +0900 schrieb Alex Gutteridge:
    > -W1 is standard, -W2 is
    > verbose, -W0 is no warnings whatsoever.


    Or set one of the variables $-v, $-w, $VERBOSE to 'nil'.

    Option $-v
    -W0 nil
    -W1 false
    -W2 true

    Bertram


    --
    Bertram Scharpf
    Stuttgart, Deutschland/Germany
    http://www.bertram-scharpf.de
     
    Bertram Scharpf, Oct 11, 2007
    #6
  7. Hi,

    Am Donnerstag, 11. Okt 2007, 19:22:31 +0900 schrieb Wolfgang N=E1dasi-Donne=
    r:
    > Alex Gutteridge wrote:
    > > -W is the command line flag you want. -W1 is standard, -
    > > W2 is verbose, -W0 is no warnings whatsoever.

    >=20
    > Is there a possibility to ignore warnings dynamically? - I mean,=20
    > sometimes it's helpful to redefine constants, which will always produce=

    =20
    > a warning. I want to suppress warnings for these lines only.



    irb(main):001:0> X =3D "x"
    =3D> "x"
    irb(main):002:0> class Object ; remove_const :X ; end
    =3D> "x"
    irb(main):003:0> X
    NameError: uninitialized constant X
    from (irb):3
    irb(main):004:0> X =3D "y"
    =3D> "y"
    irb(main):005:0>


    Bertram


    --=20
    Bertram Scharpf
    Stuttgart, Deutschland/Germany
    http://www.bertram-scharpf.de
     
    Bertram Scharpf, Oct 11, 2007
    #7
  8. Bertram Scharpf wrote:
    > irb(main):001:0> X = "x"
    > => "x"
    > irb(main):002:0> class Object ; remove_const :X ; end
    > => "x"
    > irb(main):003:0> X
    > NameError: uninitialized constant X
    > from (irb):3
    > irb(main):004:0> X = "y"
    > => "y"
    > irb(main):005:0>


    Well - it looks fine, because it's no dirty trick.

    Wolfgang Nádasi-Donner
    --
    Posted via http://www.ruby-forum.com/.
     
    Wolfgang Nádasi-Donner, Oct 11, 2007
    #8
  9. On 10/10/07, Konrad Meyer <> wrote:
    > Quoth Pokkai Dokkai:
    > > how to ignore warning messages in ruby (when executing ruby code)

    >
    > Close your eyes and tap your heels thrice.
    > No, really, ignoring things is as easy as not looking at them.


    Or cover your head with your towel, rubyists should ALWAYS have their
    towel handy.

    And as the Hitchhiker's Guide to Ruby explains this is also the best
    defense against being eaten by the ravenous bugblatter beast of Traal!
    --
    Rick DeNatale

    My blog on Ruby
    http://talklikeaduck.denhaven2.com/
     
    Rick DeNatale, Oct 11, 2007
    #9
  10. Bertram Scharpf wrote:
    > Hi,
    >
    > Am Donnerstag, 11. Okt 2007, 19:22:31 +0900 schrieb Wolfgang Nádasi-Donner:
    >> Alex Gutteridge wrote:
    >>> -W is the command line flag you want. -W1 is standard, -
    >>> W2 is verbose, -W0 is no warnings whatsoever.

    >> Is there a possibility to ignore warnings dynamically? - I mean,
    >> sometimes it's helpful to redefine constants, which will always produce
    >> a warning. I want to suppress warnings for these lines only.

    >
    >
    > irb(main):001:0> X = "x"
    > => "x"
    > irb(main):002:0> class Object ; remove_const :X ; end
    > => "x"
    > irb(main):003:0> X
    > NameError: uninitialized constant X
    > from (irb):3
    > irb(main):004:0> X = "y"
    > => "y"
    > irb(main):005:0>


    Yuck.

    I've pushed for structured warnings in the past, but it has fallen on
    deaf ears.

    See:

    http://osdir.com/ml/lang.ruby.sydney.devel/2005-10/msg00009.html
    http://osdir.com/ml/lang.ruby.sydney.devel/2005-10/msg00010.html
    http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/50105

    Regards,

    Dan
     
    Daniel Berger, Oct 16, 2007
    #10
  11. Rick Denatale wrote:
    > Or cover your head with your towel, rubyists should ALWAYS have their
    > towel handy.
    >
    > And as the Hitchhiker's Guide to Ruby explains this is also the best
    > defense against being eaten by the ravenous bugblatter beast of Traal!
    > --
    > Rick DeNatale
    >
    > My blog on Ruby
    > http://talklikeaduck.denhaven2.com/


    likin' it :)
    --
    Posted via http://www.ruby-forum.com/.
     
    Shai Rosenfeld, Oct 16, 2007
    #11
  12. Pokkai Dokkai

    Bob Asdflkj Guest

    Konrad Meyer wrote:
    > Quoth Pokkai Dokkai:
    >> how to ignore warning messages in ruby (when executing ruby code)

    >
    > Close your eyes and tap your heels thrice.
    > No, really, ignoring things is as easy as not looking at them. (In all
    > likelihood you should fix your code to not have warnings instead.)
    >
    > Regards,


    Ruby will spit out warnings for white space - with no coding errors,

    and many programming languages output warnings for using anything but
    the most basic techniques

    so weather you're a novice or a seasoned veteran there are valid reasons
    to suppress warnings: after all, it does have W levels
    --
    Posted via http://www.ruby-forum.com/.
     
    Bob Asdflkj, Nov 19, 2009
    #12
    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. Pete Becker
    Replies:
    0
    Views:
    1,406
    Pete Becker
    Feb 10, 2005
  2. david wolf

    how to make ant ignore warning

    david wolf, Jul 5, 2006, in forum: Java
    Replies:
    1
    Views:
    1,739
    Chris
    Jul 6, 2006
  3. B. Williams

    warning C4267 and warning C4996

    B. Williams, Oct 26, 2006, in forum: C++
    Replies:
    17
    Views:
    2,677
  4. सिदà¥à¤§à¤¾à¤°à¥à¤¥

    How to ignore obsolete warning

    सिदà¥à¤§à¤¾à¤°à¥à¤¥, Mar 24, 2009, in forum: ASP .Net
    Replies:
    2
    Views:
    1,823
    George
    Mar 24, 2009
  5. Rob Meade
    Replies:
    6
    Views:
    297
    Rob Meade
    Mar 1, 2004
Loading...

Share This Page