line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Setup::Path::Base; |
2
|
47
|
|
|
47
|
|
284
|
use strict; |
|
47
|
|
|
|
|
92
|
|
|
47
|
|
|
|
|
1502
|
|
3
|
47
|
|
|
47
|
|
242
|
use warnings; |
|
47
|
|
|
|
|
80
|
|
|
47
|
|
|
|
|
1128
|
|
4
|
|
|
|
|
|
|
|
5
|
47
|
|
|
47
|
|
50459
|
use File::Find::Rule; |
|
47
|
|
|
|
|
517886
|
|
|
47
|
|
|
|
|
492
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
3868
|
use Module::Setup::Path::Dir; |
|
47
|
|
|
|
|
117
|
|
|
47
|
|
|
|
|
1057
|
|
8
|
47
|
|
|
47
|
|
64869
|
use Module::Setup::Path::File; |
|
47
|
|
|
|
|
130
|
|
|
47
|
|
|
|
|
27686
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
1184
|
|
|
1184
|
0
|
3917
|
my($class, @path) = @_; |
12
|
|
|
|
|
|
|
|
13
|
1184
|
|
|
|
|
4114
|
my $self = bless { |
14
|
|
|
|
|
|
|
base => Module::Setup::Path::Dir->new(@path), |
15
|
|
|
|
|
|
|
path => Module::Setup::Path::Dir->new(@path), |
16
|
|
|
|
|
|
|
}, $class; |
17
|
|
|
|
|
|
|
|
18
|
1184
|
|
|
|
|
29813
|
$self; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
5868
|
|
|
5868
|
0
|
176103
|
sub path { shift->{path} } |
22
|
264
|
|
|
264
|
0
|
1202
|
sub is_dir { -d shift->{path} } |
23
|
55
|
|
|
55
|
0
|
267
|
sub is_exists { -e shift->{path} } |
24
|
2
|
|
|
2
|
0
|
16
|
sub is_file { -f shift->{path} } |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub path_to { |
27
|
2126
|
|
|
2126
|
0
|
4989
|
my($self, @to) = @_; |
28
|
2126
|
|
|
|
|
6610
|
my $path = Module::Setup::Path::Dir->new($self->path, @to); |
29
|
2126
|
100
|
|
|
|
75979
|
$path = Module::Setup::Path::File->new($self->path, @to) unless -d $path; |
30
|
2126
|
|
|
|
|
127049
|
$path; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub find_files { |
34
|
84
|
|
|
84
|
0
|
187
|
my $self = shift; |
35
|
84
|
100
|
|
|
|
534
|
return unless $self->path->children; |
36
|
727
|
|
|
|
|
31198
|
map { |
37
|
73
|
|
|
|
|
15588
|
my $path = Path::Class::Dir->new($self->path, $_); |
38
|
727
|
|
|
|
|
39316
|
my $ret; |
39
|
727
|
100
|
|
|
|
5218
|
if (-d $path) { |
40
|
164
|
100
|
|
|
|
9091
|
$ret = Module::Setup::Path::Dir->new($_) unless $path->children; |
41
|
|
|
|
|
|
|
} else { |
42
|
563
|
|
|
|
|
30409
|
$ret = Module::Setup::Path::File->new($_); |
43
|
|
|
|
|
|
|
} |
44
|
727
|
100
|
|
|
|
133416
|
$ret ? $ret : (); |
45
|
|
|
|
|
|
|
} File::Find::Rule->new->relative->in( $self->path ); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |