File Coverage

lib/Spoon/Utils.pm
Criterion Covered Total %
statement 9 24 37.5
branch 0 4 0.0
condition n/a
subroutine 3 6 50.0
pod 0 3 0.0
total 12 37 32.4


line stmt bran cond sub pod time code
1             package Spoon::Utils;
2 1     1   2345 use Spiffy -Base;
  1         3  
  1         11  
3 1     1   645 const directory_perms => 0755;
  1     1   3  
  1         37  
  1         7  
  1         3  
  1         477  
4              
5 0     0 0   sub assert_filepath {
6 0           my $filepath = shift;
7 0 0         return unless $filepath =~ s/(.*)[\/\\].*/$1/;
8 0 0         return if -e $filepath;
9 0           $self->assert_directory($filepath);
10             }
11              
12 0     0 0   sub assert_directory {
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     0 0   sub remove_tree {
20 0           my $directory = shift;
21 0           require File::Path;
22 0           umask 0000;
23 0           File::Path::rmtree($directory);
24             }
25              
26             __END__