From: Mariano Mara <mariano.mara@gmail.com>
To: sup-talk <sup-talk@rubyforge.org>
Subject: [sup-talk] Before poll hook
Date: Tue, 09 Feb 2010 20:51:29 -0300 [thread overview]
Message-ID: <1265758810-sup-2203@kafka> (raw)
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
next reply other threads:[~2010-02-09 23:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-09 23:51 Mariano Mara [this message]
2010-02-10 13:01 ` Daniel Schoepe
2010-02-10 14:05 ` Mariano Mara
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=1265758810-sup-2203@kafka \
--to=mariano.mara@gmail.com \
--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