X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FModule-Metadata.git;a=blobdiff_plain;f=lib%2FModule%2FMetadata.pm;fp=lib%2FModule%2FMetadata.pm;h=d11c8c0995a7342659699ed5b427e245925e3042;hp=069abb44ea80b57ac59cb03145ca8e239e4b1d5e;hb=22553051a25f95731d78b2f12fef20cf58218a50;hpb=ff5475325a5d499e010afeea7315fe1d0bd58ba3 diff --git a/lib/Module/Metadata.pm b/lib/Module/Metadata.pm index 069abb4..d11c8c0 100644 --- a/lib/Module/Metadata.pm +++ b/lib/Module/Metadata.pm @@ -783,6 +783,18 @@ sub pod { } } +sub is_indexable { + my ($self, $package) = @_; + + my @indexable_packages = grep { $_ ne 'main' } $self->packages_inside; + + # check for specific package, if provided + return !! grep { $_ eq $package } @indexable_packages if $package; + + # otherwise, check for any indexable packages at all + return !! @indexable_packages; +} + 1; =head1 NAME @@ -993,6 +1005,13 @@ Returns true if there is any POD in the file. Returns the POD data in the given section. +=item C<< is_indexable($package) >> or C<< is_indexable() >> + +Returns a boolean indicating whether the package (if provided) or any package +(otherwise) is eligible for indexing by PAUSE, the Perl Authors Upload Server. +Note This only checks for valid C declarations, and does not take any +ownership information into account. + =back =head1 AUTHOR