CSE/Role/DirIndex.pm untested

filter: Statementstmt 0.0% 0 / 14 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 20 CC 2 SCAR 13.9
CC
2
Cov
0%
_build_dir_index
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1 package App::CSE::Role::DirIndex;
2 $App::CSE::Role::DirIndex::VERSION = '0.016';
3 use Moose::Role;
4 # Factorizing dir_index command property.
5 #
6  
7 requires 'cse';
8  
9 use Path::Class::Dir;
10  
11 has 'dir_index' => ( is => 'ro' , isa => 'Path::Class::Dir' , lazy_build => 1 );
12  
13  
14 sub _build_dir_index{
15 my ($self) = @_;
16  
17 if( my $to_index = $self->cse->options()->{dir} ){
18 return Path::Class::Dir->new($to_index);
19 }
20  
21 ## Default to the current directory (in a relative way).
22 return Path::Class::Dir->new();
23 }
24  
25 1;
26