| 1 | 23 | ▶ | use v5.26; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 23 | ▶ | use Object::Pad; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 23 | ▶ | use Getopt::Pad::Type::Path; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | class Getopt::Pad::Type::Dir :isa(Getopt::Pad::Type::Path) :strict(params) { | ||||||||||
| 7 | 23 | ▶ | use constant NAMES => ['dir', 'directory']; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 23 | ▶ | use File::Path (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 23 | our $VERSION = '0.06'; | |||||||||
| 11 | |||||||||||
| 12 | 18 | ▶ | method label() { return 'Path' } | ||||||||
|
Subroutine
label: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 13 | |||||||||||
| 14 | 3 | ▶ | method kind() { return 'directory' } | ||||||||
|
Subroutine
kind: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 15 | |||||||||||
| 16 | 1 | ▶ | method completes() { return 'dirs' } | ||||||||
|
Subroutine
completes: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 17 | |||||||||||
| 18 | 12 | ▶ | method pathExists($value) { return -d $value } | ||||||||
|
Subroutine
pathExists: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 19 | |||||||||||
| 20 | 4 | ▶ | method createPath($value) { | ||||||||
|
Subroutine
createPath: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 21 | 4 | File::Path::make_path($value, { error => \my $errors }); | |||||||||
| 22 | 4 | ▶ | return undef if !$errors->@*; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 1 | my ($path, $reason) = $errors->[0]->%*; | |||||||||
| 24 | 1 | return $reason; | |||||||||
| 25 | 23 | } | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 23 | 1; | |||||||||
| 29 | |||||||||||
| 30 | __END__ | ||||||||||