Sha256: 2547a73e6e1aba26c6a866fb4fe41bdfbd64611c3d0f649dc4cad0a424442784

Contents?: true

Size: 441 Bytes

Versions: 15

Compression:

Stored size: 441 Bytes

Contents

require 'shipitron'

module Shipitron
  class DockerImage < Hashie::Dash
    property :name
    property :tag

    def name_with_tag(tag_override = nil)
      tag_str = [tag_override, tag, ''].find {|str| !str.nil? }
      tag_str = tag_str.to_s

      if !tag_str.empty? && !tag_str.start_with?(':')
        tag_str = tag_str.dup.prepend(':')
      end

      "#{name}#{tag_str}"
    end

    def to_s
      name_with_tag
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
shipitron-1.2.1 lib/shipitron/docker_image.rb
shipitron-1.2.0 lib/shipitron/docker_image.rb
shipitron-1.1.0 lib/shipitron/docker_image.rb
shipitron-1.0.1 lib/shipitron/docker_image.rb
shipitron-1.0.0 lib/shipitron/docker_image.rb
shipitron-0.4.1 lib/shipitron/docker_image.rb
shipitron-0.4.0 lib/shipitron/docker_image.rb
shipitron-0.3.5 lib/shipitron/docker_image.rb
shipitron-0.3.4 lib/shipitron/docker_image.rb
shipitron-0.3.3 lib/shipitron/docker_image.rb
shipitron-0.3.1 lib/shipitron/docker_image.rb
shipitron-0.3.0 lib/shipitron/docker_image.rb
shipitron-0.2.2 lib/shipitron/docker_image.rb
shipitron-0.2.1 lib/shipitron/docker_image.rb
shipitron-0.2.0 lib/shipitron/docker_image.rb