Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dist::metadata(3pm) [debian man page]

Dist::Metadata(3pm)					User Contributed Perl Documentation				       Dist::Metadata(3pm)

NAME
Dist::Metadata - Information about a perl module distribution VERSION
version 0.923 SYNOPSIS
my $dist = Dist::Metadata->new(file => $path_to_archive); my $description = sprintf "Dist %s (%s)", $dist->name, $dist->version; my $provides = $dist->package_versions; while( my ($package, $version) = each %$provides ){ print "$description includes $package $version "; } DESCRIPTION
This module provides an easy interface for getting various metadata about a Perl module distribution. It takes care of the common logic of: o reading a tar file (Archive::Tar) o finding and reading the correct META file if the distribution contains one (CPAN::Meta) o and determining some of the metadata if there is no META file (Module::Metadata, CPAN::DistnameInfo) This is mostly a wrapper around CPAN::Meta providing an easy interface to find and load the meta file from a tar.gz file. A dist can also be represented by a directory or merely a structure of data. If the dist does not contain a meta file the module will attempt to determine some of that data from the dist. NOTE: This interface is still being defined. Please submit any suggestions or concerns. METHODS
new Dist::Metadata->new(file => $path); A dist can be represented by a tar file, a directory, or a data structure. The format will be determined by the presence of the following options (checked in this order): o "struct" - hash of data to build a mock dist; See Dist::Metadata::Struct. o "dir" - path to the root directory of a dist o "file" - the path to a .tar.gz file You can also slyly pass in your own object as a "dist" parameter in which case this module will just use that. This can be useful if you need to use your own subclass (perhaps while developing a new format). Other options that can be specified: o "name" - dist name o "version" - dist version o "determine_packages" - boolean to indicate whether dist should be searched for packages if no META file is found. Defaults to true. o "include_inner_packages" - When determining provided packages the default behavior is to only include packages that match the name of the file that defines them (like "Foo::Bar" matches "*/Bar.pm"). This way only modules that can be loaded (via "use" or "require") will be returned (and "inner" packages will be ignored). This mimics the behavior of PAUSE. Set this to true to include any "inner" packages provided by the dist (that are not otherwise excluded by another mechanism (such as "no_index")). dist Returns the dist object (subclass of Dist::Metadata::Dist). default_metadata Returns a hashref of default values used to initialize a CPAN::Meta object when a META file is not found. Called from "determine_metadata". determine_metadata Examine the dist and try to determine metadata. Returns a hashref which can be passed to "new" in CPAN::Meta. This is used when the dist does not contain a META file. determine_packages my $provides = $dm->determine_packages($meta); Attempt to determine packages provided by the dist. This is used when the META file does not include a "provides" section and "determine_packages" is not set to false in the constructor. If a CPAN::Meta object is not provided a default one will be used. Files contained in the dist and packages found therein will be checked against the meta object's "no_index" attribute (see "should_index_file" in CPAN::Meta and "should_index_package" in CPAN::Meta). By default this ignores any files found in inc/, t/, or xt/ directories. load_meta Loads the metadata from the "dist". meta Returns the CPAN::Meta instance in use. meta_from_struct $meta = $dm->meta_from_struct(\%struct); Passes the the provided "\%struct" to "create" in CPAN::Meta and returns the result. package_versions $pv = $dm->package_versions(); # { 'Package::Name' => '1.0', 'Module::2' => '2.1' } Returns a simplified version of "provides": a hashref with package names as keys and versions as values. This can also be called as a class method which will operate on a passed in hashref. $pv = Dist::Metadata->package_versions(\%provides); INHERITED METHODS
The following methods are available on this object and simply call the corresponding method on the CPAN::Meta object. o name o provides o version TODO
o More tests o "trust_meta" option (to allow setting it to false) o Guess main module from dist name if no packages can be found o Determine abstract? o Add change log info (CPAN::Changes)? o Subclass as "CPAN::Dist::Metadata" just so that it has "CPAN" in the name? o Use File::Find::Rule::Perl? SEE ALSO
Dependencies o CPAN::Meta o Module::Metadata o CPAN::DistnameInfo Related Modules o MyCPAN::Indexer o CPAN::ParseDistribution SUPPORT
Perldoc You can find documentation for this module with the perldoc command. perldoc Dist::Metadata Websites The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources. o Search CPAN The default CPAN search engine, useful to view POD in HTML format. http://search.cpan.org/dist/Dist-Metadata <http://search.cpan.org/dist/Dist-Metadata> o RT: CPAN's Bug Tracker The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN. http://rt.cpan.org/NoAuth/Bugs.html?Dist=Dist-Metadata <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Dist-Metadata> o CPAN Ratings The CPAN Ratings is a website that allows community ratings and reviews of Perl modules. http://cpanratings.perl.org/d/Dist-Metadata <http://cpanratings.perl.org/d/Dist-Metadata> o CPAN Testers The CPAN Testers is a network of smokers who run automated tests on uploaded CPAN distributions. http://www.cpantesters.org/distro/D/Dist-Metadata <http://www.cpantesters.org/distro/D/Dist-Metadata> o CPAN Testers Matrix The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms. http://matrix.cpantesters.org/?dist=Dist-Metadata <http://matrix.cpantesters.org/?dist=Dist-Metadata> o CPAN Testers Dependencies The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution. <http://deps.cpantesters.org/?module=Dist::Metadata> Bugs / Feature Requests Please report any bugs or feature requests by email to "bug-dist-metadata at rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Dist-Metadata <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Dist-Metadata>. You will be automatically notified of any progress on the request by the system. Source Code https://github.com/rwstauner/Dist-Metadata <https://github.com/rwstauner/Dist-Metadata> git clone https://github.com/rwstauner/Dist-Metadata.git AUTHOR
Randy Stauner <rwstauner@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Randy Stauner. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-19 Dist::Metadata(3pm)
Man Page