line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package BioX::Workflow::Command::run::Utils::Files::TrackChanges; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1132
|
use MooseX::App::Role; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
4
|
1
|
|
|
1
|
|
8352
|
use Data::Walk; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
76
|
|
5
|
1
|
|
|
1
|
|
302
|
use File::Details; |
|
1
|
|
|
|
|
3606
|
|
|
1
|
|
|
|
|
8
|
|
6
|
1
|
|
|
1
|
|
60
|
use File::stat; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
7
|
1
|
|
|
1
|
|
380
|
use Time::localtime; |
|
1
|
|
|
|
|
2498
|
|
|
1
|
|
|
|
|
61
|
|
8
|
1
|
|
|
1
|
|
8
|
use File::Basename; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
64
|
|
9
|
1
|
|
|
1
|
|
7
|
use DateTime::Format::Strptime; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
11
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
with 'BioX::Workflow::Command::Utils::Files::TrackChanges'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head3 files |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Files just for this rule |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
##TODO Make this a hash? |
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has 'files' => ( |
21
|
|
|
|
|
|
|
traits => ['Array'], |
22
|
|
|
|
|
|
|
is => 'rw', |
23
|
|
|
|
|
|
|
isa => 'ArrayRef', |
24
|
|
|
|
|
|
|
default => sub { [] }, |
25
|
|
|
|
|
|
|
handles => { |
26
|
|
|
|
|
|
|
has_files => 'count', |
27
|
|
|
|
|
|
|
all_files => 'elements', |
28
|
|
|
|
|
|
|
push_files => 'push', |
29
|
|
|
|
|
|
|
sort_files => 'sort_in_place', |
30
|
|
|
|
|
|
|
uniq_files => 'uniq', |
31
|
|
|
|
|
|
|
}, |
32
|
|
|
|
|
|
|
clearer => 'clear_files', |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub walk_FILES { |
36
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
37
|
0
|
|
|
|
|
|
my $attr = shift; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
$self->pre_FILES( $attr, 'INPUT' ); |
40
|
0
|
|
|
|
|
|
$self->add_graph('INPUT'); |
41
|
0
|
|
|
|
|
|
$self->clear_files; |
42
|
0
|
|
|
|
|
|
$self->files([]); |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
$self->pre_FILES( $attr, 'OUTPUT' ); |
45
|
0
|
|
|
|
|
|
$self->add_graph('OUTPUT'); |
46
|
0
|
|
|
|
|
|
$self->clear_files; |
47
|
0
|
|
|
|
|
|
$self->files([]); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub pre_FILES { |
51
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
52
|
0
|
|
|
|
|
|
my $attr = shift; |
53
|
0
|
|
|
|
|
|
my $cond = shift; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
walk { |
56
|
0
|
|
|
0
|
|
|
wanted => sub { $self->walk_INPUT(@_) } |
57
|
|
|
|
|
|
|
}, |
58
|
0
|
|
|
|
|
|
$attr->$cond; |
59
|
0
|
|
|
|
|
|
$self->uniq_files; |
60
|
0
|
|
|
|
|
|
$self->sort_files; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head3 walk_INPUT |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
walk the INPUT/OUTPUT and catch all Path::Tiny references |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub walk_INPUT { |
70
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
71
|
0
|
|
|
|
|
|
my $ref = shift; |
72
|
|
|
|
|
|
|
|
73
|
0
|
0
|
|
|
|
|
return unless $ref; |
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
my $ref_name = ref($ref); |
76
|
0
|
0
|
|
|
|
|
return unless $ref_name; |
77
|
0
|
0
|
|
|
|
|
return unless $ref_name eq 'Path::Tiny'; |
78
|
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
|
my $file = $ref->absolute; |
80
|
0
|
|
|
|
|
|
$file = "$file"; |
81
|
0
|
|
|
|
|
|
$self->push_files( $file ); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |