blib/lib/Dist/Zilla/MVP/Assembler.pm

filter: Statementstmt 89.2% 25 / 28 Branchbran 75.0% 3 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 87.5% 7 / 8 Podpod 50.0% 1 / 2 totaltotal 82.9% 39 / 47 CC 4 SCAR 6.5
CC
4
Cov
86%
package_bundle_method
3.0
__ANON__
2.5
__ANON__
2.0
CRAP 1.9
« blib/lib/Dist/Zilla/Plugin/FileFinder/Filter.pm ↑ Summary blib/lib/Dist/Zilla/Plugin/NextRelease.pm »
1 package Dist::Zilla::MVP::Assembler 6.040;
2 # ABSTRACT: Dist::Zilla-specific subclass of Config::MVP::Assembler
3  
4 51 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 51 extends 'Config::MVP::Assembler';
6 51 with 'Config::MVP::Assembler::WithBundles' => { -version => '2.200010' };
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 51 ▶use Dist::Zilla::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 #pod =head1 DESCRIPTION
15 #pod
16 #pod B<Take this next bit seriously!> If you don't understand how L<Config::MVP>
17 #pod works, reading about how the Dist::Zilla-specific Assembler works is not going
18 #pod to be useful.
19 #pod
20 #pod Dist::Zilla::MVP::Assembler extends L<Config::MVP::Assembler> and composes
21 #pod L<Config::MVP::Assembler::WithBundles>. For potential plugin bundles (things
22 #pod composing L<Dist::Zilla::Role::PluginBundle>)
23 #pod
24 #pod The Assembler has chrome, so it can log and will (eventually) be able to get
25 #pod input from the user.
26 #pod
27 #pod The Assembler's C<expand_package> method delegates to Dist::Zilla::Util's
28 #pod L<expand_config_package_name|Dist::Zilla::Util/expand_config_package_name>
29 #pod method.
30 #pod
31 #pod The Assembler will throw an exception if it is instructed to add a value for
32 #pod C<plugin_name> or C<zilla>.
33 #pod
34 #pod =cut
35  
36 51 has chrome => (
37 is => 'rw',
38 does => 'Dist::Zilla::Role::Chrome',
39 required => 1,
40 );
41  
42 has logger => (
43 is => 'ro',
44 isa => 'Log::Dispatchouli::Proxy', # could be duck typed, I guess
45 lazy => 1,
46 handles => [ qw(log log_debug log_fatal) ],
47 0 ▶ default => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
48 0 $_[0]->chrome->logger->proxy({ proxy_prefix => '[DZ] ' })
49 },
50 51 );
51  
52 644 ▶sub expand_package {
Subroutine expand_package: called CC=1 SCAR=0.0
Pod documented
53 644 return scalar Dist::Zilla::Util->expand_config_package_name($_[1]);
54 }
55  
56 784 ▶sub package_bundle_method {
Subroutine package_bundle_method: called CC=3 SCAR=11.0
Pod undocumented
57 784 my ($self, $pkg) = @_;
58 784 ▶ return unless $pkg->isa('Moose::Object')
Branch: 1 branch
BranchTrueFalseTotal
unless $pkg->isa("Moose::Object") and $pkg->does("Dist::Zilla::Role::PluginBundle") 774 10 784
Condition66%2/3
$pkg->isa("Moose::Object") and $pkg->does("Dist::Zilla::Role::PluginBundle")
!ll&&!rl&&r
077410
MC/DC50%1/2
$pkg->isa("Moose::Object") and $pkg->does("Dist::Zilla::Role::PluginBundle")
$pkg->isa("Moose::Object") $pkg->does("Dist::Zilla::Role::PluginBundle")
Truth table66%2/3
A and B
A= $pkg->isa("Moose::Object")B= $pkg->does("Dist::Zilla::Role::PluginBundle")
ABresult
0X0
100
111
59 and $pkg->does('Dist::Zilla::Role::PluginBundle');
60 10 return 'bundle_config';
61 }
62  
63 1671 ▶before add_value => sub {
Subroutine __ANON__: called CC=2 SCAR=9.2
64 1671 my ($self, $name) = @_;
65  
66 1671 ▶ return unless $name =~ /\A(?:plugin_name|zilla)\z/;
Branch: 1 branch
BranchTrueFalseTotal
unless $name =~ /\A(?:plugin_name|zilla)\z/u 1671 0 1671
67  
68 0 my $section_name = $self->current_section->name;
69 0 $self->log_fatal(
70 "$section_name arguments attempted to provide reserved argument $name"
71 );
72 51 };
73  
74 51 __PACKAGE__->meta->make_immutable;
75 51 1;
76  
77 __END__
« blib/lib/Dist/Zilla/Plugin/FileFinder/Filter.pm ↑ Summary blib/lib/Dist/Zilla/Plugin/NextRelease.pm »