| 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
Condition33%1/3
$data and %$data
MC/DC0%0/2
$data and %$data
$data
%$data
Truth table33%1/3
A and B
A= $dataB= %$data
| |||||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||