Skip to content

Commit

Permalink
fixed makefile problems
Browse files Browse the repository at this point in the history
  • Loading branch information
petdance committed Jul 15, 2008
1 parent 3b5f1a8 commit 6576bf2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
7 changes: 5 additions & 2 deletions Ack.pm
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,11 @@ sub filetypes {

return 'skipped' unless is_searchable( $filename );

return ('make',TEXT) if $filename =~ m{[$dir_sep_chars]?Makefile$}io;
return ('rake','ruby',TEXT) if $filename =~ m{[$dir_sep_chars]?Rakefile$}io;
my $basename = $filename;
$basename =~ s{.*[$dir_sep_chars]}{};

return ('make',TEXT) if lc $basename eq 'makefile';
return ('rake','ruby',TEXT) if lc $basename eq 'rakefile';

# If there's an extension, look it up
if ( $filename =~ m{\.([^\.$dir_sep_chars]+)$}o ) {
Expand Down
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ NEXT
[ENHANCEMENTS]
Added support for --rake files, which are also --ruby files.

[FIXES]
Fixed a bug where files ending in "Makefile" were mistakenly
identified as Makefiles.


1.86 Wed Jul 9 01:27:21 CDT 2008
[ENHANCEMENTS]
Expand Down
9 changes: 6 additions & 3 deletions ack-standalone
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ Files with the given EXTENSION(s) are recognized as being of type
TYPE. This replaces an existing definition for type TYPE. See also
L</"Defining your own types">.
=item B<-u, --unrestricted>
=item B<-u>, B<--unrestricted>
All files and directories (including blib/, core.*, ...) are searched,
nothing is skipped. When both B<-u> and B<--ignore-dir> are used, the
Expand Down Expand Up @@ -1363,8 +1363,11 @@ sub filetypes {

return 'skipped' unless is_searchable( $filename );

return ('make',TEXT) if $filename =~ m{[$dir_sep_chars]?Makefile$}io;
return ('rake','ruby',TEXT) if $filename =~ m{[$dir_sep_chars]?Rakefile$}io;
my $basename = $filename;
$basename =~ s{.*[$dir_sep_chars]}{};

return ('make',TEXT) if lc $basename eq 'makefile';
return ('rake','ruby',TEXT) if lc $basename eq 'rakefile';

# If there's an extension, look it up
if ( $filename =~ m{\.([^\.$dir_sep_chars]+)$}o ) {
Expand Down
2 changes: 2 additions & 0 deletions t/ack-text.t
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ ACK_F_TEXT: {
t/swamp/javascript.js
t/swamp/Makefile
t/swamp/Makefile.PL
t/swamp/notaMakefile
t/swamp/notaRakefile
t/swamp/options.pl
t/swamp/parrot.pir
t/swamp/perl-test.t
Expand Down

0 comments on commit 6576bf2

Please sign in to comment.