On 15/05/05 10:12 +0530, Joshua N Pritikin wrote: > On Sat, 2005-05-14 at 17:48 -0700, Brian Ingerson wrote: > > I took out the call_hooks because it was a woefully underpowered > > abstraction. > > I replaced with an amazing abstraction called Spoon::Hooks that allows you > > to > > add pre/post hook methods to any method in Kwiki. > > Indeed, that sounds like a good idea. :-) > > > PS drop by #kwiki on irc.freenode.net if you need more help. > > I tried but I guess I'm in the wrong time zone (India).
Sorry, I'm not always about. I figured someone would be... > > > What I want to do is change store_content to write to a temporary > > > filename and then atomically rename it into place. This also has the > > > advantage of putting the new & old file on disk for a moment. I'd like > > > to run hooks during this moment so I can generate a diff and email it. > > To get this to work, I still need to split > Spoon::ContentObject::store_content into two methods. > > 1. Instead of storing to $self->file_path, I'd store to > '.'.$self->file_path.'.new'.$$. > > 2. Another method, store_content_commit, would rename the new file to > the appropriate filename. > > Shall I email a patch? You may, but can't you attach these methods as a pre hook and a post hook to page:store_content respectively? Maybe send a patch of what you want, and I'll see if it might be possible another way or not. Cheers, Brian
