* [sup-talk] Hooks?
@ 2007-09-01 23:47 Magnus Therning
2007-09-02 6:28 ` William Morgan
0 siblings, 1 reply; 2+ messages in thread
From: Magnus Therning @ 2007-09-01 23:47 UTC (permalink / raw)
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.
Beyond that it's a little difficult for someone who's never read Ruby
source before to figure things out. Can anyone offer any example on how
to implement a hook?
--
Magnus Therning (OpenPGP: 0xAB4DFBA4)
magnus?therning?org Jabber: magnus?therning?gmail?com
http://therning.org/magnus
As we enjoy great advantages from the inventions of others we should
be glad of an opportunity to serve others by any invention of
ours, and this we should do freely and generously.
-- Benjamin Franklin
^ permalink raw reply [flat|nested] 2+ messages in thread
* [sup-talk] Hooks?
2007-09-01 23:47 [sup-talk] Hooks? Magnus Therning
@ 2007-09-02 6:28 ` William Morgan
0 siblings, 0 replies; 2+ messages in thread
From: William Morgan @ 2007-09-02 6:28 UTC (permalink / raw)
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 <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-09-02 6:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-01 23:47 [sup-talk] Hooks? Magnus Therning
2007-09-02 6:28 ` William Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox