Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: Michael Stapelberg <michael+sup@stapelberg.de>
To: sup-talk <sup-talk@rubyforge.org>
Subject: Re: [sup-talk] Hints on debugging hooks
Date: Tue, 19 Oct 2010 19:31:55 +0200	[thread overview]
Message-ID: <1287508635-sup-7410@midna.zekjur.net> (raw)
In-Reply-To: <1287479408-sup-4846@blake>

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

  reply	other threads:[~2010-10-19 17:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19  9:18 Shadowfirebird
2010-10-19 17:31 ` Michael Stapelberg [this message]
2010-10-19 18:18 ` Hamish D
2010-10-20 21:00 ` Shadowfirebird

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1287508635-sup-7410@midna.zekjur.net \
    --to=michael+sup@stapelberg.de \
    --cc=sup-talk@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox