Well I spent the weekend working on the Mongrel
(http://mongrel.rubyforge.org) plugin system, and actually ended up
it out into a separate sub-project and releasing it under Ruby or LGPL.
The GemPlugin project is a dynamic plugin system that uses RubyGems to
create, manage, and load plugins. It’s used in Mongrel to allow others
create commands for people to use without having to be a part of the
project. Other systems could use it no problem and it doesn’t depend on
The stuff is kind of funky, but take a look at:
For more information.
== Quick Usage
Plugin Authors do this:
class Snazzy < GemPlugin::Plugin “/commands”
Then place this code in a file they will have RubyGems autorequire (I
Next they need to add the following to whatever Rakefile code you use to
create your gem:
spec.add_dependency(‘gem_plugin’, ‘>= 0.1’)
spec.add_dependency(‘theapp’, ‘>= 0.1’)
spec.autorequire = ‘init.rb’
Plugin Users do this:
$ gem install snazzy_plugin
System Implementers then setup their system to do this:
GemPlugin::Manager.instance.load “theapp” => GemPlugin::INCLUDE
plug = GemPlugin::Manager.instance.create("/commands/snazzy")
And everyone is happy. Read the docs for more information.
== Future Directions
There is already a sample plugin available named mongrel_status which
can check out as an example:
$ gem install mongrel_status
Enjoy! And feedback is welcome.
Zed A. Shaw