Sha256: c3e7b36fa6868c37d9f402c1272386531c6d78e15b679af18b6f5a86c7392243
Contents?: true
Size: 586 Bytes
Versions: 8
Compression:
Stored size: 586 Bytes
Contents
# frozen_string_literal: true module Shivers class Version def self.from_file(path) git_sha = ENV['GIT_SHA'] || 'LOCAL' metadata = git_sha.to_s base_version = if File.exist?(path) File.open(path) { |file| file.read.strip } else '0.0.0' end Version.new("#{base_version}+#{metadata}") end def initialize(version_string) @version = Semantic::Version.new(version_string) end def to_docker_tag to_s.gsub(/\+/, '_').downcase end def to_s @version.to_s end end end
Version data entries
8 entries across 8 versions & 1 rubygems