r31994 - in /trunk/libpod-pom-perl: Changes MANIFEST META.yml Makefile.PL TODO bin/pom2 debian/changelog lib/Pod/POM.pm lib/Pod/POM/Node.pm lib/Pod/POM/Nodes.pm lib/Pod/POM/View/HTML.pm t/complete.t t/htmlview.t t/textview.t

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Thu Mar 12 22:39:35 UTC 2009


Author: gregoa
Date: Thu Mar 12 22:39:32 2009
New Revision: 31994

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=31994
Log:
New upstream release.

Added:
    trunk/libpod-pom-perl/META.yml
      - copied unchanged from r31993, branches/upstream/libpod-pom-perl/current/META.yml
Modified:
    trunk/libpod-pom-perl/Changes
    trunk/libpod-pom-perl/MANIFEST
    trunk/libpod-pom-perl/Makefile.PL
    trunk/libpod-pom-perl/TODO
    trunk/libpod-pom-perl/bin/pom2
    trunk/libpod-pom-perl/debian/changelog
    trunk/libpod-pom-perl/lib/Pod/POM.pm
    trunk/libpod-pom-perl/lib/Pod/POM/Node.pm
    trunk/libpod-pom-perl/lib/Pod/POM/Nodes.pm
    trunk/libpod-pom-perl/lib/Pod/POM/View/HTML.pm
    trunk/libpod-pom-perl/t/complete.t
    trunk/libpod-pom-perl/t/htmlview.t
    trunk/libpod-pom-perl/t/textview.t

Modified: trunk/libpod-pom-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpod-pom-perl/Changes?rev=31994&op=diff
==============================================================================
--- trunk/libpod-pom-perl/Changes (original)
+++ trunk/libpod-pom-perl/Changes Thu Mar 12 22:39:32 2009
@@ -11,6 +11,25 @@
 #------------------------------------------------------------------------
 # $Id: Changes,v 1.8 2003/07/24 15:40:56 abw Exp $
 #========================================================================
+
+#------------------------------------------------------------------------
+# Version 0.18  2009-03-11
+#------------------------------------------------------------------------
+
+* Add patches from RT
+
+  * BOOK's ticket #24266: Proposed correction for bugs #1949 and #5759
+    (As described in tickets #1949 and #5759, the content =begin/=end blocks
+     should be treated as data text (no sequence parsing, etc).)
+
+  * JJ's ticket #16764: Problem handling paragraph separators - incompatibility with perlpodspec
+    (Pod::POM 0.17 does not accept blank lines containing whitespace as
+    paragraph separators, it only accepts blank lines containing no
+    characters at all. According to perlpodspec, blank lines containing
+    whitespace should be taken as paragraph separators.
+
+* Modified pom2 to search for viewer modules other than Pod, Text and
+  HTML in @INC, and to pass any options to the constructor method.
 
 #------------------------------------------------------------------------
 # Version 0.17  

Modified: trunk/libpod-pom-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpod-pom-perl/MANIFEST?rev=31994&op=diff
==============================================================================
--- trunk/libpod-pom-perl/MANIFEST (original)
+++ trunk/libpod-pom-perl/MANIFEST Thu Mar 12 22:39:32 2009
@@ -29,3 +29,4 @@
 t/view.t
 t/warn.t
 t/wrap.t
+META.yml                                 Module meta-data (added by MakeMaker)

Modified: trunk/libpod-pom-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpod-pom-perl/Makefile.PL?rev=31994&op=diff
==============================================================================
--- trunk/libpod-pom-perl/Makefile.PL (original)
+++ trunk/libpod-pom-perl/Makefile.PL Thu Mar 12 22:39:32 2009
@@ -4,6 +4,9 @@
     'NAME'	   => 'Pod::POM',
     'VERSION_FROM' => 'lib/Pod/POM.pm',
     'EXE_FILES'    => [ 'bin/pom2', 'bin/podlint' ],
+    'PREREQ_PM'    => { 
+        'Text::Wrap' => 0,
+    },
     'dist'         => {
 	'COMPRESS' => 'gzip',
 	'SUFFIX'   => 'gz',

Modified: trunk/libpod-pom-perl/TODO
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpod-pom-perl/TODO?rev=31994&op=diff
==============================================================================
--- trunk/libpod-pom-perl/TODO (original)
+++ trunk/libpod-pom-perl/TODO Thu Mar 12 22:39:32 2009
@@ -1,4 +1,6 @@
 * document Pod::POM::View and friends
+
+* add more thorough testing
 
 * fix link generation via L<...>
 

Modified: trunk/libpod-pom-perl/bin/pom2
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpod-pom-perl/bin/pom2?rev=31994&op=diff
==============================================================================
--- trunk/libpod-pom-perl/bin/pom2 (original)
+++ trunk/libpod-pom-perl/bin/pom2 Thu Mar 12 22:39:32 2009
@@ -8,9 +8,11 @@
 #
 # Written by Andy Wardley <abw at kfs.org>.   This is free software.
 #
+# Extended by Andrew Ford to check for any other installed viewers.
 
 use Pod::POM;
 use File::Basename;
+use Getopt::Long;
 
 my $PROGRAM = 'pom2';
 my $program = basename($0);
@@ -20,8 +22,14 @@
     text => 'Text',
     html => 'HTML',
 };
+my %options;
 
 die usage() if grep(/^--?h(elp)?$/, @ARGV);
+
+while (@ARGV and $ARGV[0] =~ /^--([^=]+)(=(.*))?$/) {
+    $options{$1} = $2 ? $3 : 1;
+    shift;
+}
 
 if ($program =~ /^$PROGRAM(.+)$/) {
     $format = $1;
@@ -31,15 +39,41 @@
 	|| die usage('no output format specified');
 }
 
+while (@ARGV and $ARGV[0] =~ /^--([^=]+)(=(.*))?$/) {
+    $options{$1} = $2 ? $3 : 1;
+    shift;
+}
+
 my $file = shift 
     || die usage('no filename specified');
 
 $format = lc $format;
-my $view = $views->{ $format } 
-    || die usage("invalid format '$format', try one of: " 
-	        . join(', ', keys %$views));
+my $view = $views->{ $format };
+
+if (!$view) {
+  DIR:
+    foreach my $libdir (@INC) {
+	foreach (<$libdir/Pod/POM/View/*.pm>) {
+	    (my $module = $_) =~ s{.*/([^/]+).pm$}{$1};
+            if (lc($module) eq $format) {
+		$view = $1;
+		last DIR;
+	    }
+	    else {
+                $views->{lc($module)} = $module;
+	    }
+	}
+    }
+    $view || die usage("invalid format '$format', try one of: " 
+		       . join(', ', sort keys %$views));
+}
 
 $view = "Pod::POM::View::$view";
+if (keys %options) {
+    eval "use $view";
+    $view = $view->new(%options);
+}
+
 Pod::POM->default_view($view)
     || die "$Pod::POM::ERROR\n";
 
@@ -79,24 +113,48 @@
     pom2 html MyFile.pm > MyFile.html
     pom2 pod  MyFile.pm > Myfile.pod
 
+    pom2 format [options] MyFile.pm > Myfile.xyz
+
 =head1 DESCRIPTION
 
-This script uses Pod::POM to convert a Pod document into text,
+This script uses C<Pod::POM> to convert a Pod document into text,
 HTML, back into Pod (e.g. to normalise a document to fix any 
 markup errors), or any other format for which you have a view
 module.
+
+If the viewer is not one of the viewers bundled with C<Pod::POM>, the script
+searches for an installed C<Pod::POM::View> module that matches the
+specified format.  For example if you have C<Pod::POM::View::DocBook>
+installed then you could say:
+
+    pod2 docbook MyFile.pm > MyFile.xml
+
+If any options other than C<--help> are specified then they are passed
+to the constructor method of the view class.  For example:
+
+    pod2 docbook --root=chapter --titlecasing MyFile.pm > MyFile.xml
+
+would convert the Pod document to a DocBook chapter document with the
+titlecasing option enabled.  Note that any string prefixed by "C<-->" is
+taken as a valid option and passed to the constructor; if no value is
+specified then a value of 1 is passed in.
+
 
 =head1 AUTHOR
 
 Andy Wardley E<lt>abw at kfs.orgE<gt>
 
+extended by Andrew Ford E<lt>A.Ford at ford-mason.co.ukE<gt>
+
 =head1 VERSION
 
-This is version 0.2 of pom2.
+This is version 0.3 of pom2.
 
 =head1 COPYRIGHT
 
 Copyright (C) 2000, 2001 Andy Wardley.  All Rights Reserved.
+
+Copyright (C) 2009 Andrew Ford.  All Rights Reserved.
 
 This module is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.

Modified: trunk/libpod-pom-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpod-pom-perl/debian/changelog?rev=31994&op=diff
==============================================================================
--- trunk/libpod-pom-perl/debian/changelog (original)
+++ trunk/libpod-pom-perl/debian/changelog Thu Mar 12 22:39:32 2009
@@ -1,4 +1,4 @@
-libpod-pom-perl (0.17-7) UNRELEASED; urgency=low
+libpod-pom-perl (0.18-1) UNRELEASED; urgency=low
 
   * debian/control: Added: Vcs-Svn field (source stanza); Vcs-Browser
     field (source stanza); Homepage field (source stanza). Removed: XS-
@@ -14,6 +14,8 @@
   * debian/control: Changed: Switched Vcs-Browser field to ViewSVN
     (source stanza).
   * debian/control: Added: ${misc:Depends} to Depends: field.
+
+  * New upstream release.
 
  -- gregor herrmann <gregor+debian at comodo.priv.at>  Tue, 09 Oct 2007 22:31:41 +0200
 

Modified: trunk/libpod-pom-perl/lib/Pod/POM.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpod-pom-perl/lib/Pod/POM.pm?rev=31994&op=diff
==============================================================================
--- trunk/libpod-pom-perl/lib/Pod/POM.pm (original)
+++ trunk/libpod-pom-perl/lib/Pod/POM.pm Thu Mar 12 22:39:32 2009
@@ -9,8 +9,10 @@
 # AUTHOR
 #   Andy Wardley   <abw at wardley.org>
 #
+#   Andrew Ford    <A.Ford at ford-mason.co.uk> (co-maintainer as of 03/2009)
+#
 # COPYRIGHT
-#   Copyright (C) 2000-2003 Andy Wardley.  All Rights Reserved.
+#   Copyright (C) 2000-2009 Andy Wardley.  All Rights Reserved.
 #
 #   This module is free software; you can redistribute it and/or
 #   modify it under the same terms as Perl itself.
@@ -32,7 +34,7 @@
 use vars qw( $VERSION $DEBUG $ERROR $ROOT $TEXTSEQ $DEFAULT_VIEW );
 use base qw( Exporter );
 
-$VERSION = 0.17;
+$VERSION = 0.18;
 $DEBUG   = 0 unless defined $DEBUG;
 $ROOT    = 'Pod::POM::Node::Pod';               # root node class
 $TEXTSEQ = 'Pod::POM::Node::Sequence';          # text sequence class
@@ -172,8 +174,9 @@
     $$line  = 1;
     $inpod  = 0;
 
-    
-    while ($text =~ /(?:(.*?)(\n{2,}))|(.+$)/sg) {
+# patch from JJ    
+#    while ($text =~ /(?:(.*?)(\n{2,}))|(.+$)/sg) {
+    while ($text =~ /(?:(.*?)((?:\s*\n){2,}))|(.+$)/sg) {
 	($para, $gap) = defined $1 ? ($1, $2) : ($3, '');
 
 	if ($para =~ s/^==?(\w+)\s*//) {
@@ -1511,13 +1514,15 @@
 
 Andy Wardley E<lt>abw at kfs.orgE<gt>
 
+Andrew Ford E<lt>A.Ford at ford-mason.co.ukE<gt> (co-maintainer as of 03/2009)
+
 =head1 VERSION
 
-This is version 0.15 of the Pod::POM module.
+This is version 0.18 of the Pod::POM module.
 
 =head1 COPYRIGHT
 
-Copyright (C) 2000-2002 Andy Wardley.  All Rights Reserved.
+Copyright (C) 2000-2009 Andy Wardley.  All Rights Reserved.
 
 This module is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.

Modified: trunk/libpod-pom-perl/lib/Pod/POM/Node.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpod-pom-perl/lib/Pod/POM/Node.pm?rev=31994&op=diff
==============================================================================
--- trunk/libpod-pom-perl/lib/Pod/POM/Node.pm (original)
+++ trunk/libpod-pom-perl/lib/Pod/POM/Node.pm Thu Mar 12 22:39:32 2009
@@ -146,12 +146,14 @@
 	    unless defined $node;
 	push(@{ $self->{ $type   } }, $node);
 	push(@{ $self->{ content } }, $node);
+    $pom->{in_begin} = 1 if $nodeclass eq 'Pod::POM::Node::Begin';
 	return $node;
     }
 
     # REDUCE: expect indicates the token that should terminate this node
     if (defined $expect && ($type eq $expect)) {
 	DEBUG("$name terminated by expected $type\n");
+    $pom->{in_begin} = 0 if $name eq 'begin';
 	return REDUCE;
     }
 

Modified: trunk/libpod-pom-perl/lib/Pod/POM/Nodes.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpod-pom-perl/lib/Pod/POM/Nodes.pm?rev=31994&op=diff
==============================================================================
--- trunk/libpod-pom-perl/lib/Pod/POM/Nodes.pm (original)
+++ trunk/libpod-pom-perl/lib/Pod/POM/Nodes.pm Thu Mar 12 22:39:32 2009
@@ -204,7 +204,7 @@
     my $text  = shift;
     $text = $pom->parse_sequence($text)
         || return $class->error($pom->error())
-            if length $text;
+            if length $text && ! $pom->{in_begin};
     $class->SUPER::new($pom, $text);
 }
 

Modified: trunk/libpod-pom-perl/lib/Pod/POM/View/HTML.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpod-pom-perl/lib/Pod/POM/View/HTML.pm?rev=31994&op=diff
==============================================================================
--- trunk/libpod-pom-perl/lib/Pod/POM/View/HTML.pm (original)
+++ trunk/libpod-pom-perl/lib/Pod/POM/View/HTML.pm Thu Mar 12 22:39:32 2009
@@ -196,7 +196,7 @@
 
 sub view_textblock {
     my ($self, $text) = @_;
-    return "<p>$text</p>\n";
+    return $HTML_PROTECT ? "$text\n" : "<p>$text</p>\n";
 }
 
 

Modified: trunk/libpod-pom-perl/t/complete.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpod-pom-perl/t/complete.t?rev=31994&op=diff
==============================================================================
--- trunk/libpod-pom-perl/t/complete.t (original)
+++ trunk/libpod-pom-perl/t/complete.t Thu Mar 12 22:39:32 2009
@@ -18,7 +18,7 @@
 assert( defined $pom );
 
 # something of a crap test... 
-match( length $pom, 1882 );
+match( length $pom, 1881 );
 
 __DATA__
 =head1 NAME

Modified: trunk/libpod-pom-perl/t/htmlview.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpod-pom-perl/t/htmlview.t?rev=31994&op=diff
==============================================================================
--- trunk/libpod-pom-perl/t/htmlview.t (original)
+++ trunk/libpod-pom-perl/t/htmlview.t Thu Mar 12 22:39:32 2009
@@ -233,7 +233,7 @@
 <li><a name="item_bar"></a><b>bar</b>
 <p>The bar item.</p>
 <ul>
-<p>This is a list within a list </p>
+<p>This is a list within a list</p>
 <li>
 <p>The wiz item.</p>
 </li>
@@ -286,10 +286,10 @@
 </p>
 
 <p>intermediate text</p>
-<p><more>
+<more>
 HTML
-</more></p>
-<p>some text</p>
+</more>
+some text
 <h1>TESTING URLs hyperlinking</h1>
 
 <p>This is an href link1: <a href="http://example.com">http://example.com</a></p>

Modified: trunk/libpod-pom-perl/t/textview.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpod-pom-perl/t/textview.t?rev=31994&op=diff
==============================================================================
--- trunk/libpod-pom-perl/t/textview.t (original)
+++ trunk/libpod-pom-perl/t/textview.t Thu Mar 12 22:39:32 2009
@@ -20,5 +20,5 @@
 #print $pom;
 
 # yet another crap test
-match( length $pom, 1731 );
+match( length $pom, 1730 );
 




More information about the Pkg-perl-cvs-commits mailing list