Permalink
Browse files

import Pod::Simple 2.04 from CPAN

git-cpan-module: Pod::Simple
git-cpan-version: 2.04
git-cpan-authorid: SBURKE
  • Loading branch information...
1 parent 2c19197 commit d6a635479de91ef3e0c4a5ae7f40085c088ce88d Sean M. Burke committed with schwern Oct 11, 2003
Showing with 61 additions and 28 deletions.
  1. +12 −1 ChangeLog
  2. +1 −1 MANIFEST
  3. +2 −2 META.yml
  4. +4 −1 lib/Pod/Simple.pm
  5. +3 −0 lib/Pod/Simple/BlackBox.pm
  6. +1 −0 lib/Pod/Simple/PullParser.pm
  7. +1 −1 lib/Pod/Simple/RTF.pm
  8. +2 −0 lib/Pod/Simple/TiedOutFH.pm
  9. +19 −12 t/corpustest.t
  10. +16 −10 t/encoding_nonesuch.t
View
@@ -1,6 +1,17 @@
-# ChangeLog for Pod::Simple dist # Time-stamp: "2003-09-07 01:41:21 ADT"
+# ChangeLog for Pod::Simple dist # Time-stamp: "2003-10-10 15:46:36 ADT"
#---------------------------------------------------------------------------
+2003-10-10 Sean M. Burke <sburke@cpan.org>
+ * Release 2.04 -- minor bugfix version
+
+ * Added some code to insulate Pod::Simple to runtime changes in
+ the value of $/. Thanks to Iain Truskett for catching this.
+ * Added FILENO method to TiedOutFH.pm, to work quietly under some
+ perls. Thanks to Jochen Stenzel for catching this.
+ * Fixed some tests that erroneously failed under some 5.6's
+ because of chdir()s in *.t files messing up @INC Thanks to many
+ who caught this, including Rocco Caputo.
+
2003-09-07 Sean M. Burke <sburke@cpan.org>
* Release 2.03 -- minor upgrade
* A =head[1234] command now closes any currently open =over, and
View
@@ -129,4 +129,4 @@ t/test_old_perlvar_out.txt
t/verbatim_formatted.t
t/verbatims.t
t/x_nixer.t
-META.yml Module meta-data (added by MakeMaker)
+META.yml Module meta-data (added by MakeMaker)
View
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Pod-Simple
-version: 2.03
+version: 2.04
version_from: lib/Pod/Simple.pm
installdirs: site
requires:
@@ -10,4 +10,4 @@ requires:
utf8: 0
distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.16
+generated_by: ExtUtils::MakeMaker version 6.17
View
@@ -14,15 +14,17 @@ use vars qw(
$VERSION @ISA
@Known_formatting_codes @Known_directives
%Known_formatting_codes %Known_directives
+ $NL
);
@ISA = ('Pod::Simple::BlackBox');
-$VERSION = '2.03';
+$VERSION = '2.04';
@Known_formatting_codes = qw(I B C L E F S X Z);
%Known_formatting_codes = map(($_=>1), @Known_formatting_codes);
@Known_directives = qw(head1 head2 head3 head4 item over back);
%Known_directives = map(($_=>'Plain'), @Known_directives);
+$NL = $/ unless defined $NL;
#-----------------------------------------------------------------------------
# Set up some constants:
@@ -392,6 +394,7 @@ sub parse_file {
until( $self->{'source_dead'} ) {
splice @lines;
for($i = MANY_LINES; $i--;) { # read those many lines at a time
+ local $/ = $NL;
push @lines, scalar(<$source>); # readline
last unless defined $lines[-1];
# but pass thru the undef, which will set source_dead to true
@@ -1599,6 +1599,9 @@ sub pretty { # adopted from Class::Classless
} elsif(ref($_) eq 'ARRAY' or ref($_) eq 'Pod::Simple::LinkSection') {
$x = "[ " . pretty(@$_) . " ]" ;
$x;
+ } elsif(ref($_) eq 'SCALAR') {
+ $x = "\\" . pretty($$_) ;
+ $x;
} elsif(ref($_) eq 'HASH') {
my $hr = $_;
$x = "{" . join(", ",
@@ -123,6 +123,7 @@ sub get_token {
# Read those many lines at a time
for(my $i = Pod::Simple::MANY_LINES; $i--;) {
DEBUG > 3 and print " Fetching a line from source filehandle $fh...\n";
+ local $/ = $Pod::Simple::NL;
push @lines, scalar(<$fh>); # readline
DEBUG > 3 and print " Line is: ",
defined($lines[-1]) ? $lines[-1] : "<undef>\n";
@@ -171,7 +171,7 @@ sub do_middle { # the main work
DEBUG > 1 and print " $type " , $token->text, "\n";
$scratch = $token->text;
- $scratch =~ tr/\t\cb\cc/ /d; # and turn tabs to spaces while we're at it
+ $scratch =~ tr/\t\cb\cc/ /d;
$self->{'no_proofing_exemptions'} or $scratch =~
s/(?:
@@ -54,6 +54,8 @@ sub PRINTF {
return 1;
}
+sub FILENO { ${ $_[0] } + 100 } # just to produce SOME number
+
sub CLOSE { 1 }
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View
@@ -8,20 +8,25 @@ my(@testfiles, %xmlfiles, %wouldxml);
#use Pod::Simple::Debug (10);
BEGIN {
- my $testdir = File::Spec::->catdir( File::Spec::->curdir, 't' );
- if(-e $testdir) {
- chdir $testdir or die "Can't chdir to $testdir : $!";
- }
-
- my $corpusdir = File::Spec::->catdir( File::Spec::->curdir, 'corpus' );
- if(-e $corpusdir) {
- chdir $corpusdir or die "Can't chdir to $corpusdir : $!";
+ my @bits;
+ if(-e( File::Spec::->catdir( @bits =
+ (File::Spec::->curdir, 't', 'corpus') ) )
+ ) {
+ # OK
+ print "# 1Bits: @bits\n";
+ } elsif( -e (File::Spec::->catdir( @bits =
+ (File::Spec::->curdir, 'corpus') ) )
+ ) {
+ # OK
+ print "# 2Bits: @bits\n";
+ } else {
+ die "Can't find the corpusdir";
}
+ my $corpusdir = File::Spec::->catdir( @bits );
+ print "#Corpusdir: $corpusdir\n";
-
- my $thisdir = File::Spec::->curdir;
- opendir(INDIR, $thisdir) or die "Can't opendir $thisdir : $!";
- my @f = map File::Spec::->catfile($thisdir, $_), readdir(INDIR);
+ opendir(INDIR, $corpusdir) or die "Can't opendir corpusdir : $!";
+ my @f = map File::Spec::->catfile(@bits, $_), readdir(INDIR);
closedir(INDIR);
my %f;
@f{@f} = ();
@@ -36,6 +41,8 @@ BEGIN {
last;
}
}
+ die "Too few test files (".@testfiles.")" unless @ARGV or @testfiles > 20;
+
@testfiles = @ARGV if @ARGV and !grep !m/\.txt/, @ARGV;
plan tests => (2 + 2*@testfiles - 1);
View
@@ -13,22 +13,28 @@ use Pod::Simple::DumpAsXML;
my $thefile;
+
+
BEGIN {
+ if( -e
+ ($thefile = File::Spec::->catfile( File::Spec::->curdir, 't', 'corpus', 'nonesuch.txt' ))
+ #or (print("# Nope, not $thefile\n"), 0)
+ ) {
+ # okay,
- my $testdir = File::Spec::->catdir( File::Spec::->curdir, 't' );
- if(-e $testdir) {
- chdir $testdir or die "Can't chdir to $testdir : $!";
- }
+ } elsif( -e
+ ($thefile = File::Spec::->catfile( File::Spec::->curdir, 'corpus', 'nonesuch.txt' ))
+ #or (print("# Nope, not $thefile\n"), 0)
+ ) {
+ # okay,
- my $corpusdir = File::Spec::->catdir( File::Spec::->curdir, 'corpus' );
- if(-e $corpusdir) {
- chdir $corpusdir or die "Can't chdir to $corpusdir : $!";
+ } else {
+ die "Can't find the corpus directory\n Aborting";
}
- $thefile = File::Spec::->catfile( File::Spec::->curdir, 'nonesuch.txt');
- die "Where is nonesuch.txt?!" unless -e $thefile;
+
}
-print "# Testing that nonesuch.txt parses right.\n";
+print "# Testing that $thefile parses right.\n";
my $outstring;
{
my $p = Pod::Simple::DumpAsXML->new;

0 comments on commit d6a6354

Please sign in to comment.