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

filter: Statementstmt 100% 26 / 26 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 50.0% 1 / 2 totaltotal 97.3% 37 / 38 CC 5 SCAR 11.0
CC
5
Cov
100%
append_template_file
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« blib/lib/Module/Setup/Plugin.pm ↑ Summary blib/lib/Module/Setup/Distribute.pm »
1 package Module::Setup::Plugin::Additional;
2 21 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 21 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 21 ▶use base 'Module::Setup::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 21 ▶use Module::Setup::Path::Template;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 80 ▶sub register {
Subroutine register: called CC=1 SCAR=0.0
Pod undocumented
9 80 my($self, ) = @_;
10 80 $self->add_trigger( append_template_file => \&append_template_file );
11 }
12  
13 44 ▶sub append_template_file {
Subroutine append_template_file: called CC=5 SCAR=16.1
Pod documented
14 44 my $self = shift;
15  
16 44 my $config = $self->base_dir->flavor->additional->config->load;
17 44 for my $additional ( $self->base_dir->flavor->additional->path->children ) {
18 51 ▶ next unless $additional->is_dir;
Branch: 1 branch
BranchTrueFalseTotal
unless $additional->is_dir 45 6 51
19 6 my $name = $additional->dir_list(-1);
20 6 ▶ return unless $self->dialog("Do you install additional template by $name? [yN] ", 'n') =~ /[Yy]/;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->dialog("Do you install additional template by $name? [yN] ", "n") =~ /[Yy]/ 1 5 6
21  
22 5 my $base_src = Module::Setup::Path::Template->new($self->base_dir->flavor->additional->path, $name);
23 5 for my $path ($base_src->find_files) {
24 10 $self->distribute->install_template($self, $path, $base_src);
25 }
26 5 push @{ $self->distribute->{additionals} }, $config->{$name};
27 }
28 }
29  
30 21 1;
« blib/lib/Module/Setup/Plugin.pm ↑ Summary blib/lib/Module/Setup/Distribute.pm »