| 1 |
NAME |
| 2 |
Version::Next - increment module version numbers simply and correctly |
| 3 |
|
| 4 |
VERSION |
| 5 |
version 1.000 |
| 6 |
|
| 7 |
SYNOPSIS |
| 8 |
use Version::Next qw/next_version/; |
| 9 |
|
| 10 |
my $new_version = next_version( $old_version ); |
| 11 |
|
| 12 |
DESCRIPTION |
| 13 |
This module provides a simple, correct way to increment a Perl module |
| 14 |
version number. It does not attempt to guess what the original version |
| 15 |
number author intended, it simply increments in the smallest possible |
| 16 |
fashion. Decimals are incremented like an odometer. Dotted decimals are |
| 17 |
incremented piecewise and presented in a standardized way. |
| 18 |
|
| 19 |
If more complex version manipulation is necessary, you may wish to |
| 20 |
consider Perl::Version. |
| 21 |
|
| 22 |
USAGE |
| 23 |
This module uses Sub::Exporter for optional exporting. Nothing is |
| 24 |
exported by default. |
| 25 |
|
| 26 |
"next_version" |
| 27 |
my $new_version = next_version( $old_version ); |
| 28 |
|
| 29 |
Given a string, this function make the smallest logical increment and |
| 30 |
returns it. The input string must be a "lax" version numbers as defined |
| 31 |
by the version module. The string "undef" is treated as 0 and |
| 32 |
incremented to 1. Leading or trailing periods have a 0 (or "v0") |
| 33 |
prepended or appended as appropriate. For legacy reasons, given no |
| 34 |
argument or a literal "undef" (not the string "undef"), the function |
| 35 |
returns 0. |
| 36 |
|
| 37 |
Decimal versions are incremented like an odometer, preserving the |
| 38 |
original number of decimal places. If an underscore is present |
| 39 |
(indicating an "alpha" version), its relative position is preserved. |
| 40 |
Examples: |
| 41 |
|
| 42 |
0.001 -> 0.002 |
| 43 |
0.999 -> 1.000 |
| 44 |
0.1229 -> 0.1230 |
| 45 |
0.12_34 -> 0.12_35 |
| 46 |
0.12_99 -> 0.13_00 |
| 47 |
|
| 48 |
Dotted-decimal versions have the least significant element incremented |
| 49 |
by one. If the result exceeds 999, the element resets to 0 and the next |
| 50 |
most significant element is incremented, and so on. Any leading zero |
| 51 |
padding is removed. Examples: |
| 52 |
|
| 53 |
v1.2.3 -> v1.2.4 |
| 54 |
v1.2.999 -> v1.3.0 |
| 55 |
v1.999.999 -> v2.0.0 |
| 56 |
|
| 57 |
NOTE: Due to changes in the interpretation of dotted-decimal version |
| 58 |
numbers with alpha elements in version 0.9913 and later, the notion of |
| 59 |
the 'next' dotted-decimal alpha is ill-defined. Version::Next no longer |
| 60 |
supports dotted-decimals with alpha elements and a fatal exception will |
| 61 |
be thrown if one is provided to "next_version". |
| 62 |
|
| 63 |
SEE ALSO |
| 64 |
* version |
| 65 |
|
| 66 |
* Perl::Version |
| 67 |
|
| 68 |
SUPPORT |
| 69 |
Bugs / Feature Requests |
| 70 |
Please report any bugs or feature requests through the issue tracker at |
| 71 |
<https://github.com/dagolden/Version-Next/issues>. You will be notified |
| 72 |
automatically of any progress on your issue. |
| 73 |
|
| 74 |
Source Code |
| 75 |
This is open source software. The code repository is available for |
| 76 |
public review and contribution under the terms of the license. |
| 77 |
|
| 78 |
<https://github.com/dagolden/Version-Next> |
| 79 |
|
| 80 |
git clone https://github.com/dagolden/Version-Next.git |
| 81 |
|
| 82 |
AUTHOR |
| 83 |
David Golden <[email protected]> |
| 84 |
|
| 85 |
CONTRIBUTOR |
| 86 |
Grzegorz Rożniecki <[email protected]> |
| 87 |
|
| 88 |
COPYRIGHT AND LICENSE |
| 89 |
This software is Copyright (c) 2016 by David Golden. |
| 90 |
|
| 91 |
This is free software, licensed under: |
| 92 |
|
| 93 |
The Apache License, Version 2.0, January 2004 |
| 94 |
|