| 1 | 1 | ▶ | use strict; use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 2 | package File::Share; | ||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | our $VERSION = '0.26'; | |||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use base 'Exporter'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | our @EXPORT_OK = qw[ | |||||||||||||||||||||||||||||||||||||||||
| 7 | dist_dir | ||||||||||||||||||||||||||||||||||||||||||
| 8 | dist_file | ||||||||||||||||||||||||||||||||||||||||||
| 9 | module_dir | ||||||||||||||||||||||||||||||||||||||||||
| 10 | module_file | ||||||||||||||||||||||||||||||||||||||||||
| 11 | class_dir | ||||||||||||||||||||||||||||||||||||||||||
| 12 | class_file | ||||||||||||||||||||||||||||||||||||||||||
| 13 | ]; | ||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | our %EXPORT_TAGS = ( | |||||||||||||||||||||||||||||||||||||||||
| 15 | all => [ @EXPORT_OK ], | ||||||||||||||||||||||||||||||||||||||||||
| 16 | ALL => [ @EXPORT_OK ], | ||||||||||||||||||||||||||||||||||||||||||
| 17 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use File::ShareDir(); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use Cwd qw(abs_path); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | use File::Spec(); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | sub dist_dir { | ||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | my ($dist) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
dist_dir: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | (my $inc = $dist) =~ s!(-|::)!/!g; | |||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | $inc .= '.pm'; | |||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | my $path = $INC{$inc} || ''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$INC{$inc} || ''
MC/DC0%0/1
$INC{$inc} || ''
$INC{$inc}
Truth table0%0/2
A
A= $INC{$inc}
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | $path =~ s/$inc$//; | |||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | $path = Cwd::realpath( File::Spec->catfile($path, '..') ); | |||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | if ($path =~ m<^(.*?)[\/\\]blib\b> and | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$path =~ m(^(.*?)[\/\\]blib\b) and -d "File::Spec"->catdir($1, "share") and -d ($_ = "File::Spec"->catdir($1, "share"))
$path =~ m(^(.*?)[\/\\]blib\b) and -d "File::Spec"->catdir($1, "share")
MC/DC0%0/3
$path =~ m(^(.*?)[\/\\]blib\b) and -d "File::Spec"->catdir($1, "share") and -d ($_ = "File::Spec"->catdir($1, "share"))
$path =~ m(^(.*?)[\/\\]blib\b)
-d "File::Spec"->catdir($1, "share")
-d ($_ = "File::Spec"->catdir($1, "share"))
Truth table0%0/4
A and B and C
A= $path =~ m(^(.*?)[\/\\]blib\b)B= -d "File::Spec"->catdir($1, "share")C= -d ($_ = "File::Spec"->catdir($1, "share"))
| |||||||||||||||||||||||||||||||||||||||||||
| 33 | -d File::Spec->catdir($1, 'share') and | ||||||||||||||||||||||||||||||||||||||||||
| 34 | -d ($_ = File::Spec->catdir($1, 'share')) | ||||||||||||||||||||||||||||||||||||||||||
| 35 | ) { | ||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | return abs_path($_); | |||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | if ($path and | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$path and -d "File::Spec"->catdir($path, "lib") and -d ($_ = "File::Spec"->catdir($path, "share"))
$path and -d "File::Spec"->catdir($path, "lib")
MC/DC0%0/3
$path and -d "File::Spec"->catdir($path, "lib") and -d ($_ = "File::Spec"->catdir($path, "share"))
$path
-d "File::Spec"->catdir($path, "lib")
-d ($_ = "File::Spec"->catdir($path, "share"))
Truth table0%0/4
A and B and C
A= $pathB= -d "File::Spec"->catdir($path, "lib")C= -d ($_ = "File::Spec"->catdir($path, "share"))
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | -d File::Spec->catdir($path, 'lib') and | ||||||||||||||||||||||||||||||||||||||||||
| 41 | -d ($_ = File::Spec->catdir($path, 'share')) | ||||||||||||||||||||||||||||||||||||||||||
| 42 | ) { | ||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | return abs_path($_); | |||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | return File::ShareDir::dist_dir($dist); | |||||||||||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | sub dist_file { | ||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | ▶ | my ($dist, $file) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
dist_file: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | my $dir = dist_dir($dist); | |||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | return File::Spec->catfile( $dir, $file ); | |||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | sub module_dir { | ||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | ▶ | die "File::Share::module_dir not yet supported"; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
module_dir: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | sub module_file { | ||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | ▶ | die "File::Share::module_file not yet supported"; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
module_file: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||