Distribution::Cooker - Create a module directory from your own templates
use Distribution::Cooker; Distribution::Cooker->run( ... ); # most of this should go through the dist_cooker sketch
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.
run()
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.
/usr/local/bin/ttree
When cook processes the templates, it provides definitions for these template variables:
cook
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. Change this with the TTREE environment variable or 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.
TODO: describe this module
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 module already.
module
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 Foo-Bar.
Foo::Bar
Foo-Bar
Show the user MESSAGE, grap a line from STDIN, and return it.
Right now, Distribution::Cooker uses the defaults that I like, but that should come from a configuration file.
Distribution::Cooker
Other modules, such as Module:Starter, do a similar job but don't give you as much flexibility with your templates.
Module:Starter
This module is in Github:
http://github.com/briandfoy/distribution-cooker/
brian d foy, <bdfoy@cpan.org>
<bdfoy@cpan.org>
Copyright © 2008-2018, brian d foy <bdfoy@cpan.org>. All rights reserved.
You may redistribute this under the same terms as Perl itself.
To install Distribution::Cooker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Distribution::Cooker
CPAN shell
perl -MCPAN -e shell install Distribution::Cooker
For more information on module installation, please visit the detailed CPAN module installation guide.