Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] Before poll hook
@ 2010-02-09 23:51 Mariano Mara
  2010-02-10 13:01 ` Daniel Schoepe
  0 siblings, 1 reply; 3+ messages in thread
From: Mariano Mara @ 2010-02-09 23:51 UTC (permalink / raw)
  To: sup-talk

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-10 14:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-09 23:51 [sup-talk] Before poll hook Mariano Mara
2010-02-10 13:01 ` Daniel Schoepe
2010-02-10 14:05   ` Mariano Mara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox