line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::Assets::Bucket; |
2
|
|
|
|
|
|
|
|
3
|
23
|
|
|
23
|
|
131
|
use warnings; |
|
23
|
|
|
|
|
38
|
|
|
23
|
|
|
|
|
697
|
|
4
|
23
|
|
|
23
|
|
169
|
use strict; |
|
23
|
|
|
|
|
43
|
|
|
23
|
|
|
|
|
722
|
|
5
|
|
|
|
|
|
|
|
6
|
23
|
|
|
23
|
|
194
|
use Object::Tiny qw/kind assets/; |
|
23
|
|
|
|
|
48
|
|
|
23
|
|
|
|
|
132
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
100
|
|
|
100
|
0
|
1393
|
my $self = bless {}, shift; |
10
|
100
|
|
|
|
|
414
|
$self->{kind} = my $kind = shift; |
11
|
100
|
|
|
|
|
223
|
$self->{assets} = my $assets = shift; |
12
|
100
|
|
|
|
|
304
|
$self->{slice} = []; |
13
|
100
|
|
|
|
|
223
|
$self->{filters} = []; |
14
|
100
|
|
|
|
|
441
|
return $self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub add_asset { |
18
|
185
|
|
|
185
|
0
|
265
|
my $self = shift; |
19
|
185
|
|
|
|
|
261
|
my $asset = shift; |
20
|
185
|
|
|
|
|
241
|
push @{ $self->{slice} }, $asset; |
|
185
|
|
|
|
|
1060
|
|
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub add_filter { |
24
|
57
|
|
|
57
|
0
|
97
|
my $self = shift; |
25
|
57
|
|
|
|
|
102
|
my $filter = shift; |
26
|
|
|
|
|
|
|
|
27
|
57
|
|
|
|
|
251
|
my $signature = $filter->signature; |
28
|
57
|
|
|
|
|
124
|
my $filters = $self->{filters}; |
29
|
|
|
|
|
|
|
|
30
|
57
|
50
|
|
|
|
196
|
if (defined $signature) { |
31
|
57
|
|
|
|
|
218
|
for my $entry (@$filters) { |
32
|
1
|
50
|
33
|
|
|
9
|
if (defined $entry->[0] && $entry->[0] eq $signature) { |
33
|
1
|
|
|
|
|
2
|
$entry->[1] = $filter; |
34
|
1
|
|
|
|
|
4
|
return; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
56
|
|
|
|
|
312
|
push @$filters, [ $signature, $filter ]; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub exports { |
43
|
100
|
|
|
100
|
0
|
186
|
my $self = shift; |
44
|
100
|
|
|
|
|
345
|
my @assets = $self->all; |
45
|
100
|
|
|
|
|
240
|
my $filters = $self->{filters}; |
46
|
100
|
|
|
|
|
228
|
for my $entry (@$filters) { |
47
|
56
|
|
|
|
|
1495
|
$entry->[1]->filter(\@assets, $self, $self->assets); |
48
|
|
|
|
|
|
|
} |
49
|
100
|
|
|
|
|
1432
|
return @assets; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub clear { |
53
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
54
|
0
|
|
|
|
|
0
|
$self->{slice} = []; |
55
|
0
|
|
|
|
|
0
|
$self->{filters} = {}; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub all { |
59
|
100
|
|
|
100
|
0
|
166
|
my $self = shift; |
60
|
100
|
|
|
|
|
127
|
return @{ $self->{slice} }; |
|
100
|
|
|
|
|
404
|
|
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |