Sha256: 1449a855796c4982521dd44b5a6e86d35d68fd01abb8f18ccfc90e032603915a

Contents?: true

Size: 396 Bytes

Versions: 1

Compression:

Stored size: 396 Bytes

Contents

module Dmatrix
  class ImageTag
    def initialize(values:)
      @values = values
    end

    def tag
      "#{repo}:#{combination_tag}"
    end

    private

    attr_reader :values

    INVALID_CHARS = /[^\w\-]/
    private_constant :INVALID_CHARS

    def repo
      File.split(Dir.pwd).last
    end

    def combination_tag
      values.join("-").gsub(INVALID_CHARS, "-")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dmatrix-0.1.0 lib/dmatrix/image_tag.rb