blib/lib/Module/Setup/Plugin/Helper.pm

filter: Statementstmt 81.2% 26 / 32 Branchbran 37.5% 3 / 8 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 3 totaltotal 69.8% 37 / 53 CC 6 SCAR 13.9
CC
6
Cov
71%
setup_template_vars
7.7
setup_module_attribute
2.3
BEGIN
1.0
CRAP 4.0
« blib/lib/Module/Setup/Test/Flavor.pm ↑ Summary blib/lib/Module/Setup/Plugin/Test/Makefile.pm »
1 package Module::Setup::Plugin::Helper;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use base 'Module::Setup::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Module::Setup::Path::Dir;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶sub register {
Subroutine register: called CC=1 SCAR=0.0
Pod undocumented
9 2 my $self = shift;
10 2 $self->add_trigger(
11 after_setup_module_attribute => $self->can('setup_module_attribute')
12 );
13 2 $self->add_trigger(
14 after_setup_template_vars => $self->can('setup_template_vars')
15 );
16 }
17  
18 1 ▶sub setup_module_attribute {
Subroutine setup_module_attribute: called CC=2 SCAR=8.1
Pod undocumented
19 1 my $setup = shift;
20 1 ▶ if ($setup->{config}->{class}->is_append_files) {
Branch: 1 branch
BranchTrueFalseTotal
if ($setup->{"config"}{"class"}->is_append_files) 0 1 1
21 0 $setup->distribute->{dist_path} = Module::Setup::Path::Dir->new('.');
22 }
23 }
24  
25 1 ▶sub setup_template_vars {
Subroutine setup_template_vars: called CC=5 SCAR=20.4
Pod undocumented
26 1 my ($setup, $vars) = @_;
27  
28 1 ▶ my $conf = $setup->{helper} || {};
Condition50%1/2
$setup->{'helper'} || {}
l!l
01
MC/DC0%0/1
$setup->{'helper'} || {}
$setup->{'helper'}
Truth table50%1/2
A
A= $setup->{'helper'}
Aresult
11
00
29 1 my $flavor_class = $setup->{config}->{class};
30  
31 1 my $prefix = $flavor_class->helper_option_prefix;
32  
33 0 my %is_make_path = map { $_ => 1 } $flavor_class->generate_path_option_names;
34 1 ▶ while (my($k, $v) = each %{ $conf }) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %{$conf;}) 0 1 1
35 0 $vars->{"${prefix}_$k"} = $v;
36 0 ▶ if ($is_make_path{$k}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($is_make_path{$k}) 0 0 0
37 0 ($vars->{"${prefix}_${k}_path"} = $v) =~ s!::!/!g;
38 }
39 }
40  
41 1 ▶ if (ref($conf->{setup_template_vars_callback}) eq 'CODE') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $conf->{"setup_template_vars_callback"} eq "CODE") 0 1 1
42 0 $conf->{setup_template_vars_callback}->($setup, $vars);
43 }
44 }
45  
46  
47 1 1;
48  
49 =head1 NAME
50  
51 Module::Setup::Plugin::Helper - L<Module::Setup::Helper> support plugin
52  
53 =head1 SEE ALSO
54  
55 L<Module::Setup::Helper>
56  
57 =cut
58  
« blib/lib/Module/Setup/Test/Flavor.pm ↑ Summary blib/lib/Module/Setup/Plugin/Test/Makefile.pm »