Distribution::Cooker - Create a module directory from your own templates
Calls pre-run, collects information about the module you want to create, cooks the templates, and calls post-run.
If you don't specify the module name, it prompts you. If you don't specify a description, it prompts you.
Create the bare object. There's nothing fancy here, but if you need something more powerful you can create a subclass.
Initialize the object. There's nothing fancy here, but if you need something more powerful you can create a subclass.
Method to call before run() starts its work. run() will call this for you. By default this is a no-op, but you can redefine it or override it in a subclass.
run() calls this method immediately after it creates the object but before it initializes it.
Method to call after
run() ends its work.
run() calls this for you. By default this is a no-op, but you can redefine it or override it in a subclass.
Take the templates and cook them. This version uses Template Toolkit, but you can make a subclass to override it.
I assume my own favorite values, and haven't made these customizable yet.
cook processes the templates, it provides definitions for these template variables:
While processing the templates,
cook ignores .git, .svn, and CVS directories.
Returns the name for the ttree command from template, and croaks if that path does not exist or is not executable.
The default path is /usr/local/bin/ttree. You can override this in a subclass.
Returns the name of the directory that contains the distribution templates.
The default path is ~/.templates/modules. You can override this in a subclass.
Returns the description of the module.
The default name is
TODO: describe this module. You can override this in a subclass.
Returns the name of the file that is the module.
The default name is Foo.pm. You can override this in a subclass.
Return the module name. With an argument, set the module name.
Return the module path under lib/. You must have set
Return the dist name. With an argument, set the module name.
Take a module name, such as
Foo::Bar, and turn it into a distribution name, such as
Show the user MESSAGE, grap a line from STDIN, and return it.
Distribution::Cooker uses the defaults that I like, but that should come from a configuration file.
Other modules, such as
Module:Starter, do a similar job but don't give you as much flexibility with your templates.
This module is in Github:
brian d foy,
Copyright (c) 2008-2013, brian d foy, All Rights Reserved.
You may redistribute this under the same terms as Perl itself.