=head1 VERSION
-Version 0.11
+Version 0.12
=cut
-our $VERSION = '0.11';
+our $VERSION = '0.12';
=head1 DESCRIPTION
'""' => \&_stringify,
);
-my $int_rx = qr/[0-9]+/;
-my $positive_int_rx = qr/0*[1-9][0-9]*/;
-my $letter_rx = qr/[a-zA-Z]/;
-my $dotted_num_rx = qr/$int_rx(?:\.$int_rx)*/o;
+my $int_rx = qr/[0-9]+/;
+my $letter_rx = qr/[a-zA-Z]/;
+my $dotted_num_rx = qr/$int_rx(?:\.$int_rx)*/o;
my @suffixes = qw<alpha beta pre rc normal p>;
my $suffix_rx = join '|', grep !/^normal$/, @suffixes;
our $version_rx = qr{
$dotted_num_rx $letter_rx?
- (?:_$suffix_rx$positive_int_rx?)*
- (?:-r$positive_int_rx)?
+ (?:_$suffix_rx$int_rx?)*
+ (?:-r$int_rx)?
}xo;
my $capturing_version_rx = qr{
($dotted_num_rx) ($letter_rx)?
- ((?:_$suffix_rx$positive_int_rx?)*)
- (?:-r($positive_int_rx))?
+ ((?:_$suffix_rx$int_rx?)*)
+ (?:-r($int_rx))?
}xo;
=head1 METHODS
-=head2 C<new $vstring>
+=head2 C<new>
+
+ my $cdgv = CPANPLUS::Dist::Gentoo::Version->new($vstring);
Creates a new L<CPANPLUS::Dist::Gentoo::Version> object from the version string C<$vstring>.
string => $vstring,
version => [ split /\.+/, $1 ],
letter => $2,
- suffixes => [ map /_($suffix_rx)($positive_int_rx)?/go, $3 ],
+ suffixes => [ map /_($suffix_rx)($int_rx)?/go, $3 ],
revision => $4,
}, $class;
}
=head1 COPYRIGHT & LICENSE
-Copyright 2009,2010 Vincent Pit, all rights reserved.
+Copyright 2009,2010,2011,2012 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.