Module: Publishable::VERSION
- Defined in:
- lib/publishable/version.rb
Overview
Defines the current version for this gem. Versions are specified as a dot-delimited string:
major.minor.patch.prerelease+build
When incrementing any field, all lower-rank fields should be reset to zero or nil.
Constant Summary collapse
- MAJOR =
The major version number, only incremented for a major overhaul.
1
- MINOR =
The minor version number, incremented for significant releases of new features.
0
- PATCH =
The patch-level, incremented for minor bug fixes / patches.
4
- PRERELEASE =
Prerelease specification for e.g. “alpha”, “beta.1”, etc
nil
- BUILD =
The build number; can be used for e.g. git version of current build, etc.
nil
Class Method Summary collapse
-
.to_s ⇒ String
Return the version as a dot-delimited string.
Class Method Details
.to_s ⇒ String
Return the version as a dot-delimited string.
31 32 33 34 35 36 37 |
# File 'lib/publishable/version.rb', line 31 def self.to_s @version_string ||= begin v = "#{MAJOR}.#{MINOR}.#{PATCH}" v = PRERELEASE ? "#{v}.#{PRERELEASE}" : v BUILD ? "#{v}+#{BUILD}" : v end end |