On Wed, 18 Jun 2008, Mark Stosberg wrote:


Just today at YAPC, several CGI::App people met in person and was
saything that something like "catalyst.pl" would be nice for CGI::App.
Then Perrin mentioned it would be nice to have a Module::Starter plugin
for CGI::App.  As I (belatedly) just discovered today, we already have
one!

Module::Starter::Plugin::CGIApp is on CPAN now.


Regretfully my plans to attend YAPC fell through. One of the things I was hoping to do is to meet up with other CGI::App people and ask for suggestions to improve M::S::P::CGIApp.

It could be a little clearer how to use it. Here's an example that
worked for me:

MODULE_TEMPLATE_DIR=/usr/local/share/perl/5.8.8/Module/Starter/Plugin/CGIApp/templates/
  module-starter --plugin Module::Starter::Simple --plugin 
Module::Starter::Plugin::Template --plugin Module::Starter::Plugin::CGIApp 
--module=MyApp --author=markstos [EMAIL PROTECTED]


I define options in a config file called ~/.module-starter/cgiapp/config (I have a different config for non-CGIApp modules) and then call
module-starter like this:

MODULE_STARTER_DIR=~/.module-starter/cgiapp module-starter --module Module::Name

This is a nice start, but could be improved in a couple way:

- The default template directory should work automatically.

- "--template_dir" should work as alternative to the env variable,


You can set template_dir in the config file. I recommend copying the default templates and customizing them with your own style. E.g.

template_dir: ~/.module-starter/cgiapp/templates

- The plugins shouldn't have to be named.


You can specify plugins in your config like so:

plugins: Module::Starter::Simple Module::Starter::Plugin::Template 
Module::Starter::Plugin::CGIApp


Then, if my author and e-mail are in a config file as the should be,
that leaves only one argument left: the module name.


Yes they can be included in the config too as well.

author: Jaldhar H. Vyas
email: [EMAIL PROTECTED]

I also have:

builder: Module::Build

Unfortunately the module-starter script is not extensible. Ricardo was talking about reimplementing it using App::Command but I don't think he has got around to it yet. Which is too bad because I think it would be neat to have a --with-plugins option (and config setting) so you could
do e.g.:

--with-plugins=dbh,session,redirect

etc. to get your favorite CGI::App plugins added to the module skeleton.

One more point of feedback:

I thought it would be useful if the application when ahead and created
www/cgi-bin/myapp.cgi

Ideally, so it could be immediately run and tested.

Yes for the next go around I was thinking of adding this and a script that uses CGI::Application::Server to run it.

Thanks for the feedback Mark. Please feel free to file bugs in rt id you have other ideas (or patches or documentation!)


--
Jaldhar H. Vyas <[EMAIL PROTECTED]>

#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################

Reply via email to