blib/lib/Module/Setup/Path.pm

filter: Statementstmt 100% 46 / 46 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 16 / 16 Podpod 0.0% 0 / 8 totaltotal 88.8% 64 / 72 CC 2 SCAR 1.1
CC
2
Cov
100%
is_initialized
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/Module/Setup/Plugin/Template.pm ↑ Summary blib/lib/Module/Setup/Path/Flavor.pm »
1 package Module::Setup::Path;
2 40 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 40 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 40 ▶use base 'Module::Setup::Path::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 40 ▶use Path::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 40 ▶use Module::Setup::Path::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 40 ▶use Module::Setup::Path::Flavor;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 40 ▶use Module::Setup::Path::Flavors;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 40 ▶use Module::Setup::Path::Plugins;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub new {
14 95 ▶ my($class, @path) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
15 95 my $self = $class->SUPER::new(@path);
16  
17 95 $self->{flavor} = undef;
18 95 $self->{flavor_name} = undef;
19 95 $self->{flavors} = Module::Setup::Path::Flavors->new($self->path_to('flavors'));
20 95 $self->{global_plugins} = Module::Setup::Path::Plugins->new($self->path_to('plugins'));
21 95 $self->{global_config} = Module::Setup::Path::Config->new($self->path_to('config.yaml'));
22  
23 95 $self;
24 }
25  
26 sub set_flavor {
27 108 ▶ my($self, $flavor) = @_;
Subroutine set_flavor: called CC=1 SCAR=0.0
Pod undocumented
28 108 $self->{flavor_name} = $flavor;
29 108 $self->{flavor} = Module::Setup::Path::Flavor->new($self->path_to('flavors', $flavor));
30 }
31  
32 1406 ▶sub flavor { shift->{flavor} }
Subroutine flavor: called CC=1 SCAR=0.0
Pod undocumented
33 128 ▶sub flavors { shift->{flavors} }
Subroutine flavors: called CC=1 SCAR=0.0
Pod undocumented
34 3 ▶sub global_config { shift->{global_config} }
Subroutine global_config: called CC=1 SCAR=0.0
Pod undocumented
35 222 ▶sub global_plugins { shift->{global_plugins} }
Subroutine global_plugins: called CC=1 SCAR=0.0
Pod undocumented
36  
37 sub is_initialized {
38 97 ▶ my $self = shift;
Subroutine is_initialized: called CC=2 SCAR=6.9
Pod undocumented
39 97 ▶ $self->is_dir && $self->global_plugins->is_dir;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_dir and $self->global_plugins->is_dir 93 4 97
40 }
41  
42 sub init_directories {
43 42 ▶ my $self = shift;
Subroutine init_directories: called CC=1 SCAR=0.0
Pod undocumented
44 42 $self->path->mkpath;
45 42 $self->global_plugins->path->mkpath;
46 42 $self->flavors->path->mkpath;
47 }
48  
49 40 1;
« blib/lib/Module/Setup/Plugin/Template.pm ↑ Summary blib/lib/Module/Setup/Path/Flavor.pm »