NAME
App::Scaffolder - Application for scaffolding using templates
VERSION
version 0.002000
SYNOPSIS
use App::Scaffolder;
App::Scaffolder->run();
DESCRIPTION
App::Scaffolder is the entry point for the application. It uses App::Cmd to provide the actual commands. See App::Scaffolder::Command for a command base class.
COMMANDS
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::Command
namespace that extends App::Scaffolder::Command, for example something likeApp::Scaffolder::Command::mycommand
.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>
TEMPLATES
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
File::HomeDir->my_dist_data('App-Scaffolder-MyDist')
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:
$HOME/.local/share/Perl/dist/App-Scaffolder-MyDist/mycommand
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
export SCAFFOLDER_TEMPLATE_PATH=~/scaffolder_templates
and putting a directory called mycommand
below ~/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:
- --list
-
Show the search path and list the templates found there.
- --create-template-dir
-
Create the template directory in the
my_dist_data
directory returned by File::HomeDir and print the search path.
AUTHOR
Manfred Stock <mstock@cpan.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.