| Dist-Zilla documentation | Contained in the Dist-Zilla distribution. |
Dist::Zilla::Role::FileInjector - something that can add files to the distribution
version 4.200008
This role should be implemented by any plugin that plans to add files into the
distribution. It provides one method (add_file, documented below),
which adds a file to the distribution, noting the place of addition.
$plugin->add_file($dzil_file);
This adds a file to the distribution, setting the file's added_by attribute
as it does so.
Ricardo SIGNES <rjbs@cpan.org>
This software is copyright (c) 2011 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
| Dist-Zilla documentation | Contained in the Dist-Zilla distribution. |
package Dist::Zilla::Role::FileInjector; BEGIN { $Dist::Zilla::Role::FileInjector::VERSION = '4.200008'; } # ABSTRACT: something that can add files to the distribution use Moose::Role; use Moose::Autobox; sub add_file { my ($self, $file) = @_; my ($pkg, undef, $line) = caller; $file->meta->get_attribute('added_by')->set_value( $file, sprintf("%s (%s line %s)", $self->plugin_name, $pkg, $line), ); $self->log_debug([ 'adding file %s', $file->name ]); $self->zilla->files->push($file); } no Moose::Role; 1; __END__