Module: Lando::Generator::CommandHelper

Included in:
Lando::Generator::Command::Create, Lando::Generator::Command::Ls, Lando::Generator::Command::Preview
Defined in:
lib/lando/generator/command_helper.rb

Instance Method Summary collapse

Instance Method Details

#assert_template_exists(template) ⇒ Object



8
9
10
11
# File 'lib/lando/generator/command_helper.rb', line 8

def assert_template_exists(template)
  path = File.join templates_path, template
  raise ArgumentError.new "Template '#{template}' does not exist" unless File.directory? path
end

#require_nonblank(name, value) ⇒ Object



13
14
15
16
17
# File 'lib/lando/generator/command_helper.rb', line 13

def require_nonblank(name, value)
  if value == nil || value.empty?
    raise ArgumentError.new "'#{name}' must not be nil or empty" 
  end
end

#templates_pathObject



4
5
6
# File 'lib/lando/generator/command_helper.rb', line 4

def templates_path
  File.expand_path '../../../../templates', __FILE__
end