Parse::LocalDistribution - parses local .pm files as PAUSE does
=head1 SYNOPSIS
use Parse::LocalDistribution;
my $parser = Parse::LocalDistribution->new({ALLOW_DEV_VERSION => 1});
my $provides = $parser->parse('.');
=head1 DESCRIPTION
This is a sister module of L<Parse::PMFile>. This module parses local .pm files (and a META file if any) in a specific (current if not specified) directory, and returns a hash reference that represents "provides" information (with some extra meta data). This is almost the same as L<Module::Metadata> does (which has been in Perl core since Perl 5.13.9). The main difference is the most of the code of this module is directly taken from the PAUSE code as of June 2013. If you need better compatibility to PAUSE, try this. If you need better performance, safety, or portability in general, L<Module::Metadata> may be a better and handier option (L<Parse::PMFile> (and thus L<Parse::LocalDistribution>) actually evaluates code in the $VERSION line (in a Safe compartment), which may be problematic in some cases).
This module doesn't provide a feature to extract a distribution. If you are too lazy to implement it, L<CPAN::ParseDistribution> may be another good option.
=head1 METHODS
=head2 new
creates an object. You can pass an optional path and/or an optional hashref to configure. Options are:
=over 4
=item ALLOW_DEV_VERSION
Parse::LocalDistribution (actually L<Parse::PMFile>) usually ignores a version with an underscore as PAUSE does (because it's for a developer release, and should not be indexed). Set this option to true if you happen to need to keep such a version for better analysis.
=item VERBOSE
Set this to true if you need to know some details.
=item FORK
If you really need to let Parse::PMFile fork while parsing a version (as PAUSE does), set this to true.
=item USERID, PERMISSIONS
Parse::LocalDistribution checks permissions of a package if both USERID and PERMISSIONS (which should be an instance of L<PAUSE::Permissions>) are provided. Unauthorized packages are removed.
=item META_CONTENT
If you already have parsed a META file, set this to avoid parsing the same META file again.
=back
=head2 parse
may take a path to a local distribution, and return a hash reference that holds information for package(s) found in the directory.