diff options
author | Steve Hay <steve.m.hay@googlemail.com> | 2019-10-28 08:23:46 +0000 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2019-10-28 08:23:46 +0000 |
commit | 92a915ab903e675cbe7ed2f7508ff3a2cde71186 (patch) | |
tree | d4b6cdfbfe632c0c8f5542f794ae0bdeeefcc06a /cpan/Pod-Simple | |
parent | 83cfb917431918a5da88bf23c217d7ff06af8f1d (diff) | |
download | perl-92a915ab903e675cbe7ed2f7508ff3a2cde71186.tar.gz |
Upgrade Pod::Simple from version 3.39 to 3.40
Diffstat (limited to 'cpan/Pod-Simple')
37 files changed, 237 insertions, 57 deletions
diff --git a/cpan/Pod-Simple/lib/Pod/Simple.pm b/cpan/Pod-Simple/lib/Pod/Simple.pm index 4d75702d06..6c91b8ac1f 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple.pm @@ -18,7 +18,7 @@ use vars qw( ); @ISA = ('Pod::Simple::BlackBox'); -$VERSION = '3.39'; +$VERSION = '3.40'; @Known_formatting_codes = qw(I B C L E F S X Z); %Known_formatting_codes = map(($_=>1), @Known_formatting_codes); @@ -106,6 +106,8 @@ __PACKAGE__->_accessorize( 'preserve_whitespace', # whether to try to keep whitespace as-is 'strip_verbatim_indent', # What indent to strip from verbatim + 'expand_verbatim_tabs', # 0: preserve tabs in verbatim blocks + # n: expand tabs to stops every n columns 'parse_characters', # Whether parser should expect chars rather than octets @@ -223,11 +225,14 @@ sub new { my $class = ref($_[0]) || $_[0]; #Carp::croak(__PACKAGE__ . " is a virtual base class -- see perldoc " # . __PACKAGE__ ); - return bless { + my $obj = bless { 'accept_codes' => { map( ($_=>$_), @Known_formatting_codes ) }, 'accept_directives' => { %Known_directives }, 'accept_targets' => {}, }, $class; + + $obj->expand_verbatim_tabs(8); + return $obj; } diff --git a/cpan/Pod-Simple/lib/Pod/Simple.pod b/cpan/Pod-Simple/lib/Pod/Simple.pod index 6ad790f4d3..c569e979ae 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple.pod +++ b/cpan/Pod-Simple/lib/Pod/Simple.pod @@ -223,6 +223,21 @@ that you don't want I<any> lines indented. You can do something like this: return undef; }); +=item C<< $parser->expand_verbatim_tabs( I<n> ) >> + +Default: 8 + +If after any stripping of indentation in verbatim blocks, there remain +tabs, this method call indicates what to do with them. C<0> +means leave them as tabs, any other number indicates that each tab is to +be translated so as to have tab stops every C<n> columns. + +This is independent of other methods (except that it operates after any +verbatim input stripping is done). + +Like the other methods, the input parameter is not checked for validity. +C<undef> or containing non-digits has the same effect as 8. + =back =head1 TERTIARY METHODS diff --git a/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm b/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm index 6411cfeb0b..d115aee7e3 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm @@ -22,7 +22,7 @@ use integer; # vroom! use strict; use Carp (); use vars qw($VERSION ); -$VERSION = '3.39'; +$VERSION = '3.40'; #use constant DEBUG => 7; sub my_qr ($$) { @@ -1769,6 +1769,13 @@ sub _ponder_Verbatim { $para->[1]{'xml:space'} = 'preserve'; unless ($self->{'_output_is_for_JustPod'}) { + # Fix illegal settings for expand_verbatim_tabs() + # This is because this module doesn't do input error checking, but khw + # doesn't want to add yet another instance of that. + $self->expand_verbatim_tabs(8) + if ! defined $self->expand_verbatim_tabs() + || $self->expand_verbatim_tabs() =~ /\D/; + my $indent = $self->strip_verbatim_indent; if ($indent && ref $indent eq 'CODE') { my @shifted = (shift @{$para}, shift @{$para}); @@ -1780,16 +1787,17 @@ sub _ponder_Verbatim { foreach my $line ($para->[$i]) { # just for aliasing # Strip indentation. $line =~ s/^\Q$indent// if $indent; + next unless $self->expand_verbatim_tabs; # This is commented out because of github issue #85, and the # current maintainers don't know why it was there in the first # place. #&& !($self->{accept_codes} && $self->{accept_codes}{VerbatimFormatted}); while( $line =~ - # Sort of adapted from Text::Tabs -- yes, it's hardwired in that - # tabs are at every EIGHTH column. For portability, it has to be - # one setting everywhere, and 8th wins. - s/^([^\t]*)(\t+)/$1.(" " x ((length($2)<<3)-(length($1)&7)))/e + # Sort of adapted from Text::Tabs. + s/^([^\t]*)(\t+)/$1.(" " x ((length($2) + * $self->expand_verbatim_tabs) + -(length($1)&7)))/e ) {} # TODO: whinge about (or otherwise treat) unindented or overlong lines diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm b/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm index 23d1bb985b..2fef0305a5 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm @@ -9,7 +9,7 @@ use Carp (); use Pod::Simple::Methody (); use Pod::Simple (); use vars qw( @ISA $VERSION ); -$VERSION = '3.39'; +$VERSION = '3.40'; @ISA = ('Pod::Simple::Methody'); BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) ? \&Pod::Simple::DEBUG diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm b/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm index 04d80ee0d5..aaa5a887e6 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm @@ -2,7 +2,7 @@ require 5; package Pod::Simple::Debug; use strict; use vars qw($VERSION ); -$VERSION = '3.39'; +$VERSION = '3.40'; sub import { my($value,$variable); diff --git a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm index 2357b5accf..bade6fcc47 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::DumpAsText; -$VERSION = '3.39'; +$VERSION = '3.40'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} diff --git a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm index cf7ff7b8f4..6f0b7b1862 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::DumpAsXML; -$VERSION = '3.39'; +$VERSION = '3.40'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} diff --git a/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm b/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm index 72a89c5c45..0219b97910 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm @@ -9,7 +9,7 @@ use vars qw( $Doctype_decl $Content_decl ); @ISA = ('Pod::Simple::PullParser'); -$VERSION = '3.39'; +$VERSION = '3.40'; BEGIN { if(defined &DEBUG) { } # no-op elsif( defined &Pod::Simple::DEBUG ) { *DEBUG = \&Pod::Simple::DEBUG } diff --git a/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm b/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm index 93b69833a5..227d6d3af0 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm @@ -5,7 +5,7 @@ use strict; use vars qw( $VERSION $HTML_RENDER_CLASS $HTML_EXTENSION $CSS $JAVASCRIPT $SLEEPY $SEARCH_CLASS @ISA ); -$VERSION = '3.39'; +$VERSION = '3.40'; @ISA = (); # Yup, we're NOT a subclass of Pod::Simple::HTML! # TODO: nocontents stylesheets. Strike some of the color variations? diff --git a/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm b/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm index 674a92d991..b9ca19cdf9 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm @@ -6,7 +6,7 @@ package Pod::Simple::LinkSection; use strict; use Pod::Simple::BlackBox; use vars qw($VERSION ); -$VERSION = '3.39'; +$VERSION = '3.40'; use overload( # So it'll stringify nice '""' => \&Pod::Simple::BlackBox::stringify_lol, diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm b/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm index b4978842fa..5bcee54d4f 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm @@ -4,7 +4,7 @@ package Pod::Simple::Methody; use strict; use Pod::Simple (); use vars qw(@ISA $VERSION); -$VERSION = '3.39'; +$VERSION = '3.40'; @ISA = ('Pod::Simple'); # Yes, we could use named variables, but I want this to be impose diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm b/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm index 9e5078d010..3d6f403112 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::Progress; -$VERSION = '3.39'; +$VERSION = '3.40'; use strict; # Objects of this class are used for noting progress of an diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm index 3428d46737..ceeb3f9250 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm @@ -1,6 +1,6 @@ require 5; package Pod::Simple::PullParser; -$VERSION = '3.39'; +$VERSION = '3.40'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm index ca530f55e3..d9ebdcbcf0 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm @@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken (); use strict; use vars qw(@ISA $VERSION); @ISA = ('Pod::Simple::PullParserToken'); -$VERSION = '3.39'; +$VERSION = '3.40'; sub new { # Class->new(tagname); my $class = shift; diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm index 8224e209e0..61608fb466 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm @@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken (); use strict; use vars qw(@ISA $VERSION); @ISA = ('Pod::Simple::PullParserToken'); -$VERSION = '3.39'; +$VERSION = '3.40'; sub new { # Class->new(tagname, optional_attrhash); my $class = shift; diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm index 4319d70bc2..c8247a081e 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm @@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken (); use strict; use vars qw(@ISA $VERSION); @ISA = ('Pod::Simple::PullParserToken'); -$VERSION = '3.39'; +$VERSION = '3.40'; sub new { # Class->new(text); my $class = shift; diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm index 5268c1f75f..f14b5637cd 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm @@ -3,7 +3,7 @@ require 5; package Pod::Simple::PullParserToken; # Base class for tokens gotten from Pod::Simple::PullParser's $parser->get_token @ISA = (); -$VERSION = '3.39'; +$VERSION = '3.40'; use strict; sub new { # Class->new('type', stuff...); ## Overridden in derived classes anyway diff --git a/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm b/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm index f589183bb2..ed0de149ae 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm @@ -8,7 +8,7 @@ package Pod::Simple::RTF; use strict; use vars qw($VERSION @ISA %Escape $WRAP %Tagmap); -$VERSION = '3.39'; +$VERSION = '3.40'; use Pod::Simple::PullParser (); BEGIN {@ISA = ('Pod::Simple::PullParser')} diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Search.pm b/cpan/Pod-Simple/lib/Pod/Simple/Search.pm index 526b63b66a..a07d33b85a 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Search.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Search.pm @@ -3,7 +3,7 @@ package Pod::Simple::Search; use strict; use vars qw($VERSION $MAX_VERSION_WITHIN $SLEEPY); -$VERSION = '3.39'; ## Current version of this package +$VERSION = '3.40'; ## Current version of this package BEGIN { *DEBUG = sub () {0} unless defined &DEBUG; } # set DEBUG level use Carp (); @@ -12,7 +12,6 @@ $SLEEPY = 1 if !defined $SLEEPY and $^O =~ /mswin|mac/i; # flag to occasionally sleep for $SLEEPY - 1 seconds. $MAX_VERSION_WITHIN ||= 60; -my $IS_CASE_INSENSITIVE = -e uc __FILE__ && -e lc __FILE__; ############################################################################# @@ -26,7 +25,7 @@ use Cwd qw( cwd ); __PACKAGE__->_accessorize( # Make my dumb accessor methods 'callback', 'progress', 'dir_prefix', 'inc', 'laborious', 'limit_glob', 'limit_re', 'shadows', 'verbose', 'name2path', 'path2name', 'recurse', - 'ciseen' + 'ciseen', 'is_case_insensitive' ); #========================================================================== @@ -42,6 +41,7 @@ sub init { $self->inc(1); $self->recurse(1); $self->verbose(DEBUG); + $self->is_case_insensitive(-e uc __FILE__ && -e lc __FILE__); return $self; } @@ -130,12 +130,12 @@ sub _make_search_callback { # Put the options in variables, for easy access my( $laborious, $verbose, $shadows, $limit_re, $callback, $progress, - $path2name, $name2path, $recurse, $ciseen) = + $path2name, $name2path, $recurse, $ciseen, $is_case_insensitive) = map scalar($self->$_()), qw(laborious verbose shadows limit_re callback progress - path2name name2path recurse ciseen); + path2name name2path recurse ciseen is_case_insensitive); my ($seen, $remember, $files_for); - if ($IS_CASE_INSENSITIVE) { + if ($is_case_insensitive) { $seen = sub { $ciseen->{ lc $_[0] } }; $remember = sub { $name2path->{ $_[0] } = $ciseen->{ lc $_[0] } = $_[1]; }; $files_for = sub { my $n = lc $_[0]; grep { lc $path2name->{$_} eq $n } %{ $path2name } }; @@ -259,7 +259,7 @@ sub _path2modname { while(@m and defined($x = lc( $m[0] )) and( $x eq 'site_perl' - or($x eq 'pod' and @m == 1 and $shortname =~ m{^perl.*\.pod$}s ) + or($x =~ m/^pods?$/ and @m == 1 and $shortname =~ m{^perl.*\.pod$}s ) or $x =~ m{\\d+\\.z\\d+([_.]?\\d+)?} # if looks like a vernum or $x eq lc( $Config::Config{'archname'} ) )) { shift @m } @@ -588,7 +588,7 @@ sub find { my $fullext = $fullname . $ext; if ( -f $fullext and $self->contains_pod($fullext) ) { print "FOUND: $fullext\n" if $verbose; - if (@parts > 1 && lc $parts[0] eq 'pod' && $IS_CASE_INSENSITIVE && $ext eq '.pod') { + if (@parts > 1 && lc $parts[0] eq 'pod' && $self->is_case_insensitive() && $ext eq '.pod') { # Well, this file could be for a program (perldoc) but we actually # want a module (Pod::Perldoc). So see if there is a .pm with the # proper casing. @@ -611,7 +611,7 @@ sub find { } # Case-insensitively Look for ./pod directories and slip them in. - for my $subdir ( _actual_filenames($dir, 'pod') ) { + for my $subdir ( _actual_filenames($dir, 'pods'), _actual_filenames($dir, 'pod') ) { if (-d $subdir) { $verbose and print "Noticing $subdir and looking there...\n"; unshift @search_dirs, $subdir; @@ -849,6 +849,20 @@ inspected too, and are noted in the pathname2podname return hash. This attribute's default value is false; and normally you won't need to turn it on. +=item $search->is_case_insensitive( I<true-or-false> ); + +Pod::Simple::Search will by default internally make an assumption +based on the underlying filesystem where the class file is found +whether it is case insensitive or not. + +If it is determined to be case insensitive, during survey() it may +skip pod files/modules that happen to be equal to names it's already +seen, ignoring case. + +However, it's possible to have distinct files in different directories +that intentionally has the same name, just differing in case, that should +be reported. Hence, you may force the behavior by setting this to true +or false. =item $search->limit_re( I<some-regxp> ); @@ -857,7 +871,6 @@ to limit the results just to items whose podnames match the given regexp. Normally this option is not needed, and the more efficient C<limit_glob> attribute is used instead. - =item $search->dir_prefix( I<some-string-value> ); Setting this attribute to a string value means that the searches should diff --git a/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm b/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm index d2c6eb82e8..85dbabcd70 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm @@ -5,7 +5,7 @@ use strict; use Carp (); use Pod::Simple (); use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS); -$VERSION = '3.39'; +$VERSION = '3.40'; BEGIN { @ISA = ('Pod::Simple'); *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG; diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Text.pm b/cpan/Pod-Simple/lib/Pod/Simple/Text.pm index 9209b6e6a2..de50b510ea 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Text.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Text.pm @@ -6,7 +6,7 @@ use Carp (); use Pod::Simple::Methody (); use Pod::Simple (); use vars qw( @ISA $VERSION $FREAKYMODE); -$VERSION = '3.39'; +$VERSION = '3.40'; @ISA = ('Pod::Simple::Methody'); BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) ? \&Pod::Simple::DEBUG diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm b/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm index 74f7367da6..ad4172b7a3 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm @@ -6,7 +6,7 @@ use strict; use Carp (); use Pod::Simple (); use vars qw( @ISA $VERSION ); -$VERSION = '3.39'; +$VERSION = '3.40'; @ISA = ('Pod::Simple'); sub new { diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm b/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm index d2cdde717a..0dd12c412d 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm @@ -4,7 +4,7 @@ package Pod::Simple::TiedOutFH; use Symbol ('gensym'); use Carp (); use vars qw($VERSION ); -$VERSION = '3.39'; +$VERSION = '3.40'; #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm b/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm index 7f003c8298..eb12702282 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm @@ -3,7 +3,7 @@ require 5; package Pod::Simple::Transcode; use strict; use vars qw($VERSION @ISA); -$VERSION = '3.39'; +$VERSION = '3.40'; BEGIN { if(defined &DEBUG) {;} # Okay diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm index d8d0914238..2b675ccb78 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm @@ -5,7 +5,7 @@ require 5; package Pod::Simple::TranscodeDumb; use strict; use vars qw($VERSION %Supported); -$VERSION = '3.39'; +$VERSION = '3.40'; # This module basically pretends it knows how to transcode, except # only for null-transcodings! We use this when Encode isn't # available. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm index 6deb9e756b..99f55683ab 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm @@ -9,7 +9,7 @@ use strict; use Pod::Simple; require Encode; use vars qw($VERSION ); -$VERSION = '3.39'; +$VERSION = '3.40'; sub is_dumb {0} sub is_smart {1} diff --git a/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm b/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm index e10b3732e4..b9c6269bf9 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm @@ -45,7 +45,7 @@ declare the output character set as UTF-8 before parsing, like so: package Pod::Simple::XHTML; use strict; use vars qw( $VERSION @ISA $HAS_HTML_ENTITIES ); -$VERSION = '3.39'; +$VERSION = '3.40'; use Pod::Simple::Methody (); @ISA = ('Pod::Simple::Methody'); diff --git a/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm b/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm index 17c0e02d4c..cb818a1740 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm @@ -5,7 +5,7 @@ use strict; use Carp (); use Pod::Simple (); use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS); -$VERSION = '3.39'; +$VERSION = '3.40'; BEGIN { @ISA = ('Pod::Simple'); *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG; diff --git a/cpan/Pod-Simple/t/JustPod_corpus.t b/cpan/Pod-Simple/t/JustPod_corpus.t index fa2ffbc2f6..e0bb8780f8 100644 --- a/cpan/Pod-Simple/t/JustPod_corpus.t +++ b/cpan/Pod-Simple/t/JustPod_corpus.t @@ -73,10 +73,11 @@ foreach my $file (@test_files) { if ($parser->any_errata_seen()) { pass("Skip '$file' because of pod errors"); + next if "$]" lt '5.010.001'; # note() not found in earlier versions my $errata = $parser->errata_seen(); foreach my $line_number (sort { $a <=> $b } keys %$errata) { foreach my $err_msg (sort @{$errata->{$line_number}}) { - note "$file: $line_number: $err_msg"; + note("$file: $line_number: $err_msg"); } } next; diff --git a/cpan/Pod-Simple/t/content_seen.t b/cpan/Pod-Simple/t/content_seen.t new file mode 100644 index 0000000000..82095bafb2 --- /dev/null +++ b/cpan/Pod-Simple/t/content_seen.t @@ -0,0 +1,34 @@ +BEGIN { + if($ENV{PERL_CORE}) { + chdir 't'; + @INC = '../lib'; + } +} + +use strict; +use Test; +BEGIN { plan tests => 2 }; + +use Pod::Simple::Text; + +my $p = Pod::Simple::Text->new(); +$p->parse_string_document('dm+aSxLl7V3VUJFIe6CFDU13zhZ3yvjIuVkp6l//ZHcDcX014vnnh3FoElI92kFB +JGFU23Vga5Tfz0Epybwio9dq1gzrZ/PIcil2MnEcUWSrIStriv4hAbf0MXcNRHOM +oOV7xKU= +=y6KV +-----END PGP PUBLIC KEY BLOCK-----}; + +print $key; +exit; +'); + +# The =y6KV should not make this appear to be pod +ok ! $p->content_seen; + +my $q = Pod::Simple::Text->new(); +$q->parse_string_document('=head1 yes this is pod + +And this fills it in +'); + +ok $q->content_seen; diff --git a/cpan/Pod-Simple/t/search20.t b/cpan/Pod-Simple/t/search20.t index cbc3ac3fcf..1b17c3b021 100644 --- a/cpan/Pod-Simple/t/search20.t +++ b/cpan/Pod-Simple/t/search20.t @@ -78,16 +78,16 @@ require $ascii_order; { my $names = join "|", sort ascii_order values %$where2name; -skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0, - $names, - "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik"; +skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0, + $names, + "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzoned|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik"; } { my $names = join "|", sort ascii_order keys %$name2where; -skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0, - $names, - "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik"; +skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0, + $names, + "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzoned|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik"; } ok( ($name2where->{'squaa'} || 'huh???'), '/squaa\.pm$/'); diff --git a/cpan/Pod-Simple/t/search22.t b/cpan/Pod-Simple/t/search22.t index c6b33eea75..6fb498a331 100644 --- a/cpan/Pod-Simple/t/search22.t +++ b/cpan/Pod-Simple/t/search22.t @@ -8,7 +8,7 @@ BEGIN { use strict; use Pod::Simple::Search; use Test; -BEGIN { plan tests => 13 } +BEGIN { plan tests => 15 } print "# ", __FILE__, ": Testing the scanning of several docroots...\n"; @@ -80,17 +80,17 @@ require $ascii_order; { print "# won't show any shadows, since we're just looking at the name2where keys\n"; my $names = join "|", sort ascii_order keys %$name2where; -skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0, - $names, - "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik"; +skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0, + $names, + "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzoned|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik"; } { print "# but here we'll see shadowing:\n"; my $names = join "|", sort ascii_order values %$where2name; -skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0, - $names, - "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Glunk|hinkhonk::Vliff|hinkhonk::Vliff|perlflif|perlthng|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Vliff|squaa::Vliff|squaa::Wowo|zikzik"; +skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0, + $names, + "Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Glunk|hinkhonk::Vliff|hinkhonk::Vliff|perlflif|perlthng|perlthng|perlzoned|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Vliff|squaa::Vliff|squaa::Wowo|zikzik"; my %count; for(values %$where2name) { ++$count{$_} }; @@ -120,7 +120,9 @@ skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0, ($name2where->{'squaa::Wowo'} || 'huh???'), '/testlib2/'; - +my $in_pods = $x->find('perlzoned', $here2); +ok $in_pods, qr{^\Q$here2\E}; +ok $in_pods, qr{perlzoned.pod$}; print "# OK, bye from ", __FILE__, "\n"; ok 1; diff --git a/cpan/Pod-Simple/t/search60.t b/cpan/Pod-Simple/t/search60.t new file mode 100644 index 0000000000..4ffbbb173a --- /dev/null +++ b/cpan/Pod-Simple/t/search60.t @@ -0,0 +1,56 @@ +BEGIN {
+ if($ENV{PERL_CORE}) {
+ chdir 't';
+ @INC = '../lib';
+ }
+}
+
+use strict;
+use Pod::Simple::Search;
+use Test;
+BEGIN { plan tests => 4 }
+
+print "# ", __FILE__,
+ ": Testing forced case sensitivity ...\n";
+
+my $x = Pod::Simple::Search->new;
+die "Couldn't make an object!?" unless ok defined $x;
+
+$x->inc(0);
+$x->is_case_insensitive(0);
+
+use File::Spec;
+use Cwd;
+my $cwd = cwd();
+print "# CWD: $cwd\n";
+
+sub source_path {
+ my $file = shift;
+ if ($ENV{PERL_CORE}) {
+ my $updir = File::Spec->updir;
+ my $dir = File::Spec->catdir($updir, 'lib', 'Pod', 'Simple', 't');
+ return File::Spec->catdir ($dir, $file);
+ } else {
+ return $file;
+ }
+}
+
+my($A, $B);
+
+if( -e ($A = source_path( 'search60/A' ))) {
+ die "But where's $B?"
+ unless -e ($B = source_path( 'search60/B'));
+} elsif( -e ($A = File::Spec->catdir($cwd, 't', 'search60', 'A' ))) {
+ die "But where's $B?"
+ unless -e ($B = File::Spec->catdir($cwd, 't', 'search60', 'B'));
+} else {
+ die "Can't find the test corpora";
+}
+print "# OK, found the test corpora\n# as $A\n# and $B\n#\n";
+ok 1;
+
+my($name2where, $where2name) = $x->survey($A, $B);
+
+ok ($name2where->{x} =~ m{^\Q$A\E[\\/]x\.pod$});
+
+ok ($name2where->{X} =~ m{^\Q$B\E[\\/]X\.pod$});
diff --git a/cpan/Pod-Simple/t/search60/A/x.pod b/cpan/Pod-Simple/t/search60/A/x.pod new file mode 100644 index 0000000000..393200433b --- /dev/null +++ b/cpan/Pod-Simple/t/search60/A/x.pod @@ -0,0 +1 @@ +=head1 x
diff --git a/cpan/Pod-Simple/t/search60/B/X.pod b/cpan/Pod-Simple/t/search60/B/X.pod new file mode 100644 index 0000000000..654c580f8a --- /dev/null +++ b/cpan/Pod-Simple/t/search60/B/X.pod @@ -0,0 +1 @@ +=head1 X
diff --git a/cpan/Pod-Simple/t/strpvbtm.t b/cpan/Pod-Simple/t/strpvbtm.t index 8650fb8131..25c41cc55b 100644 --- a/cpan/Pod-Simple/t/strpvbtm.t +++ b/cpan/Pod-Simple/t/strpvbtm.t @@ -8,7 +8,7 @@ BEGIN { use strict; use lib '../lib'; -use Test::More tests => 87; +use Test::More tests => 103; #use Test::More 'no_plan'; use_ok('Pod::Simple::XHTML') or exit; @@ -116,3 +116,42 @@ for my $spec ( ok $p->parse_string_document( $pod ), "Parse POD to XHTML for $desc"; is $output, $xhtml, "Should have expected XHTML output for $desc"; } + +for my $spec ( + [ + "\n=pod\n\n\t\tfoo bar baz\n", + 0, + "<pre><code>\t\tfoo bar baz</code></pre>\n\n", + 'preserve tabs' + ], + [ + "\n=pod\n\n\t\tfoo bar baz\n", + undef, + "<pre><code> foo bar baz</code></pre>\n\n", + 'preserve tabs' + ], + [ + "\n=pod\n\n\t\tfoo bar baz\n", + -1, + "<pre><code> foo bar baz</code></pre>\n\n", + 'preserve tabs' + ], + [ + "\n=pod\n\n\t\tfoo bar baz\n", + 1, + "<pre><code> foo bar baz</code></pre>\n\n", + 'tabs are xlate to one space each' + ], +) { + my ($pod, $tabs, $xhtml, $desc) = @$spec; + # Test XHTML output. + ok my $p = Pod::Simple::XHTML->new, "Construct XHMTL parser to test $desc"; + $p->html_header(''); + $p->html_footer(''); + my $output = ''; + $p->output_string( \$output ); + is $tabs, $p->expand_verbatim_tabs($tabs), + 'Set tab for XHTML to ' . (defined $tabs ? qq{"$tabs"} : 'undef'); + ok $p->parse_string_document( $pod ), "Parse POD to XHTML for $desc"; + is $output, $xhtml, "Should have expected XHTML output for $desc"; +} diff --git a/cpan/Pod-Simple/t/testlib2/pods/perlzoned.pod b/cpan/Pod-Simple/t/testlib2/pods/perlzoned.pod new file mode 100644 index 0000000000..66dcbf4172 --- /dev/null +++ b/cpan/Pod-Simple/t/testlib2/pods/perlzoned.pod @@ -0,0 +1,5 @@ +=head1 NAME + +perlzoned - This is just some test file + +=cut |