diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/CPAN/Meta/Prereqs.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/CPAN/Meta/Prereqs.pm | 213 |
1 files changed, 107 insertions, 106 deletions
diff --git a/Master/tlpkg/tlperl/lib/CPAN/Meta/Prereqs.pm b/Master/tlpkg/tlperl/lib/CPAN/Meta/Prereqs.pm index b6e6c73c9e1..75035107f8c 100644 --- a/Master/tlpkg/tlperl/lib/CPAN/Meta/Prereqs.pm +++ b/Master/tlpkg/tlperl/lib/CPAN/Meta/Prereqs.pm @@ -2,47 +2,48 @@ use 5.006; use strict; use warnings; package CPAN::Meta::Prereqs; -our $VERSION = '2.140640'; # VERSION -# =head1 DESCRIPTION -# -# A CPAN::Meta::Prereqs object represents the prerequisites for a CPAN -# distribution or one of its optional features. Each set of prereqs is -# organized by phase and type, as described in L<CPAN::Meta::Prereqs>. -# -# =cut +our $VERSION = '2.150001'; + +#pod =head1 DESCRIPTION +#pod +#pod A CPAN::Meta::Prereqs object represents the prerequisites for a CPAN +#pod distribution or one of its optional features. Each set of prereqs is +#pod organized by phase and type, as described in L<CPAN::Meta::Prereqs>. +#pod +#pod =cut use Carp qw(confess); use Scalar::Util qw(blessed); use CPAN::Meta::Requirements 2.121; -# =method new -# -# my $prereq = CPAN::Meta::Prereqs->new( \%prereq_spec ); -# -# This method returns a new set of Prereqs. The input should look like the -# contents of the C<prereqs> field described in L<CPAN::Meta::Spec>, meaning -# something more or less like this: -# -# my $prereq = CPAN::Meta::Prereqs->new({ -# runtime => { -# requires => { -# 'Some::Module' => '1.234', -# ..., -# }, -# ..., -# }, -# ..., -# }); -# -# You can also construct an empty set of prereqs with: -# -# my $prereqs = CPAN::Meta::Prereqs->new; -# -# This empty set of prereqs is useful for accumulating new prereqs before finally -# dumping the whole set into a structure or string. -# -# =cut +#pod =method new +#pod +#pod my $prereq = CPAN::Meta::Prereqs->new( \%prereq_spec ); +#pod +#pod This method returns a new set of Prereqs. The input should look like the +#pod contents of the C<prereqs> field described in L<CPAN::Meta::Spec>, meaning +#pod something more or less like this: +#pod +#pod my $prereq = CPAN::Meta::Prereqs->new({ +#pod runtime => { +#pod requires => { +#pod 'Some::Module' => '1.234', +#pod ..., +#pod }, +#pod ..., +#pod }, +#pod ..., +#pod }); +#pod +#pod You can also construct an empty set of prereqs with: +#pod +#pod my $prereqs = CPAN::Meta::Prereqs->new; +#pod +#pod This empty set of prereqs is useful for accumulating new prereqs before finally +#pod dumping the whole set into a structure or string. +#pod +#pod =cut sub __legal_phases { qw(configure build test runtime develop) } sub __legal_types { qw(requires recommends suggests conflicts) } @@ -78,19 +79,19 @@ sub new { return bless \%guts => $class; } -# =method requirements_for -# -# my $requirements = $prereqs->requirements_for( $phase, $type ); -# -# This method returns a L<CPAN::Meta::Requirements> object for the given -# phase/type combination. If no prerequisites are registered for that -# combination, a new CPAN::Meta::Requirements object will be returned, and it may -# be added to as needed. -# -# If C<$phase> or C<$type> are undefined or otherwise invalid, an exception will -# be raised. -# -# =cut +#pod =method requirements_for +#pod +#pod my $requirements = $prereqs->requirements_for( $phase, $type ); +#pod +#pod This method returns a L<CPAN::Meta::Requirements> object for the given +#pod phase/type combination. If no prerequisites are registered for that +#pod combination, a new CPAN::Meta::Requirements object will be returned, and it may +#pod be added to as needed. +#pod +#pod If C<$phase> or C<$type> are undefined or otherwise invalid, an exception will +#pod be raised. +#pod +#pod =cut sub requirements_for { my ($self, $phase, $type) = @_; @@ -113,21 +114,21 @@ sub requirements_for { return $req; } -# =method with_merged_prereqs -# -# my $new_prereqs = $prereqs->with_merged_prereqs( $other_prereqs ); -# -# my $new_prereqs = $prereqs->with_merged_prereqs( \@other_prereqs ); -# -# This method returns a new CPAN::Meta::Prereqs objects in which all the -# other prerequisites given are merged into the current set. This is primarily -# provided for combining a distribution's core prereqs with the prereqs of one of -# its optional features. -# -# The new prereqs object has no ties to the originals, and altering it further -# will not alter them. -# -# =cut +#pod =method with_merged_prereqs +#pod +#pod my $new_prereqs = $prereqs->with_merged_prereqs( $other_prereqs ); +#pod +#pod my $new_prereqs = $prereqs->with_merged_prereqs( \@other_prereqs ); +#pod +#pod This method returns a new CPAN::Meta::Prereqs objects in which all the +#pod other prerequisites given are merged into the current set. This is primarily +#pod provided for combining a distribution's core prereqs with the prereqs of one of +#pod its optional features. +#pod +#pod The new prereqs object has no ties to the originals, and altering it further +#pod will not alter them. +#pod +#pod =cut sub with_merged_prereqs { my ($self, $other) = @_; @@ -158,18 +159,18 @@ sub with_merged_prereqs { return (ref $self)->new(\%new_arg); } -# =method merged_requirements -# -# my $new_reqs = $prereqs->merged_requirements( \@phases, \@types ); -# my $new_reqs = $prereqs->merged_requirements( \@phases ); -# my $new_reqs = $preerqs->merged_requirements(); -# -# This method joins together all requirements across a number of phases -# and types into a new L<CPAN::Meta::Requirements> object. If arguments -# are omitted, it defaults to "runtime", "build" and "test" for phases -# and "requires" and "recommends" for types. -# -# =cut +#pod =method merged_requirements +#pod +#pod my $new_reqs = $prereqs->merged_requirements( \@phases, \@types ); +#pod my $new_reqs = $prereqs->merged_requirements( \@phases ); +#pod my $new_reqs = $preerqs->merged_requirements(); +#pod +#pod This method joins together all requirements across a number of phases +#pod and types into a new L<CPAN::Meta::Requirements> object. If arguments +#pod are omitted, it defaults to "runtime", "build" and "test" for phases +#pod and "requires" and "recommends" for types. +#pod +#pod =cut sub merged_requirements { my ($self, $phases, $types) = @_; @@ -201,13 +202,13 @@ sub merged_requirements { } -# =method as_string_hash -# -# This method returns a hashref containing structures suitable for dumping into a -# distmeta data structure. It is made up of hashes and strings, only; there will -# be no Prereqs, CPAN::Meta::Requirements, or C<version> objects inside it. -# -# =cut +#pod =method as_string_hash +#pod +#pod This method returns a hashref containing structures suitable for dumping into a +#pod distmeta data structure. It is made up of hashes and strings, only; there will +#pod be no Prereqs, CPAN::Meta::Requirements, or C<version> objects inside it. +#pod +#pod =cut sub as_string_hash { my ($self) = @_; @@ -226,22 +227,22 @@ sub as_string_hash { return \%hash; } -# =method is_finalized -# -# This method returns true if the set of prereqs has been marked "finalized," and -# cannot be altered. -# -# =cut +#pod =method is_finalized +#pod +#pod This method returns true if the set of prereqs has been marked "finalized," and +#pod cannot be altered. +#pod +#pod =cut sub is_finalized { $_[0]{finalized} } -# =method finalize -# -# Calling C<finalize> on a Prereqs object will close it for further modification. -# Attempting to make any changes that would actually alter the prereqs will -# result in an exception being thrown. -# -# =cut +#pod =method finalize +#pod +#pod Calling C<finalize> on a Prereqs object will close it for further modification. +#pod Attempting to make any changes that would actually alter the prereqs will +#pod result in an exception being thrown. +#pod +#pod =cut sub finalize { my ($self) = @_; @@ -253,16 +254,16 @@ sub finalize { } } -# =method clone -# -# my $cloned_prereqs = $prereqs->clone; -# -# This method returns a Prereqs object that is identical to the original object, -# but can be altered without affecting the original object. Finalization does -# not survive cloning, meaning that you may clone a finalized set of prereqs and -# then modify the clone. -# -# =cut +#pod =method clone +#pod +#pod my $cloned_prereqs = $prereqs->clone; +#pod +#pod This method returns a Prereqs object that is identical to the original object, +#pod but can be altered without affecting the original object. Finalization does +#pod not survive cloning, meaning that you may clone a finalized set of prereqs and +#pod then modify the clone. +#pod +#pod =cut sub clone { my ($self) = @_; @@ -286,7 +287,7 @@ CPAN::Meta::Prereqs - a set of distribution prerequisites by phase and type =head1 VERSION -version 2.140640 +version 2.150001 =head1 DESCRIPTION |