-
-
28 Apr 2018 18:44:35 UTC
- Distribution: Dist-Zilla-Role-RepoFileInjector
- Module version: 0.009
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (2542 / 1 / 0)
- Kwalitee
Bus factor: 1- 90.28% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (31.83KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Dist::Zilla::Role::RepoFileInjector - Create files outside the build directory
VERSION
version 0.009
SYNOPSIS
In your dist.ini:
[MyPlugin]
And in your plugin:
package Dist::Zilla::Plugin::MyPlugin; use Moose; with 'Dist::Zilla::Role::RepoFileInjector'; sub some_method { ... $self->add_repo_file(Dist::Zilla::File::InMemory->new(...)); } sub some_other_method { ... $self->write_repo_files; }
DESCRIPTION
This role is to be consumed by any plugin that plans to create files outside the distribution.
ATTRIBUTES
repo_root
A string indicating the base directory where the file(s) are written, when relative paths are provided. Defaults to "root" in Dist::Zilla.
This attribute is available as an option of your plugin in dist.ini.
allow_overwrite
A boolean indicating whether it is permissible for the file to already exist (whereupon it is overwritten). When false, a fatal exception is thrown when the file already exists.
Defaults to true.
This attribute is available as an option of your plugin in dist.ini.
METHODS
add_repo_file
$plugin->add_repo_file($dzil_file);
Registers a file object to be written to disk. If the path is not absolute, it is treated as relative to
repo_root
. The file should consume the Dist::Zilla::Role::File role. Normally the consuming plugin would call this in theFileGatherer
phase.write_repo_files
$plugin->write_repo_files;
Writes out all files registered previously with
add_repo_file
. Your plugin should normally do this during either theAfterBuild
orAfterRelease
phase, e.g.:sub after_build { my $self = shift; $self->write_repo_files; }
_repo_files
Returns the list of files added via
add_repo_file
. Normally the consuming plugin would call this in theFileMunger
phase.SEE ALSO
SUPPORT
Bugs may be submitted through the RT bug tracker (or bug-Dist-Zilla-Role-RepoFileInjector@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
.AUTHOR
Karen Etheridge <ether@cpan.org>
COPYRIGHT AND LICENCE
This software is copyright (c) 2015 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::Role::RepoFileInjector, copy and paste the appropriate command in to your terminal.
cpanm Dist::Zilla::Role::RepoFileInjector
perl -MCPAN -e shell install Dist::Zilla::Role::RepoFileInjector
For more information on module installation, please visit the detailed CPAN module installation guide.