summaryrefslogtreecommitdiff
path: root/lib/Pod
diff options
context:
space:
mode:
authorAdriano Ferreira <a.r.ferreira@gmail.com>2008-04-23 06:45:35 -0300
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-04-26 15:06:16 +0000
commit5f31e3ad80d9344ef722fe0a658ceb2dc559ea8c (patch)
tree3e6c6414f446570d9d582a22155c61099ae0eab0 /lib/Pod
parent406878dddec0512d5dbd1942add8ab7e9ea12a7a (diff)
downloadperl-5f31e3ad80d9344ef722fe0a658ceb2dc559ea8c.tar.gz
update Pod-Perldoc to version 3.14_04
From: "Adriano Ferreira" <a.r.ferreira@gmail.com> Message-ID: <73ddeb6c0804230545v75fee05dmeb849636addb14e1@mail.gmail.com> p4raw-id: //depot/perl@33747
Diffstat (limited to 'lib/Pod')
-rw-r--r--lib/Pod/Perldoc.pm45
1 files changed, 25 insertions, 20 deletions
diff --git a/lib/Pod/Perldoc.pm b/lib/Pod/Perldoc.pm
index 19972b8b24..9ed66e8091 100644
--- a/lib/Pod/Perldoc.pm
+++ b/lib/Pod/Perldoc.pm
@@ -12,7 +12,7 @@ use File::Spec::Functions qw(catfile catdir splitdir);
use vars qw($VERSION @Pagers $Bindir $Pod2man
$Temp_Files_Created $Temp_File_Lifetime
);
-$VERSION = '3.14_02';
+$VERSION = '3.14_04';
#..........................................................................
BEGIN { # Make a DEBUG constant very first thing...
@@ -824,17 +824,20 @@ sub add_formatter_option { # $self->add_formatter_option('key' => 'value');
#.........................................................................
-sub pod_dirs { # @dirs = pod_dirs($translator);
- my $tr = shift;
- return $tr->pod_dirs if $tr->can('pod_dirs');
-
- my $mod = ref $tr || $tr;
- $mod =~ s|::|/|g;
- $mod .= '.pm';
+sub new_translator { # $tr = $self->new_translator($lang);
+ my $self = shift;
+ my $lang = shift;
+
+ my $pack = 'POD2::' . uc($lang);
+ eval "require $pack";
+ if ( !$@ && $pack->can('new') ) {
+ return $pack->new();
+ }
- my $dir = $INC{$mod};
- $dir =~ s/\.pm\z//;
- return $dir;
+ eval { require POD2::Base };
+ return if $@;
+
+ return POD2::Base->new({ lang => $lang });
}
#.........................................................................
@@ -842,15 +845,17 @@ sub pod_dirs { # @dirs = pod_dirs($translator);
sub add_translator { # $self->add_translator($lang);
my $self = shift;
for my $lang (@_) {
- my $pack = 'POD2::' . uc($lang);
- eval "require $pack";
- if ( $@ ) {
- # XXX warn: non-installed translator package
+ my $tr = $self->new_translator($lang);
+ if ( defined $tr ) {
+ push @{ $self->{'translators'} }, $tr;
+ push @{ $self->{'extra_search_dirs'} }, $tr->pod_dirs;
+
+ $self->aside( "translator for '$lang' loaded\n" );
} else {
- push @{ $self->{'translators'} }, $pack;
- push @{ $self->{'extra_search_dirs'} }, pod_dirs($pack);
- # XXX DEBUG
+ # non-installed or bad translator package
+ warn "Perldoc cannot load translator package for '$lang': ignored\n";
}
+
}
return;
}
@@ -1456,13 +1461,13 @@ sub maybe_diddle_INC {
# Does this look like a module or extension directory?
- if (-f "Makefile.PL") {
+ if (-f "Makefile.PL" || -f "Build.PL") {
# Add "." and "lib" to @INC (if they exist)
eval q{ use lib qw(. lib); 1; } or die;
# don't add if superuser
- if ($< && $> && -f "blib") { # don't be looking too hard now!
+ if ($< && $> && -d "blib") { # don't be looking too hard now!
eval q{ use blib; 1 };
warn $@ if $@ && $self->opt_v;
}