CGIAPP-STARTER(1p) User Contributed Perl Documentation CGIAPP-STARTER(1p)NAME
cgiapp-starter - creates a skeleton CGI::Application project
SYNOPSIS
cgiapp-starter --module=MyApp --author="Jaldhar H. Vyas" --email=jaldhar@braincells.com
Result:
MyApp
MyApp/Changes
MyApp/lib
MyApp/lib/MyApp.pm
MyApp/LICENSE
MyApp/Makefile.PL
MyApp/MANIFEST.SKIP
MyApp/MANIFEST
MyApp/README
MyApp/server.pl
MyApp/share/templates
MyApp/share/templates/runmode1.html
MyApp/t
MyApp/t/00-signature.t
MyApp/t/01-load.t
MyApp/t/boilerplate.t
MyApp/t/test-app.t
MyApp/t/www
MyApp/t/www/PUT.STATIC.CONTENT.HERE
MyApp/xt
MyApp/xt/perlcriticrc
MyApp/xt/perl-critic.t
MyApp/xt/pod-coverage.t
MyApp/xt/pod.t
Options:
--module=module Module name
--dir=dirname Directory name to create new module in (optional)
--builder=module Build with 'ExtUtils::MakeMaker' or 'Module::Build'
--eumm Same as --builder=ExtUtils::MakeMaker
--mb Same as --builder=Module::Build
--mi Same as --builder=Module::Install
--author=name Author's name (required)
--email=email Author's email (required)
--license=type License under which the module will be distributed
(default is the same license as perl)
--verbose Print progress messages while working
--force Delete pre-existing files if needed
--help Show this message
DESCRIPTION
Set up the skeleton of a CGI::Application-based project, including a module, some templates and some automated tests.
By default the skeleton files will come within a shared directory where Module::Starter::Plugin::CGIApp is stored. See File::ShareDir for
more information on how this works.
CONFIGURATION
cgiapp-starter will look for a configuration file before reading its command line parameters. The default location is
"$HOME/.module-starter/config" but if the MODULE_STARTER_DIR environment variable is set, cgiapp-starter will look for "config" in that
directory.
The configuration file is just a list of names and values, separated by colons. Values that take lists are just space separated. A sample
configuration file might read:
author: Jaldhar H. Vyas
email: jaldhar@braincells.com
template_dir: ~/.module-starter/cgiapp/templates
colors: red green blue
This format may become more elaborate in the future, but a file of this type should remain valid.
perl v5.14.2 2012-05-26 CGIAPP-STARTER(1p)
Check Out this Related Man Page
Module::Starter::Plugin::CGIApp(3pm) User Contributed Perl Documentation Module::Starter::Plugin::CGIApp(3pm)NAME
Module::Starter::Plugin::CGIApp - template based module starter for CGI apps.
SYNOPSIS
use Module::Starter qw(
Module::Starter::Plugin::CGIApp
);
Module::Starter->create_distro(%args);
ABSTRACT
This is a plugin for Module::Starter that builds you a skeleton CGI::Application module with all the extra files needed to package it for
CPAN. You can customize the output using HTML::Template.
VERSION
This document describes version 0.41
DESCRIPTION
This module subclasses Module::Starter::Simple and includes functionality similar to Module::Starter::Plugin::Template. This document only
describes the methods which are overriden from those modules or are new.
Only developers looking to extend this module need to read this. If you just want to use Module::Starter::Plugin::CGIApp, read the docs for
cgiapp-starter or titanium-starter instead.
METHODS
new ( %args )
This method calls the "new" supermethod from Module::Starter::Plugin::Simple and then initializes the template store. (See "templates".)
create_distro ( %args )
This method works as advertised in Module::Starter.
create_LICENSE( )
This method creates a "LICENSE" file in the distribution's directory which can hold the distribution's license terms.
create_MANIFEST_SKIP( )
This method creates a "MANIFEST.SKIP" file in the distribution's directory so that unneeded files can be skipped from inclusion in the
distribution.
create_modules( @modules )
This method will create a starter module file for each module named in @modules. It is only subclassed from Module::Starter::Simple here
so we can change the rtname tmpl_var to be the distro name instead of the module name.
create_perlcriticrc( )
This method creates a "perlcriticrc" in the distribution's author test directory so that the behavior of "perl-critic.t" can be modified.
create_server_pl( )
This method creates "server.pl" in the distribution's root directory.
create_t( @modules )
This method creates a bunch of *.t files. @modules is a list of all modules in the distribution.
create_tmpl( )
This method takes all the template files ending in .html (representing HTML::Template's and installs them into a directory under the distro
tree. For instance if the distro was called "Foo-Bar", the templates would be installed in "lib/Foo/Bar/templates".
Note the files will just be copied over not rendered.
create_xt( @modules )
This method creates a bunch of *.t files for author tests. @modules is a list of all modules in the distribution.
render( $template, \%options )
This method is given an HTML::Template and options and returns the resulting document.
Data in the "Module::Starter" object which represents a reference to an array @foo is transformed into an array of hashes with one key
called $foo_item in order to make it usable in an HTML::Template "TMPL_LOOP". For example:
$data = ['a'. 'b', 'c'];
would become:
$data = [
{ data_item => 'a' },
{ data_item => 'b' },
{ data_item => 'c' },
];
so that in the template you could say:
<tmpl_loop data>
<tmpl_var data_item>
</tmpl_loop>
templates ( )
This method reads in the template files and populates the object's templates attribute. The module template directory is found by checking
the "MODULE_TEMPLATE_DIR" environment variable and then the config option "template_dir".
Build_PL_guts($main_module, $main_pm_file)
This method is called by create_Build_PL and returns text used to populate Build.PL when the builder is Module::Build; $main_pm_file is the
filename of the distribution's main module, $main_module.
Changes_guts
Implements the creation of a "Changes" file.
LICENSE_guts
Implements the creation of a "LICENSE" file.
Makefile_PL_guts($main_module, $main_pm_file)
This method is called by create_Makefile_PL and returns text used to populate Makefile.PL when the builder is ExtUtils::MakeMaker;
$main_pm_file is the filename of the distribution's main module, $main_module.
MANIFEST_SKIP_guts
Implements the creation of a "MANIFEST.SKIP" file.
MI_Makefile_PL_guts($main_module, $main_pm_file)
This method is called by create_MI_Makefile_PL and returns text used to populate Makefile.PL when the builder is Module::Install;
$main_pm_file is the filename of the distribution's main module, $main_module.
module_guts($module, $rtname)
Implements the creation of a "README" file.
README_guts($build_instructions)
Implements the creation of a "README" file.
perlcriticrc_guts
Implements the creation of a "perlcriticrc" file.
server_pl_guts
Implements the creation of a "server.pl" file.
t_guts(@modules)
Implements the creation of test files. @modules is a list of all the modules in the distribution.
tmpl_guts
Implements the creation of template files.
xt_guts(@modules)
Implements the creation of test files for author tests. @modules is a list of all the modules in the distribution.
BUGS
Please report any bugs or feature requests to "bug-module-starter-plugin-cgiapp at rt.cpan.org", or through the web interface at
rt.cpan.org <http://rt.cpan.org>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
AUTHOR
Jaldhar H. Vyas, <jaldhar at braincells.com>
COPYRIGHT
Copyright (C) 2012, Consolidated Braincells Inc. All Rights Reserved.
This distribution is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or
b) the Artistic License version 1.0 or a later version.
The full text of the license can be found in the LICENSE file included with this distribution.
SEE ALSO
cgiapp-starter, titanium-starter, Module::Starter, Module::Starter::Simple, Module::Starter::Plugin::Template. CGI::Application, Titanium,
HTML::Template
perl v5.14.2 2012-05-26 Module::Starter::Plugin::CGIApp(3pm)