Sha256: 5314925e180589424599526efe56f5db1829dc747f5efff0907d3bee088329ae

Contents?: true

Size: 743 Bytes

Versions: 16

Compression:

Stored size: 743 Bytes

Contents

# typed: true
module Kuby
  class Environment
    attr_reader :name, :definition
    attr_accessor :configured

    alias_method :configured?, :configured

    def initialize(name, definition, &block)
      @name = name
      @definition = definition
    end

    def docker(&block)
      @docker ||= if development?
        Docker::DevSpec.new(self)
      else
        Docker::Spec.new(self)
      end

      @docker.instance_eval(&block) if block
      @docker
    end

    def kubernetes(&block)
      @kubernetes ||= Kubernetes::Spec.new(self)
      @kubernetes.instance_eval(&block) if block
      @kubernetes
    end

    def app_name
      definition.app_name
    end

    def development?
      name == 'development'
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
kuby-core-0.11.16 lib/kuby/environment.rb
kuby-core-0.11.15 lib/kuby/environment.rb
kuby-core-0.11.14 lib/kuby/environment.rb
kuby-core-0.11.13 lib/kuby/environment.rb
kuby-core-0.11.12 lib/kuby/environment.rb
kuby-core-0.11.11 lib/kuby/environment.rb
kuby-core-0.11.10 lib/kuby/environment.rb
kuby-core-0.11.9 lib/kuby/environment.rb
kuby-core-0.11.8 lib/kuby/environment.rb
kuby-core-0.11.7 lib/kuby/environment.rb
kuby-core-0.11.6 lib/kuby/environment.rb
kuby-core-0.11.4 lib/kuby/environment.rb
kuby-core-0.11.3 lib/kuby/environment.rb
kuby-core-0.11.2 lib/kuby/environment.rb
kuby-core-0.11.1 lib/kuby/environment.rb
kuby-core-0.11.0 lib/kuby/environment.rb