Dist::Man::Plugin::Template - dist manager with templates
Version 0.0.1
use Dist::Man qw( Dist::Man::Simple Dist::Man::Plugin::Template ); Dist::Man->create_distro(%args);
This plugin is designed to be added to a Dist::Man::Simple-compatible Dist::Man class. It adds stub methods for template retrieval and rendering, and it replaces all of Simple's _guts methods with methods that will retrieve and render the apropriate templates.
new(%args)
This plugin calls the new supermethod and then initializes the template store and renderer. (See templates and renderer below.)
new
templates
renderer
templates()
This method is used to initialize the template store on the Dist::Man object. It returns a hash of templates; each key is a filename and each value is the body of the template. The filename Module.pm is used for the module template.
renderer()
This method is used to initialize the template renderer. Its result is stored in the object's renderer entry. The implementation will determine its use.
render($template, \%options)
The render method will render the template passed to it, using the data in the Dist::Man object and in the hash of passed parameters.
render
All of the FILE_guts methods from Dist::Man::Simple are subclassed to look something like this:
FILE_guts
sub file_guts { my $self = shift; my %options; @options{qw(first second third)} = @_; my $template = $self->{templates}{filename}; $self->render($template, \%options); }
These methods will need to be rewritten when (as is likely) Dist::Man::Simple's _guts methods are refactored into a registry.
Ricardo SIGNES, <rjbs at cpan.org>
<rjbs at cpan.org>
Please report any bugs or feature requests to bug-dist-man at rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-dist-man at rt.cpan.org
Copyright 2005-2007 Ricardo SIGNES, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Modified by Shlomi Fish while disclaiming any explicit or implicit ownership. May be used under the present or future terms of Module::Starter::Template.
To install Dist::Man, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Man
CPAN shell
perl -MCPAN -e shell install Dist::Man
For more information on module installation, please visit the detailed CPAN module installation guide.