forked from beyondgrep/ack2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIsGroup.pm
More file actions
46 lines (31 loc) · 638 Bytes
/
IsGroup.pm
File metadata and controls
46 lines (31 loc) · 638 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package App::Ack::Filter::IsGroup;
use strict;
use warnings;
use base 'App::Ack::Filter';
use File::Spec 3.00 ();
sub new {
my ( $class ) = @_;
return bless {
data => {},
}, $class;
}
sub add {
my ( $self, $filter ) = @_;
$self->{data}->{ $filter->{filename} } = 1;
return;
}
sub filter {
my ( $self, $resource ) = @_;
my $data = $self->{'data'};
my $base = $resource->basename;
return exists $data->{$base};
}
sub inspect {
my ( $self ) = @_;
return ref($self) . " - $self";
}
sub to_string {
my ( $self ) = @_;
return join(' ', keys %{$self->{data}});
}
1;