-
-
01 Oct 2020 09:26:21 UTC
- Distribution: Versioning-Scheme
- Module version: 0.011
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (1014 / 0 / 2)
- Kwalitee
Bus factor: 1- 92.98% Coverage
- License: perl_5
- Perl: v5.10.1
- Activity
24 month- Tools
- Download (20.56KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- NAME
- VERSION
- SYNOPSIS
- DESCRIPTION
- METHODS
- HOMEPAGE
- SOURCE
- BUGS
- SEE ALSO
- AUTHOR
- COPYRIGHT AND LICENSE
NAME
Versioning::Scheme::Perl - Perl (version.pm) version numbering
VERSION
This document describes version 0.011 of Versioning::Scheme::Perl (from Perl distribution Versioning-Scheme), released on 2020-10-01.
SYNOPSIS
use Versioning::Scheme::Perl; # checking validity Versioning::Scheme::Perl->is_valid_version('1.02'); # 1 Versioning::Scheme::Perl->is_valid_version('1.0.0'); # 1 Versioning::Scheme::Perl->is_valid_version('v1.0.0.0'); # 1 Versioning::Scheme::Perl->is_valid_version('1.2beta'); # 0 # parsing $parsed = Versioning::Scheme::Perl->parse_version('1.2beta'); # => undef $parsed = Versioning::Scheme::Perl->parse_version('1.2'); # => {parts=>[1, 2]} # normalizing Versioning::Scheme::Perl->normalize_version('0.1.2'); # => 'v0.1.2' Versioning::Scheme::Perl->normalize_version('1.02'); # => 'v1.20.0' # comparing Versioning::Scheme::Perl->cmp_version('1.2.3', '1.2.3.0'); # 0 Versioning::Scheme::Perl->cmp_version('1.2.3', '1.2.4'); # -1 Versioning::Scheme::Perl->cmp_version('1.3.1', '1.2.4'); # 1 # bumping Versioning::Scheme::Perl->bump_version('1.2.3'); # => 'v1.2.4' Versioning::Scheme::Perl->bump_version('1.2.999'); # => 'v1.3.0' Versioning::Scheme::Perl->bump_version('1.2.3', {num=>2}); # => 'v1.2.5' Versioning::Scheme::Perl->bump_version('1.2.3', {num=>-1}); # => 'v1.2.2' Versioning::Scheme::Perl->bump_version('1.2.3', {part=>-2}); # => 'v1.3.0' Versioning::Scheme::Perl->bump_version('1.2.3', {part=>0}); # => 'v2.0.0' Versioning::Scheme::Perl->bump_version('1.2.3', {part=>-2, reset_smaller=>0}); # => 'v1.3.3' Versioning::Scheme::Perl->bump_version('1.2.3' , {part=>'dev'} ); # => '1.2.3_001 Versioning::Scheme::Perl->bump_version('1.2.3_001', {part=>'dev', num=>2}); # => '1.2.3_003
You can also mix this role into your class.
DESCRIPTION
This role is basically a glue between Role::Versioning::Scheme and version.pm.
METHODS
versioning_scheme
is_valid_version
Uses version.pm's
parse()
.parse_version
normalize_version
Equivalent to:
version->parse($v)->normal
parse_version
cmp_version
Equivalent to:
version->parse($v1) <=> version->parse($v2)
bump_version
Bumping major/minor/patchlevel part: Set
part
to -3, -2, -1 respectively (or 0, 1, 2). To do this,bump_version
Will first normalize the version using:version->parse($v)->normal
followed by bumping the part. Except for the first (most significant) part, if a number is bumped beyond 999 it will overflow to the next more significant part, for example: bumping v1.0.999 will result in v1.1.0.
Bumping dev part: Set
part
todev
. Currently no overflowing is done. To do this, first will check version number using:version->parse($v)
then will check for /_[0-9]+\z/ regex. Then will increment or decrement the dev part.
HOMEPAGE
Please visit the project's homepage at https://metacpan.org/release/Versioning-Scheme.
SOURCE
Source repository is at https://github.com/perlancar/perl-Versioning-Scheme.
BUGS
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Versioning-Scheme
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
SEE ALSO
Other
Versioning::Scheme::*
modules.AUTHOR
perlancar <perlancar@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2020, 2019, 2018 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Versioning::Scheme, copy and paste the appropriate command in to your terminal.
cpanm Versioning::Scheme
perl -MCPAN -e shell install Versioning::Scheme
For more information on module installation, please visit the detailed CPAN module installation guide.