moose / MooseX-Storage

A serialization framework for Moose classes
http://metacpan.org/release/MooseX-Storage/
Other
6 stars 11 forks source link

Use version objects when handling version numbers #13

Open tjormola opened 8 years ago

tjormola commented 8 years ago

Besides using decimal numbers as package version number, it's also possible to use the dotted-decimal form (i.e. vX.Y.Z) in Perl. Currently, MooseX::Storage uses direct numeric comparison of the version strings which doesn't really work and it also spews "Argument ... isn't numeric in ..." warnings should the class define its version in dotted-decimal form. With this patch we're now creating version objects from the version strings, which accepts both decimal and dotted-decimal version formats as input and handles the comparison correctly.

karenetheridge commented 7 years ago

Can you clarify when this problem would occur? CPAN::Meta::Spec (https://metacpan.org/pod/CPAN::Meta::Spec#VERSION-NUMBERS) says that '1.2.3' is an illegal version format -- versions should be either numeric, or bare v-strings, either of which should compare properly using the numeric operator.