Dist::Zilla::Role::FileMunger - something that alters a file's destination or content


Dist-Zilla documentation Contained in the Dist-Zilla distribution.

Index


Code Index:

NAME

Top

Dist::Zilla::Role::FileMunger - something that alters a file's destination or content

VERSION

Top

version 4.200008

DESCRIPTION

Top

A FileMunger has an opportunity to mess around with each file that will be included in the distribution. Each FileMunger's munge_files method is called once. By default, this method will just call the munge_file (note the missing terminal 's') once for each file.

This method is expected to change attributes about the file before it is written out to the built distribution.

AUTHOR

Top

Ricardo SIGNES <rjbs@cpan.org>

COPYRIGHT AND LICENSE

Top


Dist-Zilla documentation Contained in the Dist-Zilla distribution.

package Dist::Zilla::Role::FileMunger;
BEGIN {
  $Dist::Zilla::Role::FileMunger::VERSION = '4.200008';
}
# ABSTRACT: something that alters a file's destination or content
use Moose::Role;
with 'Dist::Zilla::Role::Plugin';

use Moose::Autobox;


sub munge_files {
  my ($self) = @_;

  $self->log_fatal("no munge_file behavior implemented!")
    unless $self->can('munge_file');

  $self->munge_file($_) for $self->zilla->files->flatten;
}

no Moose::Role;
1;

__END__