How to raise warning?

how to raise warning? I would like to show up warning as below

warning: ClassName.methodName(): warning message

···


Szymon Drejewicz

Not a direct answer, but you can test $VERBOSE (or $-v or $-w) to see if
Ruby was started with the -w flag:

def warning(*args)
$stderr.puts(args.join(': ')) if $VERBOSE
end

···

On Wed, Mar 26, 2003 at 06:47:00PM +0900, Szymon Drejewicz wrote:

how to raise warning? I would like to show up warning as below

warning: ClassName.methodName(): warning message