NAME
Dist::Zilla::Plugin::MetaResources::Template - Use Perl code in distribution "resource" metadata
VERSION
Version 0.003, released on 2015-07-22 13:18 UTC.
WHAT?
Dist-Zilla-Plugin-MetaResources-Template
is a Dist::Zilla
plugin, a replacement for standard plugin MetaResources
. Both provide resources for distribution metadata, but this one treats values as text templates.
This is Dist::Zilla::Plugin::MetaResources::Template
module documentation. Read this if you are going to hack or extend Dist-Zilla-Plugin-MetaResources-Template
.
If you want to use Perl code in distribution "resource" metadata, read the manual. General topics like getting source, building, installing, bug reporting and some others are covered in the readme.
SYNOPSIS
Oops.
DESCRIPTION
Dist::Zilla::Plugin::MetaResources::Template
extends Dist::Zilla::Plugin::MetaResources
. The class implements BUILD
method, which expand templates in option values, all other work is done by the parent class.
Template processing abilities achieved by consuming Dist::Zilla::Role::TextTemplater
role.
CLASS METHODS
BUILDARGS
Parent's BUILDARGS
mangles all the arguments: it moves them into resources, including TextTemplater
arguments: delimiters
, package
, prepend
. We have to protect TextTemplater
arguments from being misinterpreted.
OBJECT METHODS
BUILD
The method is automatically called after object creation. The method recursively walks through the $self->{resources}
and expand templates in string by calling $self->fill_in_string
(it is a method from TextTemplater
role).
Defining BUILDARGS
seems like a simpler approach because all the options are in plain list and so there is no need in recursive walking trough a complex data structure ($self->{ resources }
), but we need $self
to perform template expansion while BUILDARGS
is a class method.
SEE ALSO
- Dist::Zilla
- Dist::Zilla::Role
- Dist::Zilla::Role::Plugin
- Dist::Zilla::Role::TextTemplater
- Dist::Zilla::Plugin::MetaResources
- Dist::Zilla::Plugin::MetaResources::Template::Manual
- Dist::Zilla::Plugin::MetaResources::Template::ReadMe
- CPAN::Meta::Spec
- "resources" in CPAN::Meta::Spec
- "BUILD" in Moose::Manual::Construction
AUTHOR
Van de Bugger <van.de.bugger@gmail.com>
COPYRIGHT AND LICENSE
Copyright © 2015 Van de Bugger
This file is part of perl-Dist-Zilla-Plugin-MetaResources-Template.
perl-Dist-Zilla-Plugin-MetaResources-Template is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
perl-Dist-Zilla-Plugin-MetaResources-Template is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with perl-Dist-Zilla-Plugin-MetaResources-Template. If not, see <http://www.gnu.org/licenses/>.