App::Scaffolder::Command - Base class for App::Scaffolder commands
version 0.002000
package App::Scaffolder::Command::mycommand; use parent qw(App::Scaffolder::Command); sub get_dist_name { return 'App-Scaffolder-MyDist'; } 1;
App::Scaffolder::Command is a base class for App::Scaffolder commands. Among other things, it provides access to the templates that belong to the command and provides the execute method which handles some basic parameters like --list and also evaluates the selected template.
execute
--list
Check if options contain a base argument like --list or --create-template-dir.
--create-template-dir
True if yes, false otherwise.
Getter for the options. Should be implemented by subclasses.
A list with additional options for the command.
Getter for the directories where templates are searched. Uses File::HomeDir and File::ShareDir using the distribution name and appends the command name to the directory. If get_extra_template_dirs returns a non-empty list, this will be put between these two default directories.
get_extra_template_dirs
A list with the directories.
Method to insert additional template directories between the 'local', File::HomeDir-based directory and the 'global', File::ShareDir-based one into the search path. By default, this takes the directories from the SCAFFOLDER_TEMPLATE_PATH environment variable.
SCAFFOLDER_TEMPLATE_PATH
This method expects positional parameters.
Name of the command template directories should be returned for.
A potentially empty list with the additional directories.
Reads the template directories and creates a App::Scaffolder::Template object for each template that is found.
A hash reference with the found templates.
Get the template with a given name.
Name of the template.
The App::Scaffolder::Template with the given name if it exists, an exception otherwise.
Extract the target directory from the options.
Options as passed to execute.
A Path::Class::Dir object with the target directory.
Get variables that should be passed to templates. Should be overridden by subclasses.
A hash reference with template variables.
Getter for the distribution name. Must be implemented by subclasses.
The name of the distribution the command belongs to.
Execute the command using the given command line options.
Nothing on success, an exception otherwise.
Manfred Stock <mstock@cpan.org>
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.
To install App::Scaffolder, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Scaffolder
CPAN shell
perl -MCPAN -e shell install App::Scaffolder
For more information on module installation, please visit the detailed CPAN module installation guide.