App::Scaffolder - Application for scaffolding using templates
use App::Scaffolder; App::Scaffolder->run();
App-Scaffolder itself provides only a small framework for actual commands. In order to provide a new command, the following is necessary:
A command below the
App::Scaffolder::Commandnamespace that extends App::Scaffolder::Command, for example something like
Templates that are installed for File::ShareDir, in the directory that belongs to the distribution. Inside this directory, the following structure is required:
<Command name> `-- <Template name> `-- <Template files>
The templates (which are actually directory trees containing files and Template templates) are handled by App::Scaffolder::Template. The search path for the templates is usually constructed using File::HomeDir and File::ShareDir, so one may override existing templates or add new templates by putting them in the directory returned by
and appending the command name as subdirectory to it. So on Linux and the distribution
App-Scaffolder-Mydist, which provides the command
mycommand, this path would look something like the following:
In addition to this, the App::Scaffolder::Command base class also uses the
SCAFFOLDER_TEMPLATE_PATH environment variable to add additional directories to the search path. Thus setting
and putting a directory called
~/scaffolder_templates which contains templates would also make them available to
scaffolder mycommand. This could be useful to share templates with other users if the templates are stored in a location that is accessible to the other users, too.
The App::Scaffolder::Command command base class also provides two parameters related to the template search path:
Show the search path and list the templates found there.
Create the template directory in the
my_dist_datadirectory returned by File::HomeDir and print the search path.
Manfred Stock <firstname.lastname@example.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Manfred Stock.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.