Class: Vagrant::Command::StatusCommand

Inherits:
NamedBase
  • Object
show all
Defined in:
lib/vagrant/command/status.rb

Instance Attribute Summary

Attributes inherited from Base

#env

Instance Method Summary collapse

Methods inherited from Base

#initialize, register

Methods included from Helpers

#initialize_environment, #target_vms

Constructor Details

This class inherits a constructor from Vagrant::Command::Base

Instance Method Details

#routeObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/vagrant/command/status.rb', line 6

def route
  state = nil
  results = target_vms.collect do |vm|
    state = vm.created? ? vm.vm.state.to_s : "not_created"
    "#{vm.name.to_s.ljust(25)}#{state.gsub("_", " ")}"
  end

  state = target_vms.length == 1 ? state : "listing"

  env.ui.info(I18n.t("vagrant.commands.status.output",
              :states => results.join("\n"),
              :message => I18n.t("vagrant.commands.status.#{state}")),
              :prefix => false)
end