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 4, 2015
1 parent 5ef36f5 commit 028a126
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/Pod/Weaver/Section/Support.pm
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ sub weave_section {
command => 'head1',
content => 'SUPPORT',
children => [
$self->_add_perldoc( $zilla ),
$self->_add_perldoc( $input ),
$self->_add_websites( $zilla ),
$self->_add_email( $zilla ),
$self->_add_irc( $zilla ),
Expand Down Expand Up @@ -401,17 +401,13 @@ sub _add_bugs {
}

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

# 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, borrow from Pod::Weaver
my $module = Pod::Weaver::Section::Name->_get_docname( $input );

# TODO add language detection as per RT#63726

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

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

0 comments on commit 028a126

Please sign in to comment.