Sha256: 95cff16c2abd0af9c93645465998390c07e3630b13f61c56d1e68bb672f40f87

Contents?: true

Size: 428 Bytes

Versions: 6

Compression:

Stored size: 428 Bytes

Contents

require 'semver'

module PactBroker
  module Versions
    class ParseSemanticVersion
      SEMVER_FORMAT = "%M.%m.%p%s%d"

      def self.call string_version
        version = ::SemVer.parse(string_version, SEMVER_FORMAT)
        return SemVerWrapper.new(version) unless version.nil?
      end

      class SemVerWrapper < SimpleDelegator
        def to_s
          format(SEMVER_FORMAT)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pact_broker-2.0.0.beta.6 lib/pact_broker/versions/parse_semantic_version.rb
pact_broker-2.0.0.beta.5 lib/pact_broker/versions/parse_semantic_version.rb
pact_broker-2.0.0.beta.4 lib/pact_broker/versions/parse_semantic_version.rb
pact_broker-2.0.0.beta.3 lib/pact_broker/versions/parse_semantic_version.rb
pact_broker-2.0.0.beta.2 lib/pact_broker/versions/parse_semantic_version.rb
pact_broker-2.0.0.beta.1 lib/pact_broker/versions/parse_semantic_version.rb