blib/lib/Module/Setup/Path.pm

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