Tools

A library of utility services and concerns.

Module: SleepingKingStudios::Tools::Version

Parent Namespace
SleepingKingStudios::Tools
Extended Modules
SleepingKingStudios::Tools::Toolbox::SemanticVersion
Defined In
lib/sleeping_king_studios/tools/version.rb

Table Of Contents

Overview

SleepingKingStudios::Tools uses semantic versioning.

See Also

Back To Top

Constants

BUILD

= nil

Build metadata.

MAJOR

= 1

Major version.

MINOR

= 2

Minor version.

PATCH

= 0

Patch version.

PRERELEASE

= nil

Prerelease version.

Back To Top

Class Methods

.to_gem_version => String

Inherited From
SleepingKingStudios::Tools::Toolbox::SemanticVersion

Generates a RubyGems-compatible version string.

Concatenates the MAJOR, MINOR, and PATCH constant values with PRERELEASE and BUILD (if available) to generate a modified semantic version string compatible with Rubygems. The major, minor, patch, prerelease, and build values (if available) are separated by dots (.).

Examples

module Version
  extend SleepingKingStudios::Tools::SemanticVersion

  MAJOR = 3
  MINOR = 1
  PATCH = 4
  PRERELEASE = 'beta'
  BUILD = 1
end

VERSION = Version.to_gem_version
#=> '3.1.4.beta.1'

Returns

Raises

.to_version => String

Inherited From
SleepingKingStudios::Tools::Toolbox::SemanticVersion

Generates a standard Semver version string.

Concatenates the MAJOR, MINOR, and PATCH constant values with PRERELEASE and BUILD (if available) to generate a semantic version string. The major, minor, and patch values are separated by dots (.), then the prerelease (if available) preceded by a hyphen (-), and the build (if available) preceded by a plus (+).

Examples

module Version
  extend SleepingKingStudios::Tools::SemanticVersion

  MAJOR = 3
  MINOR = 1
  PATCH = 4
  PRERELEASE = 'beta'
  BUILD = 1
end

VERSION = Version.to_version
#=> '3.1.4-beta+1'

Returns

Raises

Back To Top


Back to Documentation | Reference | SleepingKingStudios | SleepingKingStudios::Tools