| 1 | package Dist::Zilla::MVP::Reader::Perl 6.040; | ||||||||||||||||||||||||||||
| 2 | # ABSTRACT: the reader for dist.pl files | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 51 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 51 | extends 'Config::MVP::Reader'; | |||||||||||||||||||||||||||
| 6 | 51 | with qw(Config::MVP::Reader::Findable::ByExtension); | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 51 | ▶ | use Dist::Zilla::Pragmas; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 51 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | #pod =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 13 | #pod | ||||||||||||||||||||||||||||
| 14 | #pod Dist::Zilla::Config reads in the F<dist.pl> file for a distribution. | ||||||||||||||||||||||||||||
| 15 | #pod | ||||||||||||||||||||||||||||
| 16 | #pod =cut | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 200 | ▶ | sub default_extension { 'pl' } | ||||||||||||||||||||||||||
|
Subroutine
default_extension: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 1 | ▶ | sub read_into_assembler { | ||||||||||||||||||||||||||
|
Subroutine
read_into_assembler: called CC=11 SCAR=25.2
Pod
documented
| |||||||||||||||||||||||||||||
| 21 | 1 | my ($self, $location, $asm) = @_; | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 1 | my @input = do File::Spec->rel2abs($location); | |||||||||||||||||||||||||||
| 24 | 1 | ▶ | while (@input and ! ref $input[0]) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@input and not ref $input[0]
MC/DC50%1/2
@input and not ref $input[0]
@input
not ref $input[0]
Truth table66%2/3
A and not(B)
A= @inputB= not ref $input[0]
| |||||||||||||||||||||||||||||
| 25 | 5 | my ($key, $value) = (shift(@input), shift(@input)); | |||||||||||||||||||||||||||
| 26 | 5 | $asm->add_value($key => $value); | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 1 | my $plugins = shift @input; | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 1 | ▶ | confess "too much input" if @input; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 1 | ▶ | while (my ($ident, $arg) = splice @$plugins, 0, 2) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 34 | 1 | ▶ | unless (ref $arg) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | 1 | ▶ | unshift @$plugins, $arg if defined $arg; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 36 | 1 | $arg = []; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 1 | ▶ | my ($moniker, $name) = ref $ident ? @$ident : (($ident) x 2); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 40 | 1 | $asm->change_section($moniker, $name); | |||||||||||||||||||||||||||
| 41 | 1 | ▶ | my @to_iter = ref $arg eq 'HASH' ? %$arg : @$arg; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | 1 | ▶ | while (my ($key, $value) = splice @to_iter, 0, 2) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | 0 | $asm->add_value($key, $value); | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | # should be done ... elsewhere? -- rjbs, 2009-08-24 | ||||||||||||||||||||||||||||
| 48 | 1 | ▶ | $asm->end_section if $asm->current_section; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 1 | return $asm->sequence; | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 51 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 54 | 51 | 1; | |||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | __END__ | ||||||||||||||||||||||||||||