New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin System #149
Comments
As a start to this, what about a way to define "hooks" - chunks of Ruby code which can be run before or after various operations. For example, I'd very much like it if I could create a file - say
And after I "glyph init" any project, it would run that code. I think the set of available hooks should include at least the following:
I'm not sure if I have the Ruby metaprogramming skills to tackle this idea on my own, but I'd be happy to collaborate on such a feature. Also, it might make sense to create the hooks file as |
It definitely sounds interesting and very doable! I didn't think of hooks originally, mainly because you can define your own commands and rake tasks, but sometimes you may want to extend the existing commands, that's true, and it would be much easier in this way. Actually this doesn't seem to relate to what I had in mind for a plugin system, so I created a separate feature for this: see #187. Regarding the global configuration file, for now it's in ~/.glyphrc -- something I'm not too keen of, so moving it to ~/.glyph/config.yml would definitely be better, especially if you have other "global" files in mind, like hooks.rb. Questions
|
I think your comments about project hooks make sense, and I think Glyph::PROJECT/lib/hooks.rb is probably a very sensible place for them. As for possible use cases, here are some ideas I could think of:
Those are just a few examples off the top of my head. |
Yes, all the examples definitely makes sense. If you want, you can try implementing this yourself, otherwise I'll definitely add it anyway, just let me know! |
Glyph should support a simple plugin architecture.
The text was updated successfully, but these errors were encountered: