Module: KubernetesDeploy::OptionsHelper

Defined in:
lib/kubernetes-deploy/options_helper.rb

Defined Under Namespace

Classes: OptionsError

Constant Summary collapse

STDIN_TEMP_FILE =
"from_stdin.yml.erb"

Class Method Summary collapse

Class Method Details

.with_validated_template_dir(template_dir) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/kubernetes-deploy/options_helper.rb', line 9

def with_validated_template_dir(template_dir)
  if template_dir == '-'
    Dir.mktmpdir("kubernetes-deploy") do |dir|
      template_dir_from_stdin(temp_dir: dir)
      yield dir
    end
  elsif template_dir
    yield template_dir
  else
    yield default_template_dir(template_dir)
  end
end