Name
Module::Provision::TraitFor::Rendering - Renders Templates
Synopsis
use Moose;
extends 'Module::Provision::Base';
with 'Module::Provision::TraitFor::Rendering';
Description
Renders templates. Uses a list stored in the index file index.json which by default is in the ~/.module_provision directory
Configuration and Environment
Requires the consuming class to define the attributes; appldir
, builder
, dist_module
, incdir
, initial_wd
, stash
, testdir
, and vcs
Defines the following attributes;
force
-
Overwrite the output files if they already exist
templates
-
Location of the code templates in the users home directory. Defaults to .module_provision
template_dir
-
Directory where the templates live
template_list
-
Data structure that maps the files in the template directory to the files in the project directory
Subroutines/Methods
dump_stash - Dump the hash ref used to render a template
$exit_code = $self->dump_stash;
Uses the internal dumper method to produce a pretty coloured listing
expand_tuple
$tuple = $self->expand_tuple( $tuple );
Expands the references in the passed tuple
init_templates - Initialise the template directory
$exit_code = $self->init_templates;
Initialise the .module_provision directory and create the index.json file
render_template
$target = $self->render_template( $template, $target );
Renders a single template using Template
render_templates
$self->render_templates;
Renders the list of templates in $self->template_list
be repeatedly calling calling "render_template"
Diagnostics
None
Dependencies
Incompatibilities
There are no known incompatibilities in this module
Bugs and Limitations
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Acknowledgements
Larry Wall - For the Perl programming language
Author
Peter Flanigan, <pjfl@cpan.org>
License and Copyright
Copyright (c) 2017 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE