Hi folks, I''ve been working on the plugins system this weekend and I think I''ve nailed it down. The system will basically be able to load gems that are configured right to be plugins. It''ll do it fairly dynamically and shouldn''t require any configuration from the end user other than to install the gem. Doing this though will involve a bit of surgery on the svn repo since I''ve moved the mongrel/plugins.rb file into it''s own complete little gem and project. Before I do this I want to make sure everything works for people from an end user point of view. If you all could hit http://zedshaw.homelinux.org:3000/files and follow the instructions in "test_for_me.txt" file I''d appreciate it. If it all works for everyone then I''ll do a similar setup for the win32 stuff and a couple of sample plugins. Thanks! Zed
Hello Zed, Reporting: Tested it here (win32) without problems, guess mswin32 gem will follow soon ;-) With this plugin system in place, we have plans to create standalone plugins for handlers? If so, mongrel_rails_service could be changed to mongrel_service and load "/handlers" for rails, nitro, camping, etc. Thats the idea? I quite don''t follow... Let me now. Luis On 3/5/06, Zed Shaw <zedshaw at zedshaw.com> wrote:> Hi folks, > > I''ve been working on the plugins system this weekend and I think I''ve nailed > it down. The system will basically be able to load gems that are configured > right to be plugins. It''ll do it fairly dynamically and shouldn''t require > any configuration from the end user other than to install the gem. > > Doing this though will involve a bit of surgery on the svn repo since I''ve > moved the mongrel/plugins.rb file into it''s own complete little gem and > project. Before I do this I want to make sure everything works for people > from an end user point of view. > > If you all could hit http://zedshaw.homelinux.org:3000/files and follow the > instructions in "test_for_me.txt" file I''d appreciate it. If it all works > for everyone then I''ll do a similar setup for the win32 stuff and a couple > of sample plugins. > > Thanks! > > Zed > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >
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
Yeah, now it does ;-) Ok, so we need to adapt/transform the mongrel_rails_service/svc to use this approach? I''ll investigate if you want me to. But will be out of town until wednesday. Later, Luis On 3/5/06, Zed Shaw <zedshaw at zedshaw.com> wrote:> 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 > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >
I''ll do it. It''ll be my chance to learn the code you wrote. Anyway, I broke it. :-) Zed On 3/5/06 9:31 PM, "Luis Lavena" <luislavena at gmail.com> wrote:> Yeah, now it does ;-) > > Ok, so we need to adapt/transform the mongrel_rails_service/svc to use > this approach? I''ll investigate if you want me to. But will be out of > town until wednesday. > > Later, > >