/usr/share/perl5/Module/Starter/Plugin/TT2.pm is in libmodule-starter-plugin-tt2-perl 0.125-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | use warnings;
use strict;
package Module::Starter::Plugin::TT2;
our $VERSION = '0.125';
use Template;
=head1 NAME
Module::Starter::Plugin::TT2 - TT2 templates for Module::Starter::Template
=head1 VERSION
version 0.125
=head1 SYNOPSIS
use Module::Starter qw(
Module::Starter::Simple
Module::Starter::Plugin::Template
Module::Starter::Plugin::TT2
...
);
Module::Starter->create_distro( ... );
=head1 DESCRIPTION
This Module::Starter plugin is intended to be loaded after
Module::Starter::Plugin::Template. It implements the C<renderer> and C<render>
methods, required by the Template plugin. The methods are implemented with
Template Toolkit.
=head1 EXAMPLES
This module's distribution includes a directory, C<templates/dir>, and a file
C<templates/inline> that contain stock templates for use with the InlineStore
and DirStore plugins. On Debian systems these files are installed in
C</usr/share/doc/libmodule-starter-plugin-tt2-perl/examples>. The module
itself contains default templates for the ModuleStore plugin in its data
section.
=head1 USAGE
This module is meant to be used with the template stores in the SimpleStore
distribution (although you could certainly write your own template store). If
you only want to use the built-in templates, you could have lines like this in
your config file (C<~/.module-starter/config>):
author: Lord Poncemby
email: ponce@peerage.eng
plugins: Module::Starter::Simple Module::Starter::Plugin::Template
Module::Starter::Plugin::ModuleStore Module::Starter::Plugin::TT2
template_module: Module::Starter::Plugin::TT2
(Where the plugins line is one line.) This tells Module::Starter to look for
the templates in the data section of Module::Starter::Plugin::TT2, which isn't
very interesting, since you'll end up getting the same effect as if you'd just
used Module::Starter without plugins.
To override this behavior, you'd instruct Module::Starter to look somewhere
else, either by changing the C<template_module> setting, changing the
MODULE_TEMPLATE_MODULE environment variable, or using a different template
store altogether (q.v., SimpleStore or other plugins).
If you need to send parameters to the L<Template> constructor, put them
in the C<template_parms> parameter to the C<create_distro> method. It must
be a hash reference.
=head1 METHODS
=head2 C<< renderer >>
As implemented, this method just creates a new Template Toolkit engine and
stores it in the Module::Starter object.
=cut
sub renderer {
my ($self) = @_;
my $conf = $self->{template_parms} || {};
my $renderer = Template->new($conf);
}
=head2 C<< render( $template, \%options ) >>
This method passes the given template contents and options to the TT2 renderer
and returns the resulting document.
=cut
sub render {
my $self = shift;
my $template = shift;
my $options = shift;
my $output;
$options->{self} = $self;
$options->{year} = $self->_thisyear;
$self->renderer->process(\$template, $options, \$output);
return $output;
}
=head1 AUTHOR
Ricardo SIGNES, C<< <rjbs@cpan.org> >>
=head1 COPYRIGHT
Copyright 2004-2006 Ricardo SIGNES, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=cut
1;
__DATA__
___Module.pm___
package [%module%];
use warnings;
use strict;
=head1 NAME
[%module%] - The fantastic new [%module%]!
=head1 VERSION
version 0.001
=cut
our $VERSION = '0.001';
=head1 SYNOPSIS
Quick summary of what the module does.
Perhaps a little code snippet.
use [%module%];
my $foo = [%module%]->new;
...
=head1 EXPORT
A list of functions that can be exported. You can delete this section
if you don't export anything, such as for a purely object-oriented module.
=head1 FUNCTIONS
=head2 function1
=cut
sub function1 {
}
=head2 function2
=cut
sub function2 {
}
=head1 AUTHOR
[%self.author%], C<< <[%self.email%]> >>
=head1 BUGS
Please report any bugs or feature requests to
C<bug-[%rtname%]@rt.cpan.org>, or through the web interface at
L<http://rt.cpan.org>. I will be notified, and then you'll automatically be
notified of progress on your bug as I make changes.
=head1 COPYRIGHT & LICENSE
Copyright [%year%] [%self.author%], All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=cut
1; # End of [%module%]
___Makefile.PL___
use strict;
use warnings;
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => '[%main_module%]',
AUTHOR => '[% self.author %] <[% self.email %]>',
VERSION_FROM => '[%main_pm_file%]',
ABSTRACT_FROM => '[%main_pm_file%]',
LICENSE => 'perl',
PL_FILES => {},
PREREQ_PM => {
'Test::More' => 0,
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => '[%self.distro%]-*' },
);
___MI_Makefile.PL___
use inc::Module::Install;
name '[% self.distro %]';
all_from '[% main_pm_file %]';
author '[% self.author %] <[% self.email %]>';
build_requires 'Test::More';
WriteAll;
___Build.PL___
use strict;
use warnings;
use Module::Build;
my $builder = Module::Build->new(
module_name => '[%main_module%]',
license => '[%self.license%]',
dist_author => '[%self.author%] <[%self.email%]>',
dist_version_from => '[%main_pm_file%]',
requires => {
'Test::More' => 0,
},
add_to_cleanup => [ '[%self.distro%]-*' ],
);
$builder->create_build_script();
___Changes___
Revision history for [%self.distro%]
0.001 Date/time
First version, released on an unsuspecting world.
___README___
[%self.distro%]
The README is used to introduce the module and provide instructions on
how to install the module, any machine dependencies it may have (for
example C compilers and installed libraries) and any other information
that should be provided before the module is installed.
A README file is required for CPAN modules since CPAN extracts the README
file from a module distribution so that people browsing the archive
can use it get an idea of the modules uses. It is usually a good idea
to provide version information here so that people can decide whether
fixes for the module are worth downloading.
INSTALLATION
[%build_instructions%]
COPYRIGHT AND LICENCE
Put the correct copyright and licence information here.
Copyright (C) [%year%] [% self.author %]
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
___pod.t___
use Test::More;
eval "use Test::Pod 1.14";
plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
all_pod_files_ok();
___pod-coverage.t___
use Test::More;
eval "use Test::Pod::Coverage 1.04";
plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage"
if $@;
all_pod_coverage_ok();
___00-load.t___
use Test::More tests => [% modules.size %];
BEGIN {
[% FOREACH module = modules -%]
use_ok('[%module%]');
[% END -%]
}
diag( "Testing [%modules.0%] $[%modules.0%]::VERSION" );
___MANIFEST___
[% FOREACH file = files -%]
[% file %]
[% END -%]
___cvsignore___
blib*
Makefile
Makefile.old
Build
_build*
pm_to_blib*
*.tar.gz
.lwpcookies
.releaserc
[%self.distro%]-*
cover_db
|