line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XT::Files::Plugin::Dirs; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
2780
|
use 5.006; |
|
6
|
|
|
|
|
18
|
|
4
|
6
|
|
|
6
|
|
35
|
use strict; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
110
|
|
5
|
6
|
|
|
6
|
|
25
|
use warnings; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
265
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.001'; |
8
|
|
|
|
|
|
|
|
9
|
6
|
|
|
6
|
|
491
|
use parent 'XT::Files::Plugin'; |
|
6
|
|
|
|
|
294
|
|
|
6
|
|
|
|
|
27
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub run { |
12
|
8
|
|
|
8
|
1
|
878
|
my ( $self, $args ) = @_; |
13
|
|
|
|
|
|
|
|
14
|
8
|
|
|
|
|
28
|
my @dirs; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
ARG: |
17
|
8
|
|
|
|
|
14
|
for my $arg ( @{$args} ) { |
|
8
|
|
|
|
|
17
|
|
18
|
19
|
|
|
|
|
26
|
my ( $key, $value ) = @{$arg}; |
|
19
|
|
|
|
|
34
|
|
19
|
|
|
|
|
|
|
|
20
|
19
|
100
|
100
|
|
|
103
|
if ( ( $key eq 'bin' ) || ( $key eq 'module' ) || ( $key eq 'test' ) ) { |
|
|
|
100
|
|
|
|
|
21
|
18
|
|
|
|
|
30
|
push @dirs, $arg; |
22
|
18
|
|
|
|
|
35
|
next ARG; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
13
|
$self->log_fatal("Invalid configuration option '$key = $value' for plugin 'Dirs'"); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
7
|
|
|
|
|
138
|
my $xtf = $self->xtf; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# We sort the dirs because e.g. bin/lib must be scanned before bin |
31
|
|
|
|
|
|
|
# because bin_dir() would add every file found. |
32
|
|
|
|
|
|
|
# |
33
|
|
|
|
|
|
|
# By reverse sorting we guarantee that we always scan the most |
34
|
|
|
|
|
|
|
# significant directory first. |
35
|
|
|
|
|
|
|
DIR: |
36
|
7
|
|
|
|
|
57
|
for my $dir ( reverse sort { $a->[1] cmp $b->[1] } @dirs ) { |
|
20
|
|
|
|
|
46
|
|
37
|
18
|
|
|
|
|
25
|
my ( $type, $name ) = @{$dir}; |
|
18
|
|
|
|
|
38
|
|
38
|
|
|
|
|
|
|
|
39
|
18
|
100
|
|
|
|
45
|
if ( $type eq 'bin' ) { |
40
|
10
|
|
|
|
|
40
|
$xtf->bin_dir($name); |
41
|
10
|
|
|
|
|
20
|
next DIR; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
8
|
100
|
|
|
|
21
|
if ( $type eq 'module' ) { |
45
|
6
|
|
|
|
|
31
|
$xtf->module_dir($name); |
46
|
6
|
|
|
|
|
16
|
next DIR; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
2
|
50
|
|
|
|
5
|
if ( $type eq 'test' ) { |
50
|
2
|
|
|
|
|
8
|
$xtf->test_dir($name); |
51
|
2
|
|
|
|
|
5
|
next DIR; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
7
|
|
|
|
|
27
|
return; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |