ExtUtils-ModuleMaker-TT
view release on metacpan or search on metacpan
NAME
ExtUtils::ModuleMaker::TT - Makes skeleton modules with Template Toolkit
templates (UNMAINTAINED)
VERSION
version 0.94
UNMAINTAINED
This distribution is no longer maintained as the author no longer uses
or recommends it. If you wish to take it over, please contact the
author.
SYNOPSIS
use ExtUtils::ModuleMaker;
my $mmtt = ExtUtils::ModuleMaker->new (
NAME => 'My::New::Module',
ALT_BUILD => 'ExtUtils::ModuleMaker::TT',
TEMPLATE_DIR => '~/.perltemplates',
);
$mmtt->complete_build();
DESCRIPTION
*Note: ExtUtils::ModuleMaker has changed substantially in recent
releases and ExtUtils::ModuleMaker::TT has similarly changed
substantially to be compatible with these changes. Please report any
bugs you may find.*
This module extends ExtUtils::ModuleMaker to use Template Toolkit 2
(TT2) to build skeleton files for a new module. Templates may either be
default templates supplied within the module or user-customized
templates in a directory specified with the *TEMPLATE_DIR* parameter.
Summary of Features/Enhancements:
* Supports building full module skeletons with all the functionality
of "ExtUtils::ModuleMaker"
* Supports adding a single .pm file (and corresponding .t file) to an
existing module distribution tree
* Supports creating skeleton text for a single method (generally to be
called via a script from within your favorite editor)
* Creates a template directory containing the default templates for
subsequent user customization
* Templates can access any parameter in the ExtUtils::ModuleMaker
object (e.g. $mmtt, above). This supports transparent,
user-extensible template variables for use in custom templates
* Included command-line program *makeperlmod* provides a command line
user interface for module creation. Supports reading default
configuration settings from a file and will create a default config
file if requested. These config files extend and/or override an
"ExtUtils::ModuleMaker::Personal::Defaults" file. The program can
create full distributions, single modules, single methods, default
configuration files or default template directories
Notable changes from ExtUtils::ModuleMaker:
* Default templates are generally simpler, as users are expected to
customize their own
* .t files for single .pm files created *after* the original build are
named after their corresponding .pm file rather than being
sequentially numbered.
* In the command-line program, *COMPACT* style is set by default
USAGE
ExtUtils::ModuleMaker::TT is designed to be used with the *ALT_BUILD*
parameter of ExtUtils::ModuleMaker. It replaces much of the
functionality of ExtUtils::ModuleMaker::StandardText.
use ExtUtils::ModuleMaker;
my $mmtt = ExtUtils::ModuleMaker->new (
NAME => 'My::New::Module',
ALT_BUILD => 'ExtUtils::ModuleMaker::TT',
);
Generally, users should just use the included command-line program,
makeperlmod. For example, the following command will create a module
distribution using default settings:
makeperlmod -n Sample::Module
See the makeperlmod manual page for details on creating a custom
configuration file (for setting author details and other
ExtUtils::ModuleMaker options) that will extend or override defaults set
in an ExtUtils::ModuleMaker::Personal::Defaults file. The "CUSTOMIZING
TEMPLATES" section below contains other examples.
When specified as the ALT_BUILD, ExtUtils::ModuleMaker::TT provides
several additional methods as described below. The makeperlmod source
provides a practical example of such usage.
PUBLIC METHODS
build_single_pm
$mmtt->build_single_pm( $module );
Creates a new .pm file and a corresponding .t file.
The *$module* parameter may be either a hash reference containing
configuration options (including *NAME*) or a string containing the name
of a module, in which case the default configuration will be used. E.g.:
$module = { NAME => 'Sample::Module', NEED_POD => 0 };
( run in 2.729 seconds using v1.01-cache-2.11-cpan-22024b96cdf )