1Module::Starter::PluginU:s:eCrGICAopnpt(r3i)buted Perl DMoocduumleen:t:aSttiaornter::Plugin::CGIApp(3)
2
3
4
6 Module::Starter::Plugin::CGIApp - template based module starter for CGI
7 apps.
8
10 use Module::Starter qw(
11 Module::Starter::Simple
12 Module::Starter::Plugin::Template
13 Module::Starter::Plugin::CGIApp
14 );
15
16 Module::Starter->create_distro(%args);
17
19 This is a plugin for Module::Starter that builds you a skeleton
20 CGI::Application module with all the extra files needed to package it
21 for CPAN. You can customize the output using HTML::Template.
22
24 Version 0.30
25
27 This module subclasses Module::Starter::Plugin::Template which in turn
28 subclasses Module::Starter::Simple. This document only describes the
29 methods which are overriden from those modules or are new.
30
31 Only developers looking to extend this module need to read this. If you
32 just want to use Module::Starter::Plugin::CGIApp, read the docs for
33 cgiapp-starter or titanium-starter instead.
34
36 new ( %args )
37 This method calls the "new" supermethod from
38 Module::Starter::Plugin::Template and then initializes the template
39 store and renderer. (See "templates" and "renderer" below.)
40
41 create_distro ( %args )
42 This method works as advertised in Module::Starter.
43
44 create_LICENSE( )
45 This method creates a "LICENSE" file in the distribution's directory
46 which can hold the distribution's license terms.
47
48 create_MANIFEST_SKIP( )
49 This method creates a "MANIFEST.SKIP" file in the distribution's
50 directory so that unneeded files can be skipped from inclusion in the
51 distribution.
52
53 create_modules( @modules )
54 This method will create a starter module file for each module named in
55 @modules. It is only subclassed from Module::Starter::Simple here so
56 we can change the rtname tmpl_var to be the distro name instead of the
57 module name.
58
59 create_perlcriticrc( )
60 This method creates a "perlcriticrc" in the distribution's test
61 directory so that the behavior of "perl-critic.t" can be modified.
62
63 create_server_pl( )
64 This method creates "server.pl" in the distribution's root directory.
65
66 create_t( @modules )
67 This method creates a bunch of *.t files. @modules is a list of all
68 modules in the distribution.
69
70 create_tmpl( )
71 This method takes all the template files ending in .html (representing
72 HTML::Template's and installs them into a directory under the distro
73 tree. For instance if the distro was called "Foo-Bar", the templates
74 would be installed in "lib/Foo/Bar/templates".
75
76 Note the files will just be copied over not rendered.
77
78 render( $template, \%options )
79 This method is subclassed from Module::Starter::Plugin::Template.
80
81 It is given an HTML::Template and options and returns the resulting
82 document.
83
84 Data in the "Module::Starter" object which represents a reference to an
85 array @foo is transformed into an array of hashes with one key called
86 $foo_item in order to make it usable in an HTML::Template "TMPL_LOOP".
87 For example:
88
89 $data = ['a'. 'b', 'c'];
90
91 would become:
92
93 $data = [
94 { data_item => 'a' },
95 { data_item => 'b' },
96 { data_item => 'c' },
97 ];
98
99 so that in the template you could say:
100
101 <tmpl_loop data>
102 <tmpl_var data_item>
103 </tmpl_loop>
104
105 renderer ( )
106 This method is subclassed from Module::Starter::Plugin::Template but
107 doesn't do anything as the actual template is created by "render" in
108 this implementation.
109
110 templates ( )
111 This method is subclassed from Module::Starter::Plugin::Template.
112
113 It reads in the template files and populates the object's templates
114 attribute. The module template directory is found by checking the
115 "MODULE_TEMPLATE_DIR" environment variable and then the config option
116 "template_dir".
117
118 Changes_guts
119 Implements the creation of a "Changes" file.
120
121 LICENSE_guts
122 Implements the creation of a "LICENSE" file.
123
124 MANIFEST_SKIP_guts
125 Implements the creation of a "MANIFEST.SKIP" file.
126
127 perlcriticrc_guts
128 Implements the creation of a "perlcriticrc" file.
129
130 server_pl_guts
131 Implements the creation of a "server.pl" file.
132
133 t_guts
134 Implements the creation of test files.
135
136 tmpl_guts
137 Implements the creation of template files.
138
140 Please report any bugs or feature requests to
141 "bug-module-starter-plugin-cgiapp at rt.cpan.org", or through the web
142 interface at <http://rt.cpan.org>. I will be notified, and then you'll
143 automatically be notified of progress on your bug as I make changes.
144
146 Jaldhar H. Vyas, <jaldhar at braincells.com>
147
149 Copyright (C) 2010, Consolidated Braincells Inc. All Rights Reserved.
150
151 This distribution is free software; you can redistribute it and/or
152 modify it under the terms of either:
153
154 a) the GNU General Public License as published by the Free Software
155 Foundation; either version 2, or (at your option) any later version, or
156
157 b) the Artistic License version 2.0.
158
159 The full text of the license can be found in the LICENSE file included
160 with this distribution.
161
163 cgiapp-starter, titanium-starter, Module::Starter,
164 Module::Starter::Simple, Module::Starter::Plugin::Template.
165 CGI::Application, Titanium, HTML::Template
166
167
168
169perl v5.12.1 2010-07-26Module::Starter::Plugin::CGIApp(3)