[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sup-talk] Before poll hook
Hi everyone,
so sorry for this n00b question but my ruby-fu is really bad: I want to
run offlineimap as a hook before each poll. I checked the code in the
wiki and some code I found in a thread and built my own -very simple- version of it:
$ tail -n 15 ~/.sup/hooks/before-poll.rb
# http://sup.rubyforge.org/wiki/wiki.pl?Hooks
def offlineimap()
cmd = "offlineimap -o -l ~/.offlineimap.log"
`#{cmd} 2>&1`
end
say "Checking if we can run offlineimap..."
if (@last_fetch || Time.at(0)) < Time.now - 120
say "Running offlineimap..."
log offlineimap()
say "Finished offlineimap."
end
@last_fetch = Time.now
I saved it where it should be and -just in case- gave it execution rights for my user.
However I can't say it's running. I don't see any messages in sup's status bar and everytime
I hit Shift+p nothing happens. Needless to say, I have to manually run offlineimap to get the messages.
What am I missing?
TIA,
Mariano
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk