| 1 | # | ||||||||||||||||||||||||||||
| 2 | # This file is part of Config-Model | ||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||
| 4 | # This software is Copyright (c) 2005-2022 by Dominique Dumont. | ||||||||||||||||||||||||||||
| 5 | # | ||||||||||||||||||||||||||||
| 6 | # This is free software, licensed under: | ||||||||||||||||||||||||||||
| 7 | # | ||||||||||||||||||||||||||||
| 8 | # The GNU Lesser General Public License, Version 2.1, February 1999 | ||||||||||||||||||||||||||||
| 9 | # | ||||||||||||||||||||||||||||
| 10 | package Config::Model::TypeConstraints 2.169; | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 59 | ▶ | use Mouse; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 59 | ▶ | use Mouse::Util::TypeConstraints; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | # used only for tests | ||||||||||||||||||||||||||||
| 16 | 59 | my $__test_home = ''; | |||||||||||||||||||||||||||
| 17 | 13 | ▶ | sub _set_test_home { return $__test_home = shift; } | ||||||||||||||||||||||||||
|
Subroutine
_set_test_home: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 18 | 4 | ▶ | sub _get_test_home { return $__test_home ; } | ||||||||||||||||||||||||||
|
Subroutine
_get_test_home: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 59 | subtype 'Config::Model::TypeContraints::Path' => as 'Maybe[Path::Tiny]' ; | |||||||||||||||||||||||||||
| 21 | 51 | ▶ | coerce 'Config::Model::TypeContraints::Path' => from 'Str' => via sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=17.2
| |||||||||||||||||||||||||||||
| 22 | 51 | ▶ | if (defined $_ and /^~/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $_ and /^~/
MC/DC50%1/2
defined $_ and /^~/
defined $_
/^~/
Truth table66%2/3
A and B
A= defined $_B= /^~/
| |||||||||||||||||||||||||||||
| 23 | # because of tests, we can't rely on Path::Tiny's tilde processing | ||||||||||||||||||||||||||||
| 24 | 1 | ▶ | my $home = $__test_home || File::HomeDir->my_home; | ||||||||||||||||||||||||||
|
Condition33%1/3
$__test_home || 'File::HomeDir'->my_home
MC/DC0%0/2
$__test_home || 'File::HomeDir'->my_home
$__test_home
'File::HomeDir'->my_home
Truth table33%1/3
A || B
A= $__test_homeB= 'File::HomeDir'->my_home
| |||||||||||||||||||||||||||||
| 25 | 1 | s/^~/$home/; | |||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | 51 | ▶ | return defined $_ ? Path::Tiny::path($_) : undef ; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | 59 | } ; | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 59 | 1; | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | # ABSTRACT: Mouse type constraints for Config::Model | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | __END__ | ||||||||||||||||||||||||||||