Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

53 lines (36 sloc) 0.843 kB
package App::Ack::Filter::Is;
use strict;
use warnings;
use base 'App::Ack::Filter';
use File::Spec 3.00 ();
use App::Ack::Filter::IsGroup;
sub new {
my ( $class, $filename ) = @_;
return bless {
filename => $filename,
groupname => 'IsGroup',
}, $class;
}
sub create_group {
return App::Ack::Filter::IsGroup->new();
}
sub filter {
my ( $self, $resource ) = @_;
my $filename = $self->{'filename'};
my $base = (File::Spec->splitpath($resource->name))[2];
return $base eq $filename;
}
sub inspect {
my ( $self ) = @_;
my $filename = $self->{'filename'};
return ref($self) . " - $filename";
}
sub to_string {
my ( $self ) = @_;
my $filename = $self->{'filename'};
return $filename;
}
BEGIN {
App::Ack::Filter->register_filter(is => __PACKAGE__);
}
1;
Jump to Line
Something went wrong with that request. Please try again.