From mboxrd@z Thu Jan 1 00:00:00 1970 From: wmorgan-sup@masanjin.net (William Morgan) Date: Sat, 18 Aug 2007 18:03:57 -0700 Subject: [sup-talk] new in svn: hook system and polling hooks Message-ID: <1187484773-sup-6336@south> 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