Class: Wombat::ListRunner

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/wombat/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Common

#audio?, #banner, #bootstrap_aws, #build_nodes, #calculate_templates, #conf, #create_infranodes_json, #duration, #info, #infranodes, #is_mac?, #is_valid_json?, #linux, #lock, #logs, #parse_log, #update_lock, #update_template, #warn, #wombat, #workstations

Constructor Details

#initialize(opts) ⇒ ListRunner

Returns a new instance of ListRunner.



197
198
199
# File 'lib/wombat/cli.rb', line 197

def initialize(opts)
  @templates = opts.templates.nil? ? calculate_templates : opts.templates
end

Instance Attribute Details

#templatesObject (readonly)

Returns the value of attribute templates.



195
196
197
# File 'lib/wombat/cli.rb', line 195

def templates
  @templates
end

Instance Method Details

#startObject



201
202
203
204
205
206
207
208
209
210
# File 'lib/wombat/cli.rb', line 201

def start
  templates.each do |t|
    if !File.exists?("#{conf['packer_dir']}/#{t}.json")
      $stderr.puts "File #{conf['packer_dir']}/#{t}.json does not exist for template '#{t}'"
      exit(1)
    else
      puts t
    end
  end
end