X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git;a=blobdiff_plain;f=lib%2FCPANPLUS%2FDist%2FGentoo%2FVersion.pm;h=12f75d6e95dcb5235cecf7754a7911c92272116c;hp=1214582c08158b4909a18f307336e782000e405d;hb=93eb049958520c8b4980d76e5654e5cdd3774d2f;hpb=4e0c9cad73c65d6c469d35afebbef746ab15ce89 diff --git a/lib/CPANPLUS/Dist/Gentoo/Version.pm b/lib/CPANPLUS/Dist/Gentoo/Version.pm index 1214582..12f75d6 100644 --- a/lib/CPANPLUS/Dist/Gentoo/Version.pm +++ b/lib/CPANPLUS/Dist/Gentoo/Version.pm @@ -3,6 +3,24 @@ package CPANPLUS::Dist::Gentoo::Version; use strict; use warnings; +=head1 NAME + +CPANPLUS::Dist::Gentoo::Version - Gentoo version object. + +=head1 VERSION + +Version 0.08 + +=cut + +our $VERSION = '0.08'; + +=head1 DESCRIPTION + +This class models Gentoo versions. + +=cut + use Scalar::Util (); use overload ( @@ -10,13 +28,19 @@ use overload ( '""' => \&_stringify, ); -our $VERSION = '0.08'; - my $int_rx = qr/\d+/; my $dotted_num_rx = qr/$int_rx(?:\.$int_rx)*/; our $version_rx = qr/$dotted_num_rx(?:_p$dotted_num_rx)?(?:-r$int_rx)?/; +=head1 METHODS + +=head2 C + +Creates a new L object from the version string C<$vstring>. + +=cut + sub new { my $class = shift; $class = ref($class) || $class; @@ -45,6 +69,20 @@ BEGIN { eval "sub $_ { \$_[0]->{$_} }" for @parts; } +=head2 C + +Read-only accessor for the C part of the version object. + +=head2 C + +Read-only accessor for the C part of the version object. + +=head2 C + +Read-only accessor for the C part of the version object. + +=cut + sub _spaceship { my ($v1, $v2, $r) = @_; @@ -80,4 +118,36 @@ sub _stringify { $version; } -1; +=pod + +This class provides overloaded methods for numerical comparison and strigification. + +=head1 SEE ALSO + +L. + +=head1 AUTHOR + +Vincent Pit, C<< >>, L. + +You can contact me by mail or on C (vincent). + +=head1 BUGS + +Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. + +=head1 SUPPORT + +You can find documentation for this module with the perldoc command. + + perldoc CPANPLUS::Dist::Gentoo + +=head1 COPYRIGHT & LICENSE + +Copyright 2009 Vincent Pit, all rights reserved. + +This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. + +=cut + +1; # End of CPANPLUS::Dist::Gentoo::Version