Skip to content

Commit

Permalink
fix Log::Log4perl::FAQ not being indexed properly
Browse files Browse the repository at this point in the history
  • Loading branch information
monken committed Feb 14, 2012
1 parent d7fe7ed commit 8b0aacd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
12 changes: 9 additions & 3 deletions lib/MetaCPAN/Script/Release.pm
Expand Up @@ -343,12 +343,18 @@ sub import_tarball {
: 0
) unless ( $mod->indexed );
}
$file->indexed( !!grep { $file->documentation eq $_->name }
@{ $file->module } )
if ( $file->documentation );
$file->indexed(

# .pm file with no package declaration but pod should be indexed
!@{ $file->module } ||

# don't index if the documentation doesn't match any of its modules
!!grep { $file->documentation eq $_->name } @{ $file->module }
) if ( $file->documentation );
log_trace {"reindexing file $file->{path}"};
$file->clear_module if ( $file->is_pod_file );
$bulk->put($file);

}
$bulk->commit;

Expand Down
8 changes: 8 additions & 0 deletions t/release/moose.t
Expand Up @@ -16,4 +16,12 @@ map { $first++ } grep { $_->first } @moose;

ok($first, 'only one moose is first');

ok(my $faq = $idx->type('file')->filter({
term => { 'file.documentation' => 'Moose::FAQ' }
})->first, 'get Moose::FAQ');

is($faq->status, 'latest', 'is latest');

ok($faq->indexed, 'is indexed');

done_testing;
6 changes: 5 additions & 1 deletion t/var/fakecpan/configs/moose-recent.json
Expand Up @@ -11,6 +11,10 @@
{
"file": "t/foo.t",
"content": "use Test::More;"
} ]
},
{
"file": "lib/Moose/FAQ.pm",
"content": "1; \n\n=head1 NAME\n\nMoose::FAQ - abstract"
}]
}
}

0 comments on commit 8b0aacd

Please sign in to comment.