Karen Etheridge > Dist-Zilla-Plugin-GenerateFile-ShareDir > Dist::Zilla::Plugin::GenerateFile::ShareDir



Annotate this POD


View/Report Bugs
Module Version: 0.006   Source  


Dist::Zilla::Plugin::GenerateFile::ShareDir - Create files in the build, based on a template located in a dist sharedir


version 0.006


In your dist.ini:

    -dist = Dist::Zilla::PluginBundle::Author::ME
    -source_filename = my_data_template.txt
    -destination_filename = examples/my_data.txt
    key1 = value to pass to template
    key2 = another value to pass to template


Generates a file in your dist, indicated by -destination_file, based on the Text::Template located in the -source_file of -dist's distribution sharedir. Any extra config values are passed along to the template, in addition to $zilla and $plugin objects.

I expect that usually the -dist that contains the template will be either a plugin bundle, so you can generate a custom-tailored file in your dist, or a plugin that subclasses this one. (Otherwise, you can just as easily use [GatherDir::Template] or [GenerateFile] to generate the file directly, without needing a sharedir.)


All unrecognized keys/values will be passed to the template as is. Recognized options are:


The distribution name to use when finding the sharedir (see File::ShareDir and Dist::Zilla::Plugin::ShareDir). Defaults to the dist corresponding to the running plugin.

-destination_filename or -filename

The filename to generate in the distribution being built. Required.


The filename in the sharedir to use to generate the new file. Defaults to the same filename and path as -destination_file.


The encoding of the source file; will also be used for the encoding of the destination file. Defaults to UTF-8.


default: build

The target location of the generated file. When build, the file is added to the distribution in the normal file gathering phase. When root, the file is instead written to the source repository.


Only relevant when -location = root. When build (the default), the file is written on every build operation. When release, it is only written after the distribution is released.


Bugs may be submitted through the RT bug tracker (or bug-Dist-Zilla-Plugin-GenerateFile-ShareDir@rt.cpan.org). I am also usually active on irc, as 'ether' at irc.perl.org.



Karen Etheridge <ether@cpan.org>


Kent Fredric <kentfredric@gmail.com>


This software is copyright (c) 2013 by Karen Etheridge.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: