line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::Collector::Processor ; |
2
|
|
|
|
|
|
|
$File::Collector::Processor::VERSION = '0.037'; |
3
|
2
|
|
|
2
|
|
2243
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
59
|
|
4
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
49
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
9
|
use parent 'File::Collector'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
22
|
|
|
22
|
1
|
52
|
my ($class, $all, $cselected, $files) = @_; |
10
|
|
|
|
|
|
|
|
11
|
22
|
|
100
|
|
|
170
|
bless { _files => $files || {}, iterator => [], all => $all, |
12
|
|
|
|
|
|
|
selected => '', cselected => $cselected }, $class; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub next { |
16
|
188
|
|
|
188
|
1
|
429
|
my $s = shift; |
17
|
188
|
100
|
|
|
|
407
|
if (!$s->selected) { |
18
|
18
|
|
|
|
|
26
|
my @files = values %{$s->{_files}}; |
|
18
|
|
|
|
|
60
|
|
19
|
18
|
|
|
|
|
46
|
$s->{iterator} = \@files; |
20
|
|
|
|
|
|
|
} |
21
|
188
|
|
|
|
|
269
|
my $file = shift @{$s->{iterator}}; |
|
188
|
|
|
|
|
309
|
|
22
|
188
|
|
|
|
|
282
|
$s->{selected} = $file; |
23
|
188
|
|
|
|
|
258
|
${$s->{cselected}} = $file->{full_path}; |
|
188
|
|
|
|
|
312
|
|
24
|
188
|
|
|
|
|
474
|
return $s->{selected}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _isa { |
28
|
2
|
|
|
2
|
|
8
|
my $s = shift; |
29
|
2
|
|
|
|
|
5
|
my $file = shift; |
30
|
2
|
|
|
|
|
18
|
return exists $s->{_files}{$file}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _add_file { |
34
|
23
|
|
|
23
|
|
45
|
my ($s, $file, $data) = @_; |
35
|
23
|
|
|
|
|
78
|
$s->{_files}{$file} = $data; # add the file's data to processor |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub do { |
39
|
2
|
|
|
2
|
1
|
13
|
my $s = shift; |
40
|
2
|
|
|
|
|
22
|
bless \$s, 'File::Collector::Processor::Do'; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
{ |
44
|
|
|
|
|
|
|
package File::Collector::Processor::Do; |
45
|
|
|
|
|
|
|
$File::Collector::Processor::Do::VERSION = '0.037'; |
46
|
|
|
|
|
|
|
sub AUTOLOAD { |
47
|
4
|
|
|
4
|
|
7
|
my $self = shift; |
48
|
4
|
|
|
|
|
6
|
our $AUTOLOAD; |
49
|
4
|
|
|
|
|
28
|
my ($method) = $AUTOLOAD =~ m/::([^:]+)$/; |
50
|
4
|
|
|
|
|
15
|
$$self->$method(@_) while ($$self->next); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; # Magic true value |
56
|
|
|
|
|
|
|
# ABSTRACT: Base class for custom File::Collector::Processor classes for processing files classified by a File::Collector class. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |