From: Gurusamy Sarathy Date: Mon, 13 Mar 2000 21:08:29 +0000 (+0000) Subject: updates from PodParser v1.12 on CPAN (from Brad Appleton) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=828c4421567f1da54062ec5edfcc3250be409b16;p=p5sagit%2Fp5-mst-13.2.git updates from PodParser v1.12 on CPAN (from Brad Appleton) p4raw-id: //depot/perl@5711 --- diff --git a/lib/Pod/Checker.pm b/lib/Pod/Checker.pm index 0fd36a9..ae32677 100644 --- a/lib/Pod/Checker.pm +++ b/lib/Pod/Checker.pm @@ -1,7 +1,7 @@ ############################################################################# # Pod/Checker.pm -- check pod documents for syntax errors # -# Copyright (C) 1994-1999 by Bradford Appleton. All rights reserved. +# Copyright (C) 1994-2000 by Bradford Appleton. All rights reserved. # This file is part of "PodParser". PodParser is free software; # you can redistribute it and/or modify it under the same terms # as Perl itself. @@ -11,7 +11,7 @@ package Pod::Checker; use vars qw($VERSION); $VERSION = 1.098; ## Current version of this package -require 5.004; ## requires this Perl version or later +require 5.005; ## requires this Perl version or later use Pod::ParseUtils; ## for hyperlinks and lists diff --git a/lib/Pod/Find.pm b/lib/Pod/Find.pm index e29c908..10da904 100644 --- a/lib/Pod/Find.pm +++ b/lib/Pod/Find.pm @@ -14,7 +14,7 @@ package Pod::Find; use vars qw($VERSION); $VERSION = 0.11; ## Current version of this package -require 5.004; ## requires this Perl version or later +require 5.005; ## requires this Perl version or later ############################################################################# diff --git a/lib/Pod/InputObjects.pm b/lib/Pod/InputObjects.pm index 646c008..849182b 100644 --- a/lib/Pod/InputObjects.pm +++ b/lib/Pod/InputObjects.pm @@ -11,8 +11,8 @@ package Pod::InputObjects; use vars qw($VERSION); -$VERSION = 1.11; ## Current version of this package -require 5.004; ## requires this Perl version or later +$VERSION = 1.12; ## Current version of this package +require 5.005; ## requires this Perl version or later ############################################################################# @@ -522,7 +522,7 @@ sub _set_child2parent_links { my ($self, @children) = @_; ## Make sure any sequences know who their parent is for (@children) { - next if (!ref || ref eq 'SCALAR'); + next unless (length and ref and ref ne 'SCALAR'); if (UNIVERSAL::isa($_, 'Pod::InteriorSequence') or UNIVERSAL::can($_, 'nested')) { @@ -922,7 +922,7 @@ sub DESTROY { =head1 SEE ALSO -See L, L, and L. +See L, L =head1 AUTHOR diff --git a/lib/Pod/ParseUtils.pm b/lib/Pod/ParseUtils.pm index 00f516e..2cb8cdc 100644 --- a/lib/Pod/ParseUtils.pm +++ b/lib/Pod/ParseUtils.pm @@ -11,7 +11,7 @@ package Pod::ParseUtils; use vars qw($VERSION); $VERSION = 0.2; ## Current version of this package -require 5.004; ## requires this Perl version or later +require 5.005; ## requires this Perl version or later =head1 NAME diff --git a/lib/Pod/Parser.pm b/lib/Pod/Parser.pm index 88d9aa7..48fc198 100644 --- a/lib/Pod/Parser.pm +++ b/lib/Pod/Parser.pm @@ -10,8 +10,8 @@ package Pod::Parser; use vars qw($VERSION); -$VERSION = 1.11; ## Current version of this package -require 5.004; ## requires this Perl version or later +$VERSION = 1.12; ## Current version of this package +require 5.005; ## requires this Perl version or later ############################################################################# @@ -71,7 +71,7 @@ Pod::Parser - base class for creating POD filters and translators =head1 REQUIRES -perl5.004, Pod::InputObjects, Exporter, Carp +perl5.005, Pod::InputObjects, Exporter, Symbol, Carp =head1 EXPORTS @@ -206,6 +206,12 @@ use Pod::InputObjects; use Carp; use Exporter; require VMS::Filespec if $^O eq 'VMS'; +BEGIN { + if ($] < 5.6) { + require Symbol; + import Symbol; + } +} @ISA = qw(Exporter); ## These "variables" are used as local "glob aliases" for performance @@ -1146,7 +1152,7 @@ sub parse_from_file { my $self = shift; my %opts = (ref $_[0] eq 'HASH') ? %{ shift() } : (); my ($infile, $outfile) = @_; - my ($in_fh, $out_fh); + my ($in_fh, $out_fh) = (gensym, gensym) if ($] < 5.6); my ($close_input, $close_output) = (0, 0); local *myData = $self; local $_; @@ -1197,12 +1203,13 @@ sub parse_from_file { elsif (ref $outfile) { ## Must be a filehandle-ref (or else assume its a ref to an ## object that supports the common IO write operations). - $myData{_OUTFILE} = ${$outfile};; + $myData{_OUTFILE} = ${$outfile}; $out_fh = $outfile; } else { ## We have a filename, open it for writing $myData{_OUTFILE} = $outfile; + (-d $outfile) and croak "$outfile is a directory, not POD input!\n"; open($out_fh, "> $outfile") or croak "Can't open $outfile for writing: $!\n"; $close_output = 1; diff --git a/lib/Pod/Select.pm b/lib/Pod/Select.pm index 53e27e5..5dd1595 100644 --- a/lib/Pod/Select.pm +++ b/lib/Pod/Select.pm @@ -10,8 +10,8 @@ package Pod::Select; use vars qw($VERSION); -$VERSION = 1.11; ## Current version of this package -require 5.004; ## requires this Perl version or later +$VERSION = 1.12; ## Current version of this package +require 5.005; ## requires this Perl version or later ############################################################################# @@ -62,7 +62,7 @@ or =head1 REQUIRES -perl5.004, Pod::Parser, Exporter, Carp +perl5.005, Pod::Parser, Exporter, Carp =head1 EXPORTS diff --git a/lib/Pod/Usage.pm b/lib/Pod/Usage.pm index b8abe7d..aa8f712 100644 --- a/lib/Pod/Usage.pm +++ b/lib/Pod/Usage.pm @@ -10,8 +10,8 @@ package Pod::Usage; use vars qw($VERSION); -$VERSION = 1.11; ## Current version of this package -require 5.004; ## requires this Perl version or later +$VERSION = 1.12; ## Current version of this package +require 5.005; ## requires this Perl version or later =head1 NAME diff --git a/t/pod/testp2pt.pl b/t/pod/testp2pt.pl index 22bbaf8..2ff8aa4 100644 --- a/t/pod/testp2pt.pl +++ b/t/pod/testp2pt.pl @@ -44,13 +44,12 @@ sub catfile(@) { File::Spec->catfile(@_); } my $INSTDIR = abs_path(dirname $0); $INSTDIR = VMS::Filespec::unixpath($INSTDIR) if $^O eq 'VMS'; $INSTDIR =~ s#/$## if $^O eq 'VMS'; -$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'xtra'); $INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'pod'); $INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 't'); my @PODINCDIRS = ( catfile($INSTDIR, 'lib', 'Pod'), + catfile($INSTDIR, 'scripts'), catfile($INSTDIR, 'pod'), - catfile($INSTDIR, 't', 'pod'), - catfile($INSTDIR, 't', 'pod', 'xtra') + catfile($INSTDIR, 't', 'pod') ); ## Find the path to the file to =include @@ -100,6 +99,10 @@ sub command { print $out_fh "###### end =include $incbase #####\n" if ($incdebug); } +sub begin_input { + $_[0]->{_INFILE} = VMS::Filespec::unixify($_[0]->{_INFILE}) if $^O eq 'VMS'; +} + sub podinc2plaintext( $ $ ) { my ($infile, $outfile) = @_; local $_; diff --git a/t/pod/testpchk.pl b/t/pod/testpchk.pl index 640226b..94c0c10 100644 --- a/t/pod/testpchk.pl +++ b/t/pod/testpchk.pl @@ -10,6 +10,7 @@ BEGIN { import TestCompare; my $PARENTDIR = dirname $THISDIR; push @INC, map { File::Spec->catfile($_, 'lib') } ($PARENTDIR, $THISDIR); + require VMS::Filespec if $^O eq 'VMS'; } use Pod::Checker; @@ -30,7 +31,20 @@ sub stripname( $ ) { } sub msgcmp( $ $ ) { + ## filter out platform-dependent aspects of error messages my ($line1, $line2) = @_; + for ($line1, $line2) { + if ( /^#*\s*(\S.*?)\s+(?:has \d+\s*)?pod syntax (?:error|OK)/ ) { + my $fname = $1; + s/^#*\s*// if ($^O eq 'MacOS'); + s/^\s*\Q$fname\E/stripname($fname)/e; + } + elsif ( /^#*\s*\*+\s*(?:ERROR|Unterminated)/ ) { + s/^#*\s*// if ($^O eq 'MacOS'); + s/of file\s+(\S.*?)\s*$/"of file ".stripname($1)/e; + s/at\s+(\S.*?)\s+line/"at ".stripname($1)." line"/e; + } + } return $line1 ne $line2; } @@ -51,6 +65,11 @@ sub testpodcheck( @ ) { print "# Running podchecker for '$testname'...\n"; ## Compare the output against the expected result + if ($^O eq 'VMS') { + for ($infile, $outfile, $cmpfile) { + $_ = VMS::Filespec::unixify($_) unless ref; + } + } podchecker($infile, $outfile); if ( testcmp({'-cmplines' => \&msgcmp}, $outfile, $cmpfile) ) { $different = "$outfile is different from $cmpfile";