Skip to content

Commit

Permalink
perldoc $module rather than perldoc $main_module (RT#101917)
Browse files Browse the repository at this point in the history
  • Loading branch information
pwr22 committed Feb 10, 2015
1 parent 5ef36f5 commit 1bbefc5
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/Pod/Weaver/Section/Support.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package Pod::Weaver::Section::Support;

use Moose 1.03;
use Moose::Autobox 0.10;
use PPIx::DocumentName;

with 'Pod::Weaver::Role::Section' => { -version => '3.100710' };

Expand Down Expand Up @@ -316,7 +317,7 @@ sub weave_section {
command => 'head1',
content => 'SUPPORT',
children => [
$self->_add_perldoc( $zilla ),
$self->_add_perldoc( $input->{ppi_document} ),
$self->_add_websites( $zilla ),
$self->_add_email( $zilla ),
$self->_add_irc( $zilla ),
Expand Down Expand Up @@ -401,17 +402,13 @@ sub _add_bugs {
}

sub _add_perldoc {
my( $self, $zilla ) = @_;
my( $self, $ppi_doc ) = @_;

# Do we have anything to do?
return () if ! $self->perldoc;

# Don't use $zilla->name as some dists' name is different from the actual module...
# TODO what if user specified $self->all_modules( 1 )? should this use the current filename?
my $main_module = $zilla->main_module->name;
$main_module =~ s|^lib/||i;
$main_module =~ s/\.pm$//;
$main_module =~ s|/|::|g;
# Get the name for the module
my $module = PPIx::DocumentName->extract( $ppi_doc );

# TODO add language detection as per RT#63726

Expand All @@ -426,7 +423,7 @@ EOPOD

} ),
Pod::Elemental::Element::Pod5::Verbatim->new( {
content => " perldoc $main_module",
content => " perldoc $module",
} ),
],
} );
Expand Down

0 comments on commit 1bbefc5

Please sign in to comment.