[Mongrel] Test out the upcoming plugins stuff for me

Zed Shaw zedshaw at zedshaw.com
Sun Mar 5 19:36:16 EST 2006


On 3/5/06 7:14 PM, "Luis Lavena" <luislavena at gmail.com> wrote:

> Hello Zed,
> 
> Reporting:
> 
> Tested it here (win32) without problems, guess mswin32 gem will follow soon
> ;-)
> 
Great, yeah I'll look at how to bring it in.  Probably modify the
mongrel_rails_svc,

> With this plugin system in place, we have plans to create standalone
> plugins for handlers?
>
Yes, right now it just works for commands since that's the only place we're
using plugins.  Eventually you'll be able to write a plugin gem that
includes handlers and filters (when those are available) and then people can
include them into their mongrel setup.
 
> If so, mongrel_rails_service could be changed to mongrel_service and
> load "/handlers" for rails, nitro, camping, etc.
>

That would be the eventual direction, but right now I'm just focusing on
rails.  I'm thinking this would be the process:

1)  Imagine I have a StatisticsHandler that displays some basic statistics
about a running mongrel rails setup.
2)  I package this up as mongrel_statistics-0.1.gem and put it on rubyforge.
3)  Now you want to use my mongrel_statistics so you do:

  gem install mongrel_statistics

4)  This plugin now loads whenever you start mongrel.
5)  You then just need to "configure" your mongrel rails setup so that this
new plugin is connected to some URI.  (this is the next part I'm writing).
6)  You modify a config/mongrel.yml file and add this line:

  /mystats
    handlers:
      - /handlers/statistics
7) Now when you go to /mystats you'll get the StatisticsHandler.

The example you're playing with now is a command that sits at
/commands/status and so mongrel_rails knows how to load it.  It's a similar
process except the commands don't need to be put on any URI.

Does that make sense?

Zed



More information about the Mongrel-users mailing list