| 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
| |||||||||||
| 8 | 0 | ▶ | return if -e $filepath; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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__ | |||||||||