line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Setup::Path::Base; |
2
|
41
|
|
|
41
|
|
236
|
use strict; |
|
41
|
|
|
|
|
83
|
|
|
41
|
|
|
|
|
1315
|
|
3
|
41
|
|
|
41
|
|
191
|
use warnings; |
|
41
|
|
|
|
|
53
|
|
|
41
|
|
|
|
|
1018
|
|
4
|
|
|
|
|
|
|
|
5
|
41
|
|
|
41
|
|
22260
|
use File::Find::Rule; |
|
41
|
|
|
|
|
312465
|
|
|
41
|
|
|
|
|
336
|
|
6
|
|
|
|
|
|
|
|
7
|
41
|
|
|
41
|
|
2242
|
use Module::Setup::Path::Dir; |
|
41
|
|
|
|
|
66
|
|
|
41
|
|
|
|
|
977
|
|
8
|
41
|
|
|
41
|
|
19697
|
use Module::Setup::Path::File; |
|
41
|
|
|
|
|
81
|
|
|
41
|
|
|
|
|
13317
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
1084
|
|
|
1084
|
0
|
1608
|
my($class, @path) = @_; |
12
|
|
|
|
|
|
|
|
13
|
1084
|
|
|
|
|
2803
|
my $self = bless { |
14
|
|
|
|
|
|
|
base => Module::Setup::Path::Dir->new(@path), |
15
|
|
|
|
|
|
|
path => Module::Setup::Path::Dir->new(@path), |
16
|
|
|
|
|
|
|
}, $class; |
17
|
|
|
|
|
|
|
|
18
|
1084
|
|
|
|
|
89893
|
$self; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
5387
|
|
|
5387
|
0
|
76599
|
sub path { shift->{path} } |
22
|
244
|
|
|
244
|
0
|
829
|
sub is_dir { -d shift->{path} } |
23
|
49
|
|
|
49
|
0
|
200
|
sub is_exists { -e shift->{path} } |
24
|
2
|
|
|
2
|
0
|
11
|
sub is_file { -f shift->{path} } |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub path_to { |
27
|
1961
|
|
|
1961
|
0
|
3592
|
my($self, @to) = @_; |
28
|
1961
|
|
|
|
|
3987
|
my $path = Module::Setup::Path::Dir->new($self->path, @to); |
29
|
1961
|
100
|
|
|
|
80323
|
$path = Module::Setup::Path::File->new($self->path, @to) unless -d $path; |
30
|
1961
|
|
|
|
|
119671
|
$path; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub find_files { |
34
|
78
|
|
|
78
|
0
|
130
|
my $self = shift; |
35
|
78
|
100
|
|
|
|
333
|
return unless $self->path->children; |
36
|
|
|
|
|
|
|
map { |
37
|
67
|
|
|
|
|
59752
|
my $path = Path::Class::Dir->new($self->path, $_); |
|
682
|
|
|
|
|
90063
|
|
38
|
682
|
|
|
|
|
19904
|
my $ret; |
39
|
682
|
100
|
|
|
|
1756
|
if (-d $path) { |
40
|
155
|
100
|
|
|
|
4312
|
$ret = Module::Setup::Path::Dir->new($_) unless $path->children; |
41
|
|
|
|
|
|
|
} else { |
42
|
527
|
|
|
|
|
16080
|
$ret = Module::Setup::Path::File->new($_); |
43
|
|
|
|
|
|
|
} |
44
|
682
|
100
|
|
|
|
71537
|
$ret ? $ret : (); |
45
|
|
|
|
|
|
|
} File::Find::Rule->new->relative->in( $self->path ); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |