Spoon/Utils.pm

filter: Statementstmt 42.3% 11 / 26 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 0.0% 0 / 3 totaltotal 35.9% 14 / 39 CC 3 SCAR 16.8
CC
3
Cov
37%
assert_filepath
12.0
assert_directory
2.0
remove_tree
2.0
CRAP 5.4
« Spoon/Template/TT2.pm ↑ Summary Spoon/ContentObject.pm »
1 package Spoon::Utils;
2 1 ▶use Spiffy -Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶const directory_perms => 0755;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 0 ▶sub assert_filepath {
Subroutine assert_filepath: not called CC=3 SCAR=24.8
Pod undocumented
6 0 my $filepath = shift;
7 0 ▶ return unless $filepath =~ s/(.*)[\/\\].*/$1/;
Branch: 1 branch
BranchTrueFalseTotal
unless $filepath =~ s((.*)[/\\].*)[$1] 0 0 0
8 0 ▶ return if -e $filepath;
Branch: 1 branch
BranchTrueFalseTotal
if -e $filepath 0 0 0
9 0 $self->assert_directory($filepath);
10 }
11  
12 0 ▶sub assert_directory {
Subroutine assert_directory: not called CC=1 SCAR=6.9
Pod undocumented
13 0 my $directory = shift;
14 0 require File::Path;
15 0 umask 0000;
16 0 File::Path::mkpath($directory, 0, $self->directory_perms);
17 }
18  
19 0 ▶sub remove_tree {
Subroutine remove_tree: not called CC=1 SCAR=6.9
Pod undocumented
20 0 my $directory = shift;
21 0 require File::Path;
22 0 umask 0000;
23 0 File::Path::rmtree($directory);
24 }
25  
26 1 __END__
« Spoon/Template/TT2.pm ↑ Summary Spoon/ContentObject.pm »