The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Module::Template::Setup - aid in setting up a module based on templates

VERSION

Module::Template::Setup 0.03

SYNOPSIS

my $module = Module::Template::Setup->new($modulename);

$module->setup();

ABSTRACT

The goal of Module::Template::Setup is to provide a simple tool for speeding up the proces of spawning new modules by taking away all the boring work of adding all the required files and populating them with all the redundant information.

The module aims to combine the following parameters:

  • templated files

  • default values

  • configurable values

  • commandline arguments

Module::Template::Setup is currently in alpha and requires a lot of work (please see the TODO below).

DESCRIPTION

METHODS

new

This is the constructor. It takes one argument a string holding the modulename in either of the following formats:

  • Modulename

  • Module::Name

  • Module-Name

setup

This method does the actual work, based on the initialized object.

setup takes an optional argument 'build' which can be set to either:

build - creates a Build.PL
make - creates a Makefile.PL

setup also takes can also fill in license details for the following license types:

artistic (default)
gpl
lgpl
bsd

It is possilbe to give an license name, which is unknown by the module, or you can overwrite the license description my giving the argument "licensedetails".

See Module::Template::Setup::Licenses for more details on licenses - more licenses or better descriptions are of course welcome.

The proces in setup.

1. Creates a root directory named after the specified module (SEE: new)
2. Creates sub directories (SEE: DIRECTORIES)
3. Populates root directory with files based on templates (SEE: TEMPLATES)
4. Creates and module directory structure in the lib directory (SEE: DIRECTORIES)
5. Populates the module directory structure in the lib directory with a file based on a template (SEE: TEMPLATES)

RESERVED WORDS

Reserverd words are a list of names, which are not suitable as template placeholders.

  • $VERSION

more will follow...

DIRECTORIES

The following directories are always built:

  • Module-Name (this directory acts as root directory for everything else)

  • t (for tests)

  • lib (for the module)

TEMPLATES

The following templates are used to populate the directories.

In the root directory:

Makefile_PL.tpl or Build_PL.tpl
Changes.tpl
INSTALL.tpl
README.tpl
TODO.tpl
t (directory)
00_load_t.tpl
pod_t.tpl
pod-coverage_t.tpl
lib (directory)
<Modulename>_pm.tpl

placed in the appropriate sub directory based on module name (SEE: setup).

If you are not satisfied with the population of the templates, you can edit the templates to suit your needs.

Example: if you prefer the Perl modulenaming convention with '::' instead of the filesystem convention with -, you can just exchange $MODULENAME with $MODULENAME_PERL.

DEFAULTS

These are some of the defined defaults values for the PLACEHOLDERS used in the TEMPLATES.

  • CVSTAG is set to \$Id\$

  • DATEYEAR is set to current year (for copyright notice)

  • VERSIONNUMBER defaults to 0.01

PLACEHOLDERS

Apart from the values mentioned in DEFAULTS (above) this is a list of the current placeholders, which can be set.

AUTHORNAME

Should be set in you configuration file

AUTHOREMAIL

Should be set in you configuration file

MODULENAME

This is comes from the argument given to the constructor

MODULENAME_PERL

This is auto-resolved from the MODULENAME

MODULENAME_FILE

This is auto-resolved from the MODULENAME

MODULEDIRS

This is auto-resolved from the MODULENAME

LICENSENAME

Should be set in your configuration file

LICENSEDETAILS

Should be set in your configuration file

CAVEATS

When running the script, CGI::FastTemplate issues a warning, due to the fact that some of the templates contain a scalar called: $VERSION.

Since CGI::FastTemplate does (should) not know any variables of this name and it follows the naming convention for $placeholders to be used, it issues the following warning-

Please refer to the list of RESERVED WORDS for more of these.

The template naming is also somewhat crazy, apparently templates names cannot contain - (dash) or start with numbers, then they have to be quoted.

BUGS

There are no known bugs at the time of writing, if you experience any bugs, please report them using the following email address:

<bug-module-template-setup@rt.cpan.org>

Feedback also welcome on this address or directly to me on the address below (SEE: AUTHOR).

TODO

Implement handling and distinction of both global and local templates
Add AUTHOR file?
Add LICENSE file?
Add possibility of adding new templates and removing existing
Add possibility of adding new placeholders and default values
Add handling of several standard licenses
Add handling of setup targets of ExtUtils::MakeMaker or Module::Build
Add bug reporting address?

SEE ALSO

ExtUtils::MakeMaker
Module::Build
Module::Release
Test::Pod
Test::Pod::Coverage
Module::Template::Setup::Licenses

AUTHOR

Jonas B. Nielsen (jonasbn) - <jonasbn@cpan.org>

COPYRIGHT

Module::Template::Setup is (C) by Jonas B. Nielsen (jonasbn) 2004

Module::Template::Setup and related script and modules are free software and is released under the Artistic License. See http://www.perl.com/language/misc/Artistic.html for details.