[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sup-talk] Hints on debugging hooks



Hi,

Excerpts from Shadowfirebird's message of 2010-10-19 11:18:03 +0200:
> Can someone give me some hints on debugging hooks? For example, is there an
> easy way to get just one message object in the console, so I can play with
> it?  
Yep, there is:
$ irb1.9.1 -Ilib
>> require 'sup'
>> include Redwood
>> start
>> i = Index.init
>> i.load

If you have some message ID you want to load, you can do so. If you don’t know
which one to load, you could print them all (beware, on a big index, this of
course will be a very long listing):
>> i.each_id { |i| puts i }

To actually load the message:
>> m = i.build_message("201010062050.45778.kern@sibbald.com")

You can then play with the masseg as you like.

> Is it true that the before-add-message hook can die silently if my code is
> bad?  Will wrapping my code in begin ... rescue ... end guarantee that this
> doesn't happen?
Not sure about that. At least in the system log (press ; to open the buffer
manager) it will leave a trace about hooks dying, but I don’t know if it’s
display very obviously when you’re not having an eye on the log.

Best regards,
Michael
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk