how to ignore warning messages in ruby (when executing ruby code)
···
--
Posted via http://www.ruby-forum.com/.
how to ignore warning messages in ruby (when executing ruby code)
--
Posted via http://www.ruby-forum.com/.
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,
--
Konrad Meyer <konrad@tylerc.org> http://konrad.sobertillnoon.com/
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
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.)
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!
On 10/10/07, Konrad Meyer <konrad@tylerc.org> 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.
--
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/
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/\.
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/\.
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/\.
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
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 DeNataleMy blog on Ruby
http://talklikeaduck.denhaven2.com/
likin' it
--
Posted via http://www.ruby-forum.com/\.
Hi,
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>
Bertram
Am Donnerstag, 11. Okt 2007, 19:22:31 +0900 schrieb Wolfgang Nádasi-Donner:
--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
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/\.
Bertram Scharpf wrote:
Hi,
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://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/50105
Regards,
Dan
Am Donnerstag, 11. Okt 2007, 19:22:31 +0900 schrieb Wolfgang Nádasi-Donner: