line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::Assets::Bucket; |
2
|
|
|
|
|
|
|
|
3
|
24
|
|
|
24
|
|
122
|
use warnings; |
|
24
|
|
|
|
|
42
|
|
|
24
|
|
|
|
|
663
|
|
4
|
24
|
|
|
24
|
|
111
|
use strict; |
|
24
|
|
|
|
|
45
|
|
|
24
|
|
|
|
|
685
|
|
5
|
|
|
|
|
|
|
|
6
|
24
|
|
|
24
|
|
110
|
use Object::Tiny qw/kind assets/; |
|
24
|
|
|
|
|
42
|
|
|
24
|
|
|
|
|
120
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
107
|
|
|
107
|
0
|
1455
|
my $self = bless {}, shift; |
10
|
107
|
|
|
|
|
375
|
$self->{kind} = my $kind = shift; |
11
|
107
|
|
|
|
|
242
|
$self->{assets} = my $assets = shift; |
12
|
107
|
|
|
|
|
266
|
$self->{slice} = []; |
13
|
107
|
|
|
|
|
254
|
$self->{filters} = []; |
14
|
107
|
|
|
|
|
497
|
return $self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub add_asset { |
18
|
192
|
|
|
192
|
0
|
266
|
my $self = shift; |
19
|
192
|
|
|
|
|
270
|
my $asset = shift; |
20
|
192
|
|
|
|
|
239
|
push @{ $self->{slice} }, $asset; |
|
192
|
|
|
|
|
1113
|
|
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub add_filter { |
24
|
57
|
|
|
57
|
0
|
81
|
my $self = shift; |
25
|
57
|
|
|
|
|
94
|
my $filter = shift; |
26
|
|
|
|
|
|
|
|
27
|
57
|
|
|
|
|
272
|
my $signature = $filter->signature; |
28
|
57
|
|
|
|
|
132
|
my $filters = $self->{filters}; |
29
|
|
|
|
|
|
|
|
30
|
57
|
50
|
|
|
|
169
|
if (defined $signature) { |
31
|
57
|
|
|
|
|
126
|
for my $entry (@$filters) { |
32
|
1
|
50
|
33
|
|
|
10
|
if (defined $entry->[0] && $entry->[0] eq $signature) { |
33
|
1
|
|
|
|
|
3
|
$entry->[1] = $filter; |
34
|
1
|
|
|
|
|
5
|
return; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
56
|
|
|
|
|
327
|
push @$filters, [ $signature, $filter ]; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub exports { |
43
|
107
|
|
|
107
|
0
|
192
|
my $self = shift; |
44
|
107
|
|
|
|
|
403
|
my @assets = $self->all; |
45
|
107
|
|
|
|
|
258
|
my $filters = $self->{filters}; |
46
|
107
|
|
|
|
|
316
|
for my $entry (@$filters) { |
47
|
56
|
|
|
|
|
1396
|
$entry->[1]->filter(\@assets, $self, $self->assets); |
48
|
|
|
|
|
|
|
} |
49
|
107
|
|
|
|
|
561
|
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
|
107
|
|
|
107
|
0
|
177
|
my $self = shift; |
60
|
107
|
|
|
|
|
176
|
return @{ $self->{slice} }; |
|
107
|
|
|
|
|
420
|
|
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |