blib/lib/Dist/Zilla/Role/FileInjector.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 21 / 21 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Dist/Zilla/Role/FileGatherer.pm ↑ Summary blib/lib/Dist/Zilla/Role/FilePruner.pm »
1 package Dist::Zilla::Role::FileInjector 6.040;
2 # ABSTRACT: something that can add files to the distribution
3  
4 47 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 47 ▶use Dist::Zilla::Pragmas;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 47 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 #pod =head1 DESCRIPTION
11 #pod
12 #pod This role should be implemented by any plugin that plans to add files into the
13 #pod distribution. It provides one method (C<L</add_file>>, documented below),
14 #pod which adds a file to the distribution, noting the place of addition.
15 #pod
16 #pod =method add_file
17 #pod
18 #pod $plugin->add_file($dzil_file);
19 #pod
20 #pod This adds a file to the distribution, setting the file's C<added_by> attribute
21 #pod as it does so.
22 #pod
23 #pod =cut
24  
25 803 ▶sub add_file {
Subroutine add_file: called CC=1 SCAR=0.0
Pod documented
26 803 my ($self, $file) = @_;
27 803 my ($pkg, undef, $line) = caller;
28  
29 803 $file->_set_added_by(
30 sprintf("%s (%s line %s)", $self->plugin_name, $pkg, $line),
31 );
32  
33 803 $self->log_debug([ 'adding file %s', $file->name ]);
34 803 push @{ $self->zilla->files }, $file;
35 }
36  
37 47 1;
38  
39 __END__
« blib/lib/Dist/Zilla/Role/FileGatherer.pm ↑ Summary blib/lib/Dist/Zilla/Role/FilePruner.pm »