NAME

Dist::Zilla::Plugin::MetaResources::Template - Use Perl code in distribution "resource" metadata

VERSION

Version v0.4.5, released on 2015-10-31 22:53 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
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 (C) 2015 Van de Bugger

License GPLv3+: The GNU General Public License version 3 or later <http://www.gnu.org/licenses/gpl-3.0.txt>.

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.