Sha256: 2fd28b1d61d82039e2ac8ef5c30b95555b091bca56f9350fbdf7c299be01a327

Contents?: true

Size: 854 Bytes

Versions: 12

Compression:

Stored size: 854 Bytes

Contents

class KuberKit::Core::ContextHelper::BaseHelper
  CONTRACT = RespondTo[:get_binding]

  attr_reader :shell, :artifact_store, :image_store, :env_file_reader

  def initialize(image_store:, artifact_store:, shell:, env_file_reader:)
    @image_store      = image_store
    @artifact_store   = artifact_store
    @shell            = shell
    @env_file_reader  = env_file_reader
  end

  def image_url(image_name)
    image = @image_store.get_image(image_name.to_sym)

    image.remote_registry_url
  end

  def artifact_path(name, file_name = nil)
    artifact = @artifact_store.get(name.to_sym)
    [artifact.cloned_path, file_name].compact.join("/")
  end

  def env_file(env_file_name)
    @env_file_reader.call(@shell, env_file_name)
  end

  def configuration_name
    KuberKit.current_configuration.name
  end

  def get_binding
    binding
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
kuber_kit-0.2.7 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.2.6 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.2.5 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.2.4 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.2.3 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.2.2 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.2.1 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.2.0 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.1.9 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.1.8 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.1.7 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.1.6 lib/kuber_kit/core/context_helper/base_helper.rb