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