Skip to content

thaljef/Dist-Requires

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

Dist::Requires - Identify prerequisites for a distribution

VERSION

version 0.008

SYNOPSIS

use Dist::Requires;
my $dr = Dist::Requires->new();

# From a packed distribution archive file...
my %prereqs = $dr->prerequisites(dist => 'Foo-Bar-1.2.tar.gz');

# From an unpacked distribution directory...
my %prereqs = $dr->prerequisites(dist => 'Foo-Bar-1.2');

DESCRIPTION

Dist::Requires reports the packages (and their versions) that are required to configure, test, build, and install a distribution. The distribution may be either a packed distribution archive or an unpacked distribution directory. By default, the results will exclude requirements that are satisfied by the perl core.

Dist::Requires is intended for discovering requirements in the same manner and context that cpan and cpanm do it. It is specifically designed to support Pinto, so I don't expect this module to be useful to you unless you are doing something that deals directly with the CPAN toolchain.

Dist::Requires does not recurse into dependencies, it does not scan source files for packages that you use or require, it does not search for distribution metadata on CPAN, and it does not generate pretty graphs. If you need those things, please ["SEE ALSO"](#SEE ALSO).

CONSTRUCTOR

new( %attributes )

All of the attributes listed below can be set via the constructor, and retrieved via accessor methods by the same name. Once constructed, the object is immutable and all attributes are read-only.

ATTRIBUTES

target_perl => $PATH

The path to the perl executable that will be used to configure the distribution. Defaults to the perl that loaded this module. NOTE: this attribute is not configurable at this time.

target_perl_version => $VERSION

The core module list for the specified perl version will be used to filter the requirements. This only matters if you're using the default package filter. Defaults to the version of the perl specified by the perl attribute. Can be specified as a decimal number, a dotted version string, or a version object.

timeout => $INTEGER

Sets the timeout (in seconds) for running the distribution's configuration step. Defaults to 30 seconds.

filter => $HASHREF

Given a hashref of MODULE_NAME => VERSION pairs, any distribution requirements that have the same version or less than those listed in the hashref will be excluded from the output. This defaults to the modules and versions reported by Module::CoreList for the version of perl that was specified by the target_perl_version attribute. If you don't want any filter to be applied, then just give a reference to any empty hash.

METHODS

prerequisites( dist => $SOME_PATH )

Returns the requirements of the distribution as a hash of PACKAGE_NAME => VERSION pairs. The dist argument can be the path to either a distribution archive file (e.g. Foo-Bar-1.2.tar.gz) or an unpacked distribution directory (e.g. Foo-Bar-1.2). The requirements will be filtered according to the values specified by the filter attribute.

BEWARE

Dist::Requires will attempt to configure the distribution using whatever build mechanism it provides (e.g. Module::Build or ExtUtils::MakeMaker or Module::Install) and then extract the requirements from the resulting metadata files. That means you could be executing unsafe code. However, this is no different from what cpanm and cpan do when you install a distribution.

SEE ALSO

Neil Bowers has written an excellent comparison of various modules for finding dependencies here.

CPAN::Dependency

CPAN::FindDependencies

Devel::Dependencies

Module::Depends

Module::Depends::Tree

Perl::PrereqScanner

SUPPORT

Perldoc

You can find documentation for this module with the perldoc command.

perldoc Dist::Requires

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.

  • Search CPAN

The default CPAN search engine, useful to view POD in HTML format.

http://search.cpan.org/dist/Dist-Requires

  • CPAN Ratings

The CPAN Ratings is a website that allows community ratings and reviews of Perl modules.

http://cpanratings.perl.org/d/Dist-Requires

  • 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-Requires

  • 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-Requires

  • 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::Requires

Bugs / Feature Requests

https://github.com/thaljef/Dist-Requires/issues

Source Code

https://github.com/thaljef/Dist-Requires

git clone git://github.com/thaljef/Dist-Requires.git

AUTHOR

Jeffrey Ryan Thalhammer [email protected]

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Imaginative Software Systems.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages