Class: PactBroker::Versions::ParseSemanticVersion

Inherits:
Object
  • Object
show all
Defined in:
lib/pact_broker/versions/parse_semantic_version.rb

Defined Under Namespace

Classes: SemVerWrapper

Class Method Summary collapse

Class Method Details

.call(string_version) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/pact_broker/versions/parse_semantic_version.rb', line 8

def self.call string_version
  PactBroker.configuration.semver_formats.each do |semver_format|
    parsed_version = ::SemVer.parse(string_version, semver_format)
    return SemVerWrapper.new(parsed_version, semver_format) unless parsed_version.nil?
  end
  nil
end