From mboxrd@z Thu Jan 1 00:00:00 1970 From: wmorgan-sup@masanjin.net (William Morgan) Date: Sat, 01 Sep 2007 23:28:52 -0700 Subject: [sup-talk] Hooks? In-Reply-To: <1188690036-sup-8770@tatooine> References: <1188690036-sup-8770@tatooine> Message-ID: <1188714270-sup-4582@south> Excerpts from Magnus Therning's message of Sat Sep 01 16:47:03 -0700 2007: > There seems to be extended support for inserting hooks in sup. > However, any sort of hint as to how to add a hook is missing. I > assume they have to be written in Ruby, they should probably live in > ~/.sup/hooks. Hooks were added just a couple SVN revisions ago so documentation isn't great. Running sup -l will give you a list of possible hooks and their corresponding locations on disk. Here's my current set of hooks (and if you search the list archives I've posted a couple more examples): $ head .sup/hooks/*.rb ==> .sup/hooks/before-poll.rb <== if (@last_fetchmail_time || Time.at(0)) < Time.now - 60 say "Running fetchmail..." system "fetchmail >& /dev/null" say "Done running fetchmail." end @last_fetchmail_time = Time.now ==> .sup/hooks/mime-decode.rb <== unless sibling_types.member? "text/plain" case content_type when "text/html" `/usr/bin/w3m -dump -T #{content_type} '#{filename}'` end end ==> .sup/hooks/signature.rb <== "William <#{from_email}>" -- William