=head1 METHODS
-=head2 C<< new category => $category, name => $name [, version => $version, range => $range, ebuild => $ebuild ] >>
+=head2 C<new>
+
+ # 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<CPANPLUS::Dist::Gentoo::Atom> object from the supplied C<$category>, C<$name>, C<$version>, C<$range> and C<$ebuild>.
}, $class;
}
-=head2 C<new_from_ebuild $ebuild>
+=head2 C<new_from_ebuild>
+
+ my $cdga = CPANPLUS::Dist::Gentoo::Atom->new_from_ebuild($ebuild);
Creates a new L<CPANPLUS::Dist::Gentoo::Atom> object by inferring the category, name and version from the given C<$ebuild>
'>' => 2,
);
-=head2 C<and @atoms>
+=head2 C<and>
+
+ 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.
}
}
-=head2 C<fold @atoms>
+=head2 C<fold>
+
+ 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.
=head1 FUNCTIONS
-=head2 C<name_c2g $name>
+=head2 C<name_c2g>
+
+ my $gentoo_pkg = name_c2g($cpan_dist);
Maps a CPAN distribution name to the corresponding Gentoo package name.
return $name_mismatch{$name} || $name;
}
-=head2 C<license_c2g @licenses>
+=head2 C<license_c2g>
+
+ my @gentoo_licenses = license_c2g(@meta_licenses);
Maps F<META.yml> C<license> tag values to the corresponding list of Gentoo license identifiers.
Duplicates are stripped off.
@_;
}
-=head2 C<version_c2g $name, $version>
+=head2 C<version_c2g>
+
+ my $gentoo_version = version_c2g($cpan_dist, $cpan_version);
Converts the C<$version> of a CPAN distribution C<$name> to a Gentoo version number.
return $handler->($v);
}
-=head2 C<perl_version_c2g $version>
+=head2 C<perl_version_c2g>
+
+ my $gentoo_version = perl_version_c2g($perl_version);
Converts a perl version number as you can find it in CPAN prerequisites to a Gentoo version number.
return join '.', map int, @parts;
}
-=head2 C<get_portage_timestamp $portage>
+=head2 C<get_portage_timestamp>
+
+ my $timestamp = get_portage_timestamp($portage);
Get the numerical timestamp associated with the portage tree located at C<$portage>.
Requires L<POSIX::strptime>, and returns C<undef> if it is not available.