From: Daniel Berger Date: 2007-10-16T20:10:17+09:00 Subject: Re: how to ignore warning 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