Permalink
Browse files

Add default filter

  • Loading branch information...
1 parent 7caee45 commit e0aa3d361ad2cc93c899c0ee3611102f7dd8a061 @hoelzro hoelzro committed Nov 14, 2011
Showing with 39 additions and 18 deletions.
  1. +19 −0 Default.pm
  2. +20 −18 Makefile.PL
View
@@ -0,0 +1,19 @@
+package App::Ack::Filter::Default;
+
+use strict;
+use warnings;
+use base 'App::Ack::Filter';
+
+sub new {
+ my ( $class ) = @_;
+
+ return bless {}, $class;
+}
+
+sub filter {
+ my ( $self, $resource ) = @_;
+
+ return -T $resource->name;
+}
+
+1;
View
@@ -25,6 +25,7 @@ my %parms = (
'FirstLineMatch.pm' => '$(INST_LIBDIR)/App/Ack/Filter/FirstLineMatch.pm',
'Is.pm' => '$(INST_LIBDIR)/App/Ack/Filter/Is.pm',
'Match.pm' => '$(INST_LIBDIR)/App/Ack/Filter/Match.pm',
+ 'Default.pm' => '$(INST_LIBDIR)/App/Ack/Filter/Default.pm',
},
EXE_FILES => [ 'ack' ],
PREREQ_PM => {
@@ -72,24 +73,25 @@ sub MY::top_targets {
sub MY::postamble {
my $file_next_filename = qx(perldoc -l File::Next);
my $postamble = sprintf(<<'MAKE_FRAG', $debug_mode);
-ACK = ack
-BASE = ack-base
-ACK_PM = Ack.pm
-RESOURCE_PM = Resource.pm
-RESOURCES_PM = Resources.pm
-BASIC_PM = Basic.pm
-CONFIG_FINDER_PM = ConfigFinder.pm
-CONFIG_LOADER_PM = ConfigLoader.pm
-FILTER_PM = Filter.pm
-EXT_FILTER_PM = Extension.pm
-FIRST_FILTER_PM = FirstLineMatch.pm
-IS_FILTER_PM = Is.pm
-MATCH_FILTER_PM = Match.pm
-ALL_PM = $(ACK_PM) $(RESOURCE_PM) $(RESOURCES_PM) $(BASIC_PM) $(FILTER_PM) $(EXT_FILTER_PM) $(FIRST_FILTER_PM) $(IS_FILTER_PM) $(MATCH_FILTER_PM) $(CONFIG_FINDER_PM) $(CONFIG_LOADER_PM)
-ACK_HELP = ack-help.txt
-ACK_HELP_TYPES = ack-help-types.txt
-ACK_HELP_DIRS = ack-help-dirs.txt
-PERL_T = $(PERL) -T
+ACK = ack
+BASE = ack-base
+ACK_PM = Ack.pm
+RESOURCE_PM = Resource.pm
+RESOURCES_PM = Resources.pm
+BASIC_PM = Basic.pm
+CONFIG_FINDER_PM = ConfigFinder.pm
+CONFIG_LOADER_PM = ConfigLoader.pm
+FILTER_PM = Filter.pm
+EXT_FILTER_PM = Extension.pm
+FIRST_FILTER_PM = FirstLineMatch.pm
+IS_FILTER_PM = Is.pm
+MATCH_FILTER_PM = Match.pm
+DEFAULT_FILTER_PM = Default.pm
+ALL_PM = $(ACK_PM) $(RESOURCE_PM) $(RESOURCES_PM) $(BASIC_PM) $(FILTER_PM) $(EXT_FILTER_PM) $(FIRST_FILTER_PM) $(IS_FILTER_PM) $(MATCH_FILTER_PM) $(DEFAULT_FILTER_PM) $(CONFIG_FINDER_PM) $(CONFIG_LOADER_PM)
+ACK_HELP = ack-help.txt
+ACK_HELP_TYPES = ack-help-types.txt
+ACK_HELP_DIRS = ack-help-dirs.txt
+PERL_T = $(PERL) -T
.PHONY: tags critic

0 comments on commit e0aa3d3

Please sign in to comment.