Class: Bosh::Common::Version::StemcellVersion

Inherits:
SemiSemanticVersion show all
Defined in:
lib/common/version/stemcell_version.rb

Constant Summary

Constants inherited from SemiSemanticVersion

Bosh::Common::Version::SemiSemanticVersion::DEFAULT_POST_RELEASE_SEGMENT

Instance Attribute Summary

Attributes inherited from SemiSemanticVersion

#version

Class Method Summary collapse

Methods inherited from SemiSemanticVersion

#<=>, #default_post_release, #increment_post_release, #increment_release, #initialize, parse_and_compare, #to_s

Constructor Details

This class inherits a constructor from Bosh::Common::Version::SemiSemanticVersion

Class Method Details

.parse(version) ⇒ Object

Raises:

  • (ArgumentError)


7
8
9
10
11
12
13
14
15
# File 'lib/common/version/stemcell_version.rb', line 7

def self.parse(version)
  raise ArgumentError, 'Invalid Version: nil' if version.nil?
  version = version.to_s

  #replace underscores with periods to maintain reverse compatibility with stemcell versions
  version = version.gsub('_', '.')

  self.new(SemiSemantic::Version.parse(version))
end