Class: Engineyard::Local::Command::List

Inherits:
Base show all
Defined in:
lib/engineyard-local/command/list.rb

Instance Attribute Summary

Attributes inherited from Base

#env, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods inherited from Vagrant::Command::Base

#cookbook_status, #initialize

Methods included from Helpers

#insert_linebreaks, #merge_run_options, #run

Constructor Details

This class inherits a constructor from Engineyard::Local::Command::Base

Instance Method Details

#exec(options) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/engineyard-local/command/list.rb', line 5

def exec(options)
  Virtualbox.uuid_map.each do |name, uuid|
    project_root = Virtualbox.extra_data(uuid, Local.config[:managed_vm_key])

    if project_root
      # move the uuid and project root to the front of the output
      # for easier cutting since it's less likely to have spaces
      env.ui.info format(uuid, project_root, name), :prefix => false
    end
  end
end

#format(uuid, project_root, name) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/engineyard-local/command/list.rb', line 17

def format(uuid, project_root, name)
  result = "#{uuid} #{project_root}"

  if @options[:format] == "full"
    "#{result} #{name}"
  else
    result
  end
end