-
-
23 Mar 2021 20:07:04 UTC
- Distribution: Dist-Zilla-Plugin-GenerateFile-FromShareDir
- Module version: 0.015
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (0)
- Testers (141 / 0 / 0)
- Kwalitee
Bus factor: 1- 82.57% Coverage
- License: perl_5
- Perl: v5.8.0
- Activity
24 month- Tools
- Download (35.21KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Dist::Zilla::File::InMemory
- Dist::Zilla::Role::AfterBuild
- Dist::Zilla::Role::AfterRelease
- Dist::Zilla::Role::FileGatherer
- Dist::Zilla::Role::FileMunger
- Dist::Zilla::Role::RepoFileInjector
- Dist::Zilla::Role::TextTemplate
- Encode
- File::ShareDir
- Moose
- Moose::Util
- Moose::Util::TypeConstraints
- MooseX::SlurpyConstructor
- Path::Tiny
- namespace::autoclean
- strict
- warnings
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- NAME
- VERSION
- SYNOPSIS
- DESCRIPTION
- OPTIONS
- SEE ALSO
- SUPPORT
- AUTHOR
- CONTRIBUTORS
- COPYRIGHT AND LICENCE
NAME
Dist::Zilla::Plugin::GenerateFile::FromShareDir - Create files in the repository or build, using a sharedir template
VERSION
version 0.015
SYNOPSIS
In your dist.ini:
[GenerateFile::FromShareDir] -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
DESCRIPTION
Generates a file in your distribution, 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 distribution, 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.)OPTIONS
All unrecognized keys/values will be passed to the template as is. Recognized options are:
-dist
The distribution name to use when finding the sharedir (see File::ShareDir and Dist::Zilla::Plugin::ShareDir). Defaults to the distribution corresponding to the running plugin.
-destination_filename
or-filename
The filename to generate in the distribution being built. Required.
-source_filename
The filename in the sharedir to use to generate the new file. Defaults to the same filename and path as
-destination_file
.-encoding
The encoding of the source file; will also be used for the encoding of the destination file. Defaults to UTF-8.
-location
default:
build
The target location of the generated file. When
build
, the file is added to the distribution in the normal file gathering phase. Whenroot
, the file is instead written to the source repository.-phase
Only relevant when
-location = root
. Whenbuild
(the default), the file is written on every build operation. Whenrelease
, it is only written after the distribution is released.SEE ALSO
[GatherDir::Template] - gather a file from the dist, and then pass it through a template
[GenerateFile] - generate a (possibly-templated) file purely based on data in dist.ini
SUPPORT
Bugs may be submitted through the RT bug tracker (or bug-Dist-Zilla-Plugin-GenerateFile-FromShareDir@rt.cpan.org).
There is also a mailing list available for users of this distribution, at http://dzil.org/#mailing-list.
There is also an irc channel available for users of this distribution, at
#distzilla
onirc.perl.org
.I am also usually active on irc, as 'ether' at
irc.perl.org
andirc.freenode.org
.AUTHOR
Karen Etheridge <ether@cpan.org>
CONTRIBUTORS
Dave Rolsky <autarch@urth.org>
Kent Fredric <kentfredric@gmail.com>
COPYRIGHT AND LICENCE
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.
Module Install Instructions
To install Dist::Zilla::Plugin::GenerateFile::FromShareDir, copy and paste the appropriate command in to your terminal.
cpanm Dist::Zilla::Plugin::GenerateFile::FromShareDir
perl -MCPAN -e shell install Dist::Zilla::Plugin::GenerateFile::FromShareDir
For more information on module installation, please visit the detailed CPAN module installation guide.