From: Austin Ziegler Date: 2003-07-30T09:38:13+09:00 Subject: Re: Warnings? On Wed, 30 Jul 2003 08:54:09 +0900, Michael Davis wrote: > I can appreciate the difficulty, however, I would rather not suppress all > warnings and yet I have code that generates warnings that are okay. Will > it be possible to turn off warnings and then turn them back on again at > runtime? This would at least provide me an option to disable warning > messages during methods that generate warnings. This seems to work, at least in irb: irb(main):001:0> class WarningException < Exception; end irb(main):002:0> module Kernel irb(main):003:1> def warn(m) irb(main):004:2> raise WarningException, m irb(main):005:2> end irb(main):006:1> end irb(main):007:0> warn "Hello" (irb):4:in `warn': Hello (WarningException) from (irb):7:in `irb_binding' from C:/Apps/Ruby18/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' from C:/Apps/Ruby18/lib/ruby/1.8/irb/workspace.rb:52 This, of course, depends on the module using the functionality. It also won't work on rb_warning or rb_warn, obviously. -austin -- austin ziegler * austin@halostatue.ca * Toronto, ON, Canada software designer * pragmatic programmer * 2003.07.29 * 20.31.14