Module::Starter::Plugin::CGIApp - template based module starter for CGI apps.
use Module::Starter qw( Module::Starter::Plugin::CGIApp ); Module::Starter->create_distro(%args);
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.
This document describes version 0.41
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.
This method calls the new supermethod from Module::Starter::Plugin::Simple and then initializes the template store. (See templates.)
new
templates
This method works as advertised in Module::Starter.
This method creates a LICENSE file in the distribution's directory which can hold the distribution's license terms.
LICENSE
This method creates a MANIFEST.SKIP file in the distribution's directory so that unneeded files can be skipped from inclusion in the distribution.
MANIFEST.SKIP
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.
This method creates a perlcriticrc in the distribution's author test directory so that the behavior of perl-critic.t can be modified.
perlcriticrc
perl-critic.t
This method creates server.pl in the distribution's root directory.
server.pl
This method creates a bunch of *.t files. @modules is a list of all modules in the distribution.
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.
Foo-Bar
lib/Foo/Bar/templates
Note the files will just be copied over not rendered.
This method creates a bunch of *.t files for author tests. @modules is a list of all modules in the distribution.
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:
Module::Starter
$foo_item
TMPL_LOOP
$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>
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.
MODULE_TEMPLATE_DIR
template_dir
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.
Implements the creation of a Changes file.
Changes
Implements the creation of a LICENSE 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.
Implements the creation of a MANIFEST.SKIP 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.
Implements the creation of a README file.
README
Implements the creation of a perlcriticrc file.
Implements the creation of a server.pl file.
Implements the creation of test files. @modules is a list of all the modules in the distribution.
Implements the creation of template files.
Implements the creation of test files for author tests. @modules is a list of all the modules in the distribution.
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. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-module-starter-plugin-cgiapp at rt.cpan.org
Jaldhar H. Vyas, <jaldhar at braincells.com>
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.
cgiapp-starter, titanium-starter, Module::Starter, Module::Starter::Simple, Module::Starter::Plugin::Template. CGI::Application, Titanium, HTML::Template
To install Module::Starter::Plugin::CGIApp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Module::Starter::Plugin::CGIApp
CPAN shell
perl -MCPAN -e shell install Module::Starter::Plugin::CGIApp
For more information on module installation, please visit the detailed CPAN module installation guide.