line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
835
|
use strict; use warnings; |
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
2
|
|
|
|
|
|
|
package File::Share; |
3
|
|
|
|
|
|
|
our $VERSION = '0.26'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
4
|
use base 'Exporter'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
96
|
|
6
|
|
|
|
|
|
|
our @EXPORT_OK = qw[ |
7
|
|
|
|
|
|
|
dist_dir |
8
|
|
|
|
|
|
|
dist_file |
9
|
|
|
|
|
|
|
module_dir |
10
|
|
|
|
|
|
|
module_file |
11
|
|
|
|
|
|
|
class_dir |
12
|
|
|
|
|
|
|
class_file |
13
|
|
|
|
|
|
|
]; |
14
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
15
|
|
|
|
|
|
|
all => [ @EXPORT_OK ], |
16
|
|
|
|
|
|
|
ALL => [ @EXPORT_OK ], |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
443
|
use File::ShareDir(); |
|
1
|
|
|
|
|
21423
|
|
|
1
|
|
|
|
|
24
|
|
20
|
1
|
|
|
1
|
|
5
|
use Cwd qw(abs_path); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
21
|
1
|
|
|
1
|
|
4
|
use File::Spec(); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
256
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub dist_dir { |
24
|
0
|
|
|
0
|
0
|
|
my ($dist) = @_; |
25
|
0
|
|
|
|
|
|
(my $inc = $dist) =~ s!(-|::)!/!g; |
26
|
0
|
|
|
|
|
|
$inc .= '.pm'; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
0
|
|
|
|
my $path = $INC{$inc} || ''; |
29
|
0
|
|
|
|
|
|
$path =~ s/$inc$//; |
30
|
0
|
|
|
|
|
|
$path = Cwd::realpath( File::Spec->catfile($path, '..') ); |
31
|
|
|
|
|
|
|
|
32
|
0
|
0
|
0
|
|
|
|
if ($path =~ m<^(.*?)[\/\\]blib\b> and |
|
|
|
0
|
|
|
|
|
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
|
0
|
0
|
|
|
|
if ($path and |
|
|
|
0
|
|
|
|
|
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
|
|
|
0
|
0
|
|
my ($dist, $file) = @_; |
51
|
0
|
|
|
|
|
|
my $dir = dist_dir($dist); |
52
|
0
|
|
|
|
|
|
return File::Spec->catfile( $dir, $file ); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub module_dir { |
56
|
0
|
|
|
0
|
0
|
|
die "File::Share::module_dir not yet supported"; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub module_file { |
60
|
0
|
|
|
0
|
0
|
|
die "File::Share::module_file not yet supported"; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |