X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git;a=blobdiff_plain;f=lib%2FCPANPLUS%2FDist%2FGentoo%2FAtom.pm;fp=lib%2FCPANPLUS%2FDist%2FGentoo%2FAtom.pm;h=eef7cff2efc7d04c848985d2c199dc1113e4246f;hp=7a3acbb44f26c60017b156b42aaaa44a3a4f2b2f;hb=19eae8789c3ed2068bfde084ba9a8c711526c589;hpb=e71c31d55d3d29cbe9d4d890d0b115aea08d1105 diff --git a/lib/CPANPLUS/Dist/Gentoo/Atom.pm b/lib/CPANPLUS/Dist/Gentoo/Atom.pm index 7a3acbb..eef7cff 100644 --- a/lib/CPANPLUS/Dist/Gentoo/Atom.pm +++ b/lib/CPANPLUS/Dist/Gentoo/Atom.pm @@ -39,7 +39,24 @@ my $version_rx = $CPANPLUS::Dist::Gentoo::Version::version_rx; =head1 METHODS -=head2 C<< new category => $category, name => $name [, version => $version, range => $range, ebuild => $ebuild ] >> +=head2 C + + # Infer everything from $atom : + my $cdga = CPANPLUS::Dist::Gentoo::Atom->new( + atom => $atom, + # Optional : + ebuild => $ebuild, + ); + + # Or specify the attributes manually : + my $cdga = CPANPLUS::Dist::Gentoo::Atom->new( + category => $category, + name => $name, + version => $version, + range => $range, + # Optional : + ebuild => $ebuild, + ); Creates a new L object from the supplied C<$category>, C<$name>, C<$version>, C<$range> and C<$ebuild>. @@ -93,7 +110,9 @@ sub new { }, $class; } -=head2 C +=head2 C + + my $cdga = CPANPLUS::Dist::Gentoo::Atom->new_from_ebuild($ebuild); Creates a new L object by inferring the category, name and version from the given C<$ebuild> @@ -228,7 +247,9 @@ my %order = ( '>' => 2, ); -=head2 C +=head2 C + + my $cdga = CPANPLUS::Dist::Gentoo::Atom->and(@atoms); Compute the ranged atom representing the logical AND between C<@atoms> with the same category and name. @@ -278,7 +299,9 @@ sub and { } } -=head2 C +=head2 C + + my @folded = CPANPLUS::Dist::Gentoo::Atom->fold(@atoms); Returns a list built from C<@atoms> but where there's only one atom for a given category and name.