Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions lib/MetaCPAN/Document/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -932,16 +932,22 @@ sub set_indexed {
);
}

$self->_set_indexed(
(
if ( my $doc_name = $self->documentation ) {

# .pm file with no package declaration but pod should be indexed
!@{ $self->module } ||
# normalize the documentation name for comparison the same way module
# names are normalized
my $normalized_doc_name = $doc_name =~ s{'}{::}gr;
$self->_set_indexed(
(
# .pm file with no package declaration but pod should be indexed
!@{ $self->module } ||

# don't index if the documentation doesn't match any of its modules
!!grep { $self->documentation eq $_->name } @{ $self->module }
) ? true : false
) if ( $self->documentation );
grep { $normalized_doc_name eq $_->name }
@{ $self->module }
) ? true : false
);
}
}

=head2 set_authorized
Expand Down