On Fri, Jan 20, 2006 at 06:45:13PM -0800, Russ Allbery wrote:
> Fixes the problem with reusing the same formatting object. Everyone can
> now go back to reusing objects and provided that one is using the
> parse_from_file interface, everything should work correctly. Also fixed a
> few other, more minor issues.
>
> The URL
>
> ftp://ftp.eyrie.org/pub/software/modules/podlators-2.0.1.tar.gz
>
> has entered CPAN as
>
> file: $CPAN/authors/id/R/RR/RRA/podlators-2.0.1.tar.gz
> size: 75309 bytes
> md5: ad8df30fef592ad4b410769a2472dd1a
>
> Changes from previous release:
>
> 2006-01-20 Russ Allbery <[EMAIL PROTECTED]>
>
> * VERSION: podlators 2.0.1 released.
>
> * Makefile.PL: Require Pod::Simple 3.04.
>
> * lib/Pod/Man.pm (parse_from_file): New method. Call reinit
> before calling the parent parse_from_file method to preserve the
> previous capability of reusing the same Pod::Man object for
> multiple documents. Close the output file handle after
> Pod::Simple returns to force the output to flush.
> * lib/Pod/Text.pm (parse_from_file): Likewise.
>
> * scripts/pod2man.PL: Use a single object for all conversions.
> * scripts/pod2text.PL: Likewise. Also use parse_from_file, not
> parse_file, since we're passing in two options.
>
> * t/basic.t: Use a single formatting object and don't undef the
> object after formatting.
> * t/color.t: Likewise.
> * t/man.t: Likewise.
> * t/termcap.t: Likewise.
> * t/text-options.t: Likewise.
> * t/text.t: Likewise.
>
> * lib/Pod/Text.pm (pod2text): Pod::Simple's parse_file method only
> takes one argument. Pass the second argument to output_fh
> instead.
>
> * lib/Pod/Man.pm (_handle_element_end): Add trailing parens to the
> end method call to make Perl 5.005 happy.
> * lib/Pod/Text.pm (_handle_element_end): Likewise.
>
Unfortunately, the new version of podlators causes test failures in
lib/Pod/t/Usage.t.(*) I also must have forgotten to send you updates to
t/man.t. This change was to TODO various tests that were not Unicode friendly.
The patch for this is included below against podlators-2.0.
Steve Peters
[EMAIL PROTECTED]
(*) Here's the results I got.
../lib/Pod/t/Usage...........ok 1/8Can't locate object method
"CLOSE" via package "CatchOut" at ../lib/Pod/Text.pm line 594.
# Looks like you planned 8 tests but only ran 1.
# Looks like your test died just after 1.
../lib/Pod/t/Usage...........dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 2-8
Failed 7/8 tests, 12.50% okay
--- t/man.t.old Mon Jan 23 11:18:13 2006
+++ t/man.t Wed Dec 14 10:44:22 2005
@@ -29,7 +29,59 @@
$loaded = 1;
print "ok 1\n";
-my $n = 2;
+SKIP: {
+ if (defined $ENV{PERL_UNICODE}) {
+ print "not ok 2 # TODO Unicode not yet supported\n"
+ } else {
+ my $pod = <<EOP;
+=head1 ACCENTS
+
+Beyoncé! Beyoncé! Beyoncé!!
+
+ Beyoncé! Beyoncé!
+ Beyoncé! Beyoncé!
+ Beyoncé! Beyoncé!
+
+Older versions didn't convert Beyoncé in verbatim.
+EOP
+
+ my $expected = <<"EOM";
+.SH "ACCENTS"
+.IX Header "ACCENTS"
+Beyonce\\*'! Beyonce\\*'! Beyonce\\*'!!
+.PP
+.Vb 3
+\\& Beyonce\\*'! Beyonce\\*'!
+\\& Beyonce\\*'! Beyonce\\*'!
+\\& Beyonce\\*'! Beyonce\\*'!
+.Ve
+.PP
+Older versions didn't convert Beyonce\\*' in verbatim.
+EOM
+ $parser = Pod::Man->new or die "Cannot create parser\n";
+ open my $out_fh, ">", 'out.tmp' or die "Can't open \$out_fh: $!";
+ $parser->output_fh($out_fh);
+ $parser->parse_string_document($pod);
+ close $out_fh;
+ open my $in_fh, "<", 'out.tmp' or die "Can't open \$in_fh: $!";
+ while (<$in_fh>) { last if /^\.TH/; }
+ my $man;
+ {
+ local $/ = undef;
+ $man = <$in_fh>;
+ }
+ close $in_fh;
+ unlink 'out.tmp';
+ if ($man eq $expected) {
+ print "ok 2\n";
+ } else {
+ print "not ok 2\n";
+ print "Expected\n========\n$expected\nOutput\n======\n$man\n";
+ }
+ }
+}
+
+my $n = 3;
while (<DATA>) {
next until $_ eq "###\n";
open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n";
@@ -137,30 +189,6 @@
Not a bullet.
.IP "*" 4
Also not a bullet.
-###
-
-###
-=head1 ACCENTS
-
-Beyoncé! Beyoncé! Beyoncé!!
-
- Beyoncé! Beyoncé!
- Beyoncé! Beyoncé!
- Beyoncé! Beyoncé!
-
-Older versions didn't convert Beyoncé in verbatim.
-###
-.SH "ACCENTS"
-.IX Header "ACCENTS"
-Beyonce\*'! Beyonce\*'! Beyonce\*'!!
-.PP
-.Vb 3
-\& Beyonce\*'! Beyonce\*'!
-\& Beyonce\*'! Beyonce\*'!
-\& Beyonce\*'! Beyonce\*'!
-.Ve
-.PP
-Older versions didn't convert Beyonce\*' in verbatim.
###
###