From: Steve Peters <steve@fisharerojo.org>
Date: Sun, 16 Oct 2005 13:02:19 +0000 (+0000)
Subject: Upgrade to Pod-Parser-1.34 (with some changes to get the new test file
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fb59f973f6f88348284bb8f14a993e802c8f35d7;p=p5sagit%2Fp5-mst-13.2.git

Upgrade to Pod-Parser-1.34 (with some changes to get the new test file
       to work within the core).

p4raw-id: //depot/perl@25765
---

diff --git a/MANIFEST b/MANIFEST
index 28d5296..efaa36c 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1891,6 +1891,7 @@ lib/Pod/t/basic.ovr		podlators test
 lib/Pod/t/basic.pod		podlators test
 lib/Pod/t/basic.t		podlators test
 lib/Pod/t/basic.txt		podlators test
+lib/Pod/t/contains_pod.t	Pod-Parser test
 lib/Pod/t/eol.t			end of line agnosticism
 lib/Pod/Text/Color.pm		Convert POD data to color ASCII text
 lib/Pod/Text/Overstrike.pm	Convert POD data to formatted overstrike text
@@ -2731,6 +2732,7 @@ t/japh/abigail.t		Obscure tests
 t/lib/1_compile.t		See if the various libraries and extensions compile
 t/lib/commonsense.t		See if configuration meets basic needs
 t/lib/compmod.pl		Helper for 1_compile.t
+t/lib/contains_pod.xr		Pod-Parser test file
 t/lib/cygwin.t			Builtin cygwin function tests
 t/lib/Devel/switchd.pm		Module for t/run/switchd.t
 t/lib/Dev/Null.pm		Module for testing Test::Harness
diff --git a/lib/Pod/Find.pm b/lib/Pod/Find.pm
index 7911a55..0b085b8 100644
--- a/lib/Pod/Find.pm
+++ b/lib/Pod/Find.pm
@@ -13,7 +13,7 @@
 package Pod::Find;
 
 use vars qw($VERSION);
-$VERSION = 1.30;   ## Current version of this package
+$VERSION = 1.34;   ## Current version of this package
 require  5.005;   ## requires this Perl version or later
 use Carp;
 
@@ -251,7 +251,7 @@ sub _check_and_extract_name {
 
     # check extension or executable flag
     # this involves testing the .bat extension on Win32!
-    unless(-f $file && -T _ && ($file =~ /\.(pod|pm|plx?)\z/i || -x _ )) {
+    unless(-f $file && -T $file && ($file =~ /\.(pod|pm|plx?)\z/i || -x $file )) {
       return undef;
     }
 
@@ -494,7 +494,7 @@ sub contains_pod {
   local $/ = undef;
   my $pod = <POD>;
   close(POD) || die "Error closing $file: $!\n";
-  unless($pod =~ /\n=(head\d|pod|over|item)\b/s) {
+  unless($pod =~ /^=(head\d|pod|over|item)\b/m) {
     warn "No POD in $file, skipping.\n"
       if($verbose);
     return 0;
diff --git a/lib/Pod/t/contains_pod.t b/lib/Pod/t/contains_pod.t
new file mode 100644
index 0000000..9ebe665
--- /dev/null
+++ b/lib/Pod/t/contains_pod.t
@@ -0,0 +1,25 @@
+#!/usr/bin/env perl
+
+# Copyright (C) 2005  Joshua Hoblitt
+#
+# $Id$
+
+use strict;
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = '../lib';
+    } else {
+        use lib qw( ./lib );
+    }
+}
+
+
+use Test::More tests => 1;
+
+use Pod::Find qw( contains_pod );
+
+{
+    ok(contains_pod('lib/contains_pod.xr'), "contains pod");
+}
diff --git a/t/lib/contains_pod.xr b/t/lib/contains_pod.xr
new file mode 100644
index 0000000..7ea408d
--- /dev/null
+++ b/t/lib/contains_pod.xr
@@ -0,0 +1,5 @@
+=head1 foo
+
+bar baz.
+
+=cut