OpenNMS::Release::Version(3pm)

NAME
OpenNMS::Release::Version - Perl extension for manipulating Versions

SYNOPSIS
  use OpenNMS::Release::Version;

DESCRIPTION
This is just a perl module for manipulating package versions.

CONSTRUCTOR
OpenNMS::Release::Version->new($version, $release, [$epoch])

Given a version, release, and epoch, create a version object.

METHODS

  * epoch
The epoch. If no epoch is set, returns undef.

  * epoch_int
The epoch. If no epoch is set, returns the default epoch, 0.

  * version
The version. This is generally the same as the version of the upstream software that was packaged.

  * release
The release. This is generally a number determined by the packager to track changes to the package, independent of version changes in the software that is packaged.

  * full_version
Returns the complete version string, in the form: "epoch:version-release"

  * display_version
Returns the complete version string, just like full_version, expect it excludes the epoch if there is no epoch in the version.

  * _compare_to($version)
Given a version, performs a cmp-style comparison, for use in sorting. Must be implemented in subclasses.

  * compare_to($version)
Given a version, performs a cmp-style comparison, for use in sorting. Catches by default, calling _compare_to for the actual implementation of comparison.

  * equals($version)
Given a version object, returns true if both versions are the same.

  * is_newer_than($version)
Given a version object, returns true if the current version is newer than the given version.

  * is_older_than($version)
Given a version object, returns true if the current version is older than the given version.

  * to_string
Returns a string representation of the version, suitable for printing.

AUTHOR
Benjamin Reed, <ranger@opennms.org> Matt Brozowski, <brozow@opennms.org>

COPYRIGHT AND LICENSE
Copyright (C) 2012 by The OpenNMS Group, Inc.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.