NAME

Module::Starter - Starter kit for any module

Version

Version 1.22

$Header: /home/cvs/module-starter/Starter.pm,v 1.41 2004/07/12 22:05:59 rjbs Exp $

Synopsis

Nothing in here is meant for public consumption. Use module-starter from the command line.

module-starter --module=Foo::Bar,Foo::Bat \
    --author="Andy Lester" --email=andy@petdance.com

Public Methods

Module::Starter->create_distro(%args)

create_distro is the only method you should need to use from outside this module; all the other methods are called internally by this one.

This method creates orchestrates all the work; it creates distribution and populates it with the all the requires files.

It takes a hash of params, as follows:

distro  => $distroname,      # distribution name (defaults to first module)
modules => [ module names ], # modules to create in distro
dir     => $dirname,         # directory in which to build distro
builder => 'Module::Build',  # defaults to ExtUtils::MakeMaker
                             # or specify more than one builder in an
                             # arrayref

license => $license,  # type of license; defaults to 'perl'
author  => $author,   # author's full name (required)
email   => $email,    # author's email address (required)

verbose => $verbose,  # bool: print progress messages; defaults to 0
force   => $force     # bool: overwrite existing files; defaults to 0

Private Methods

All the methods documented below are object methods, meant to be called internally by the ephemperal objects created during the execution of the class method create_distro above.

create_basedir

Creates the base directory for the distribution. If the directory already exists, and $force is true, then the existing directory will get erased.

If the directory can't be created, or re-created, it dies.

create_modules( @modules )

This method will create a starter module file for each module named in @modules.

module_guts( $module, $rtname )

This method returns the text which should serve as the contents for the named module. $rtname is the email suffix which rt.cpan.org will use for bug reports. (This should, and will, be moved out of the parameters for this method eventually.)

create_Makefile_PL( $main_module )

This will create the Makefile.PL for the distribution, and will use the module named in $main_module as the main module of the distribution.

Makefile_PL_guts( $main_module, $main_pm_file )

This method is called by create_Makefile_PL and returns text used to populate Makefile.PL; $main_pm_file is the filename of the distribution's main module, $main_module.

create_Build_PL( $main_module )

This will create the Build.PL for the distribution, and will use the module named in $main_module as the main module of the distribution.

Build_PL_guts( $main_module, $main_pm_file )

This method is called by create_Build_PL and returns text used to populate Build.PL; $main_pm_file is the filename of the distribution's main module, $main_module.

create_Changes( )

This method creates a skeletal Changes file.

Changes_guts

Called by create_Changes, this method returns content for the Changes file.

create_README( $build_instructions )

This method creates the distribution's README file.

README_guts

Called by create_README, this method returns content for the README file.

create_t( @modules )

This method creates a bunch of *.t files. @modules is a list of all modules in the distribution.

t_guts( @modules )

This method is called by create_t, and returns a description of the *.t files to be created.

The return value is a hash of test files to create. Each key is a filename and each value is the contents of that file.

create_MANIFEST( @files )

This method creates the distribution's MANIFEST file. It must be run last, because all the other create_* functions have been returning the functions they create.

MANIFEST_guts( @files )

This method is called by create_MANIFEST, and returns content for the MANIFEST file.

create_cvsignore( )

This creates a .cvsignore file in the distribution's directory so that your CVS knows to ignore certain files.

cvsignore_guts

Called by create_cvsignore, this method returns the contents of the cvsignore file.

Helper Methods

verbose

verbose tells us whether we're in verbose mode.

progress( @list )

progress prints the given progress message if we're in verbose mode.

Bugs

Please report any bugs or feature requests to bug-module-starter@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

Author

Andy Lester, <andy@petdance.com>

Copyright & License

Copyright 2004 Andy Lester, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Please note that these modules are not products of or supported by the employers of the various contributors to the code.