[sup-talk] new in svn: hook system and polling hooks

William Morgan wmorgan-sup at masanjin.net
Sat Aug 18 21:03:57 EDT 2007


I've added a system for hooking user-created code into Sup. (Finally!)

Sup hooks take the form of Ruby scripts, placed in ~/.sup/hooks. Each
hook corresponds to a file in that directory. To see documentation on
the available hooks, just run "sup -l".

Hooks are passed information in the form of local "variables" (really
method calls, so don't try assigning to them). There are two
Sup-specific functions they can call, "say" and "log". "say" will write
a temporary message to the bottom portion of the screen, which is erased
when the hook stops executing. "log" will write a message to the sup
log.

There are only two hooks right now, before-poll and after-poll.
Before-poll should satisfy the desire of fetchmail users and after-poll
should satisfy the desire of all xbiff users.

Future work:
Allow sharing of information between successive invocations via instance
variables; and add lots of hooks (some kind of mime handler is probably
my immediate goal.)

-- 
William <wmorgan-sup at masanjin.net>


More information about the sup-talk mailing list