GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Added a hook after each web interface action, so users can easily extend functionality, like sending emails or logging.
Initial commit of hooks
Changing behaviour for sharing variables
Massive delay, due to massive busy. I'm going to use some 20% time add some tests to this, before I merge it in. This is the kind of functionality I'd end up accidentally breaking.
Tell me if I can help!
As I start to write test for this stuff, I'm wondering if the hooks are at the right level. They all seem to lend themselves to being captured as a middleware. I'm going to call it quits for the day, but I'm proposing a simpler API, with just one hook, for when anything in the state changes (probably triggered by the reindex).
We can then pass params into the callback to provide info on what file has changed, and possibly how it's changed. Just providing the filename for the gem on disk could be enough to work with. If the file is no longer there, it's been deleted. If it is there, it's been modified/created. Either way the action should be to rebuild whatever you had in place already.
Is there a use case you have in mind that this does not cover?
I've done a quick bash at what I was talking about on the basic-hooks branch (4a6e34a). Would this work for you @emoreth?