line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
65642
|
use strict; use warnings; |
|
2
|
|
|
2
|
|
14
|
|
|
2
|
|
|
|
|
52
|
|
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
105
|
|
2
|
|
|
|
|
|
|
package File::Share; |
3
|
|
|
|
|
|
|
our $VERSION = '0.27'; |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
10
|
use base 'Exporter'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
296
|
|
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
|
2
|
|
|
2
|
|
931
|
use File::ShareDir(); |
|
2
|
|
|
|
|
48197
|
|
|
2
|
|
|
|
|
58
|
|
20
|
2
|
|
|
2
|
|
14
|
use Cwd qw(abs_path); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
69
|
|
21
|
2
|
|
|
2
|
|
9
|
use File::Spec(); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
598
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub dist_dir { |
24
|
1
|
|
|
1
|
0
|
225
|
my ($dist) = @_; |
25
|
1
|
|
|
|
|
6
|
(my $inc = $dist) =~ s!(-|::)!/!g; |
26
|
1
|
|
|
|
|
3
|
$inc .= '.pm'; |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
50
|
|
|
4
|
my $path = $INC{$inc} || ''; |
29
|
1
|
|
|
|
|
14
|
$path =~ s/$inc$//; |
30
|
1
|
|
|
|
|
71
|
$path = Cwd::realpath( File::Spec->catfile($path, '..') ); |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
3
|
my $dir; |
33
|
1
|
50
|
33
|
|
|
60
|
if ($path =~ m<^(.*?)[\/\\]blib\b> and |
|
|
|
33
|
|
|
|
|
34
|
|
|
|
|
|
|
-d File::Spec->catdir($1, 'share') and |
35
|
|
|
|
|
|
|
-d ($dir = File::Spec->catdir($1, 'share')) |
36
|
|
|
|
|
|
|
) { |
37
|
0
|
|
|
|
|
0
|
return abs_path($dir); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
1
|
50
|
33
|
|
|
40
|
if ($path and |
|
|
|
33
|
|
|
|
|
41
|
|
|
|
|
|
|
-d File::Spec->catdir($path, 'lib') and |
42
|
|
|
|
|
|
|
-d ($dir = File::Spec->catdir($path, 'share')) |
43
|
|
|
|
|
|
|
) { |
44
|
0
|
|
|
|
|
0
|
return abs_path($dir); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
|
|
6
|
return File::ShareDir::dist_dir($dist); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub dist_file { |
51
|
0
|
|
|
0
|
0
|
|
my ($dist, $file) = @_; |
52
|
0
|
|
|
|
|
|
my $dir = dist_dir($dist); |
53
|
0
|
|
|
|
|
|
return File::Spec->catfile( $dir, $file ); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub module_dir { |
57
|
0
|
|
|
0
|
0
|
|
die "File::Share::module_dir not yet supported"; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub module_file { |
61
|
0
|
|
|
0
|
0
|
|
die "File::Share::module_file not yet supported"; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |