repository has moved to https://github.com/karenetheridge/Test-EOL
[catagits/Test-EOL.git] / lib / Test / EOL.pm
index 860e427..a1d7a70 100644 (file)
@@ -22,7 +22,6 @@ my %file_find_arg = ($] <= 5.006) ? () : (
 );
 
 my $Test  = Test::Builder->new;
-my $updir = File::Spec->updir();
 
 my $no_plan;
 
@@ -45,7 +44,7 @@ sub import {
 
 sub _all_perl_files {
     my @all_files = _all_files(@_);
-    return grep { _is_perl_module($_) || _is_perl_script($_) } @all_files;
+    return grep { _is_perl_module($_) || _is_perl_script($_) || _is_pod_file($_) } @all_files;
 }
 
 sub _all_files {
@@ -88,7 +87,7 @@ sub _show_whitespace {
 sub _debug_line {
     my ( $options, $line ) = @_;
     $line->[2] =~ s/\n\z//g;
-    return "line $line->[1]: $line->[0] " . (
+    return "line $line->[1]: $line->[0]" . (
       $options->{show_lines} ? qq{: } . _show_whitespace( $line->[2] )  : q{}
     );
 }
@@ -150,6 +149,10 @@ sub _is_perl_module {
     $_[0] =~ /\.pm$/i || $_[0] =~ /::/;
 }
 
+sub _is_pod_file {
+    $_[0] =~ /\.pod$/i;
+}
+
 sub _is_perl_script {
     my $file = shift;
     return 1 if $file =~ /\.pl$/i;
@@ -245,9 +248,9 @@ if you don't export anything, such as for a purely object-oriented module.
   all_perl_files_ok( [ \%options ], [ @directories ] )
 
 Applies C<eol_unix_ok()> to all perl files found in C<@directories> (and sub
-directories). If no <@directories> is given, the starting point is one level
-above the current running script, that should cover all the files of a typical
-CPAN distribution. A perl file is *.pl or *.pm or *.t or a file starting
+directories). If no <@directories> is given, the starting point is the current
+working directory, as tests are usually run from the top directory in a typical
+CPAN distribution. A perl file is *.pl or *.pm or *.pod or *.t or a file starting
 with C<#!...perl>
 
 Valid C<\%options> currently are: