Skip Menu |

This queue is for tickets about the Module-Metadata CPAN distribution.

Maintainer(s)' notes

Attention bug reporters: issues MUST include the version of Module::Metadata that you are running that exhibit the stated symptoms. thank you!

Report information
The Basics
Id: 84357
Status: resolved
Priority: 0/
Queue: Module-Metadata

People
Owner: ether [...] cpan.org
Requestors: ether [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: 1.000020



Subject: wishlist: is_indexable method
... as described in https://github.com/xenoterracide/Test-Version/issues/4#issuecomment-15730199 -- there should be a way to interrogate whether the package is "internal", "unindexable" etc. The Dist::Zilla plugin PkgVersion chooses not to add $VERSION lines to .pm files that are "private" using this heuristic: if ($package_stmt->content =~ /package\s*(?:#.*)?\n\s*\Q$package/) { $self->log([ 'skipping private package %s in %s', $package, $file->name ]); next; }
Subject: Re: [rt.cpan.org #84357] wishlist: is_indexable method
Date: Mon, 1 Apr 2013 23:05:36 -0400
To: bug-Module-Metadata [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
Sounds like it can be refactored out of provides(). Patches welcome. :-) David On Mon, Apr 1, 2013 at 10:56 PM, Karen Etheridge via RT <bug-Module-Metadata@rt.cpan.org> wrote: Show quoted text
> Mon Apr 01 22:56:34 2013: Request 84357 was acted upon. > Transaction: Ticket created by ETHER > Queue: Module-Metadata > Subject: wishlist: is_indexable method > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: ether@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=84357 > > > > ... as described in https://github.com/xenoterracide/Test-Version/issues/4#issuecomment-15730199 -- there should be a way to interrogate whether the package is "internal", "unindexable" etc. > > The Dist::Zilla plugin PkgVersion chooses not to add $VERSION lines to .pm files that are "private" using this heuristic: > > if ($package_stmt->content =~ /package\s*(?:#.*)?\n\s*\Q$package/) { > $self->log([ 'skipping private package %s in %s', $package, $file->name ]); > next; > } >
-- David Golden <dagolden@cpan.org> Take back your inbox! → http://www.bunchmail.com/ Twitter/IRC: @xdg
I think this can be done as: 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; }
On 2013-11-20 15:30:22, ETHER wrote: Show quoted text
> I think this can be done as: > > 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; > }
This is implemented in the master branch as https://github.com/Perl-Toolchain-Gang/Module-Metadata/commit/22553051a25f95731d78b2f12fef20cf58218a50
This shipped with 1.000020.