blib/lib/Dist/Zilla/Plugin/InlineFiles.pm

filter: Statementstmt 100% 28 / 28 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 86.0% 37 / 43 CC 4 SCAR 8.3
CC
4
Cov
91%
gather_files
4.2
BEGIN
1.0
BEGIN
1.0
CRAP 2.3
« blib/lib/Dist/Zilla/Chrome/Test.pm ↑ Summary blib/lib/Dist/Zilla/Role/TestRunner.pm »
1 package Dist::Zilla::Plugin::InlineFiles 6.040;
2 # ABSTRACT: files in a data section
3  
4 12 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 12 with 'Dist::Zilla::Role::FileGatherer';
6  
7 12 ▶use Dist::Zilla::Pragmas;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 12 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 #pod =head1 DESCRIPTION
12 #pod
13 #pod This plugin exists only to be extended, and gathers all files contained in its
14 #pod data section and those of its ancestors. For more information, see
15 #pod L<Data::Section|Data::Section>.
16 #pod
17 #pod =cut
18  
19 12 ▶use Sub::Exporter::ForMethods;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 12 ▶use Data::Section 0.200002 # encoding and bytes
Subroutine BEGIN: called CC=1 SCAR=0.0
21 12 { installer => Sub::Exporter::ForMethods::method_installer },
22 12 '-setup' => { encoding => 'bytes' };
23 12 ▶use Dist::Zilla::File::InMemory;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 23 ▶sub gather_files {
Subroutine gather_files: called CC=4 SCAR=14.5
Pod undocumented
26 23 my ($self) = @_;
27  
28 23 my $data = $self->merged_section_data;
29 23 ▶ return unless $data and %$data;
Branch: 1 branch
BranchTrueFalseTotal
unless $data and %$data 0 23 23
Condition33%1/3
$data and %$data
!ll&&!rl&&r
0023
MC/DC0%0/2
$data and %$data
$data %$data
Truth table33%1/3
A and B
A= $dataB= %$data
ABresult
0X0
100
111
30  
31 23 for my $name (keys %$data) {
32 $self->add_file(
33 Dist::Zilla::File::InMemory->new({
34 name => $name,
35 25 content => ${ $data->{$name} },
36 }),
37 );
38 }
39  
40 23 return;
41 }
42  
43 12 __PACKAGE__->meta->make_immutable;
44 12 1;
45  
46 #pod =head1 SEE ALSO
47 #pod
48 #pod Core Dist::Zilla plugins inheriting from L<InlineFiles>:
49 #pod L<MetaTests|Dist::Zilla::Plugin::MetaTests>,
50 #pod L<PodCoverageTests|Dist::Zilla::Plugin::PodCoverageTests>,
51 #pod L<PodSyntaxTests|Dist::Zilla::Plugin::PodSyntaxTests>.
52 #pod
53 #pod =cut
54  
55 __END__
« blib/lib/Dist/Zilla/Chrome/Test.pm ↑ Summary blib/lib/Dist/Zilla/Role/TestRunner.pm »