From: Dan Rathbun Date: 2010-03-17T20:01:04+09:00 Subject: [ruby-core:28711] [Bug #2975] Kernel.warn always writes despite $VERBOSE value Issue #2975 has been updated by Dan Rathbun. On 03/17/2010 06:42 AM - Nobuyoshi Nakada --> said: "It's a document issue." I agree.. that there IS an existing doc issue. But that's only a SMALL part of the issue. Proposing: (A) Change and adition of module Kernel warning methods: (1) Change name of Kernel.warn to Kernel.warn! [rb_warn_always, see (B)(3)] Add Typechecking, and return boolean true result. (2) Add 2 methods to module Kernel, with Typechecking, and return boolean result. (a) Kernel.warn [rb_warn_not_nil, see (B)(1)] (b) Kernel.warn? [rb_warn_verbose, see (B)(2)] (B) C core function wrappers (work as per Ruby given above): (1) Kernel.warn BOOL rb_warn_not_nil (2) Kernel.warn? BOOL rb_warn_verbose wrapper for VOID rb_warning (3) Kernel.warn! BOOL rb_warn_always wrapper for VOID rb_warn The ALTERNATIVE, is to add a 2nd parameter to the existing Kernel.warn method: (and revise as by combining the 3 Ruby methods given above.) warn( message, warnIf = :always ) warnIf may also be :notnil | :verbose ---------------------------------------- http://redmine.ruby-lang.org/issues/show/2975 ---------------------------------------- http://redmine.ruby-lang.org