[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

suppress ruby warnings during runtime?

warhero

8/24/2007 12:23:00 AM

I've been looking for a way to supress warnings at runtime, not just in
the shebang line.. I've tride setting $VERBOSE = nil but that doesn't
seem to work right. Specifically i'm getting warnings when accessing
Object#id, saying it's deprecated.. is there a way to turn off just
deprecated warnings?

Thanks
--
Posted via http://www.ruby-....

3 Answers

Eric Hodel

8/24/2007 1:28:00 AM

0

On Aug 23, 2007, at 17:22, Aaron Smith wrote:
> I've been looking for a way to supress warnings at runtime, not
> just in
> the shebang line.. I've tride setting $VERBOSE = nil but that doesn't
> seem to work right. Specifically i'm getting warnings when accessing
> Object#id, saying it's deprecated.. is there a way to turn off just
> deprecated warnings?

Change calls from .id to .object_id to turn off this warning.

--
Poor workers blame their tools. Good workers build better tools. The
best workers get their tools to do the work for them. -- Syndicate Wars



Nobuyoshi Nakada

8/24/2007 1:32:00 AM

0

Hi,

At Fri, 24 Aug 2007 09:22:37 +0900,
Aaron Smith wrote in [ruby-talk:266024]:
> I've been looking for a way to supress warnings at runtime, not just in
> the shebang line.. I've tride setting $VERBOSE = nil but that doesn't
> seem to work right. Specifically i'm getting warnings when accessing
> Object#id, saying it's deprecated.. is there a way to turn off just
> deprecated warnings?

Setting $VERBOSE = nil.

$ ruby -v -e id
ruby 1.8.6 (2007-08-21 revision 13127) [i686-linux]
-e:1: warning: Object#id will be deprecated; use Object#object_id

$ ruby -v -e '$VERBOSE=nil;id'
ruby 1.8.6 (2007-08-21 revision 13127) [i686-linux]

--
Nobu Nakada

Johannes Held

8/26/2007 10:42:00 PM

0

Eric Hodel schrieb:
> On Aug 23, 2007, at 17:22, Aaron Smith wrote:
>> I've been looking for a way to supress warnings at runtime, not just in
>> the shebang line.. I've tride setting $VERBOSE = nil but that doesn't
>> seem to work right. Specifically i'm getting warnings when accessing
>> Object#id, saying it's deprecated.. is there a way to turn off just
>> deprecated warnings?
>
> Change calls from .id to .object_id to turn off this warning.
This sounds like rails.1
And the ID of a model is model.id. So you can't change id to object_id.

--
GruÃ?, Johannes
Täglich http://blog... und du fühlst dich gut.