Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: Andrew Farrell <afarrell@MIT.EDU>
To: sup-talk <sup-talk@rubyforge.org>
Subject: Re: [sup-talk] before-poll.rb does not appear to be run. Where is PollManager defined?
Date: Wed, 1 Jun 2011 12:18:24 -0700	[thread overview]
Message-ID: <BANLkTimjYPva9mFXrRVcKgU1opk=DXvHhQ@mail.gmail.com> (raw)
In-Reply-To: <1306928873-sup-3234@PrxServer3>


[-- Attachment #1.1: Type: text/plain, Size: 1695 bytes --]

> Name it before-poll.rb
yes, I should have mentioned that I'd done that.

> View the log by...
Thank you! Using this, I found that the problem was that line 12 of the hook
from
http://sup.rubyforge.org/wiki/wiki.pl?TriggeringMailCollection
was using SourceManager.
12 def inbox_sources(sources = SourceManager.sources)
13     sources.find_all { |s| !s.archived? }.sort_by {|s| s.id }
14 end

I replaced SourceManager.sources with Index.usual_sources
And it works.

I've replaced the relevant code in the wiki.

-- Andrew Farrell

On Wed, Jun 1, 2011 at 4:52 AM, Ruthard Baudach <rthrd@web.de> wrote:

> > === Andrew Farrell schrieb am 2011-06-01 05:54: === <
> > I'm trying to add a before-poll.rb hook, but this appears not to be run.
> > At least, it is not running offlineIMAP and if I insert a divide-by-zero,
> > nothing explodes.
> To create a hook, you have to put the hook-name.rb file in the
> .sup/hooks folder, and it should be executed when the hook is called.
>
> No need to go source diving.
>
> You've got a log-line in your before-poll.rb, so you should see it's
> activity in the log buffer.
>
> Just hit ; in inbox-mode, navigate to the line saying log-mode and hit
> <Enter> to view the log buffer.
>
> If your message shows up, the before-poll hook is executed, and does not
> work. Happy debugging (I used to know no Ruby as well when I started
> using sup, and it's still a foreign language to me)
>
> > - I'm inferring that "require 'sup' " is the equivalent of python's "from
> > sup import *"
> Yes, it is.
>
> Ruthard
> _______________________________________________
> sup-talk mailing list
> sup-talk@rubyforge.org
> http://rubyforge.org/mailman/listinfo/sup-talk
>

[-- Attachment #1.2: Type: text/html, Size: 2955 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

      reply	other threads:[~2011-06-01 19:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01  3:54 Andrew Farrell
2011-06-01 11:52 ` Ruthard Baudach
2011-06-01 19:18   ` Andrew Farrell [this message]

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='BANLkTimjYPva9mFXrRVcKgU1opk=DXvHhQ@mail.gmail.com' \
    --to=afarrell@mit.edu \
    --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