line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Ack::Filter::ExtensionGroup; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
App::Ack::Filter::ExtensionGroup |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 DESCRIPTION |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
The App::Ack::Filter::ExtensionGroup class optimizes multiple ::Extension |
10
|
|
|
|
|
|
|
calls into one container. See App::Ack::Filter::IsGroup for details. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
13
|
|
|
|
|
|
|
|
14
|
4
|
|
|
4
|
|
28
|
use strict; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
108
|
|
15
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
100
|
|
16
|
4
|
|
|
4
|
|
20
|
use parent 'App::Ack::Filter'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
27
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new { |
19
|
0
|
|
|
0
|
0
|
|
my ( $class ) = @_; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
return bless { |
22
|
|
|
|
|
|
|
data => {}, |
23
|
|
|
|
|
|
|
}, $class; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub add { |
27
|
0
|
|
|
0
|
0
|
|
my ( $self, $filter ) = @_; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
foreach my $ext (@{$filter->{extensions}}) { |
|
0
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
$self->{data}->{lc $ext} = 1; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
return; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub filter { |
37
|
0
|
|
|
0
|
1
|
|
my ( $self, $file ) = @_; |
38
|
|
|
|
|
|
|
|
39
|
0
|
0
|
|
|
|
|
if ($file->name =~ /[.]([^.]*)$/) { |
40
|
0
|
|
|
|
|
|
return exists $self->{'data'}->{lc $1}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
return 0; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub inspect { |
47
|
0
|
|
|
0
|
1
|
|
my ( $self ) = @_; |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
return ref($self) . " - $self"; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub to_string { |
53
|
0
|
|
|
0
|
1
|
|
my ( $self ) = @_; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
return join(' ', map { ".$_" } sort keys %{$self->{data}}); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |