The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Version::Dotted::Odd - Odd/even versioning scheme

VERSION

Version v0.0.1, released on 2017-01-04 21:35 UTC.

WHAT?

Version::Dotted and its subclasses are authoring time extensions to core version class: they complement version with bump operation and implement alternative trial version criteria.

This is Version::Dotted::Odd module documentation. However, read Version::Dotted module documentation first, since it contains many relevant details.

General topics like getting source, building, installing, bug reporting and some others are covered in the README.

SYNOPSIS

    use Version::Dotted::Odd;       # import nothing
    use Version::Dotted::Odd 'qv';  # import qv

    # Construct:
    $v = Version::Dotted::Odd->new( v1.0 );     # v1.0.0 (at least 3 parts)
    $v = qv( v1.0.2.5 );    # v1.0.2.5

    # Release status:
    $bool = $v->is_trial;   # true if the second part is odd.

    # See Version::Dotted for other methods.

DESCRIPTION

This is subclass of Version::Dotted. Two features distinct it from the parent:

  • Version object always has at least 3 parts.

        $v = qv( v1 );          # v1.0.0
        $v->part( 0 ) == 1;     # Parts 0, 1, 2 are always defined.
        $v->part( 1 ) == 0;     # Zero if not specified explicitly.
        $v->part( 2 ) == 0;     # ditto
        $v->part( 3 ) == undef; # But may be defined.
  • The second part defines the release status: odd number denotes a trial release.

        $v = qv( v1.0 );        # $v == v1.0.0
        $v->is_trial;           # false
        $v->bump( 1 );          # $v == v1.1.0
        $v->is_trial;           # true

    Such versioning scheme was used by Linux kernel (between 1.0 and 2.6) and still used by Perl.

CLASS ATTRIBUTES

min_len

Minimal number of parts, read-only.

    $int = Version::Dotted::Odd->min_len;   # == 3

Version::Dotted::Odd objects always have at least 3 parts.

OBJECT METHODS

is_trial

Returns true in case of trial version, and false otherwise.

    $bool = $v->is_trial;

A version is considered trial if the second part is an odd number:

    qv( v1.1.3 )->is_trial;     # true
    qv( v1.2.0 )->is_trial;     # false

SEE ALSO

Version::Dotted
Odd-numbered versions for development releases

AUTHOR

Van de Bugger <van.de.bugger@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2017 Van de Bugger

License GPLv3+: The GNU General Public License version 3 or later <http://www.gnu.org/licenses/gpl-3.0.txt>.

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.