Sha256: 5bd8876e1acf164dafd7e86ddc782dd05140ead58505a36959bab7dc656a34d0

Contents?: true

Size: 852 Bytes

Versions: 10

Compression:

Stored size: 852 Bytes

Contents

module Vagrant
  module Command
    class StatusCommand < NamedBase
      register "status", "Shows the status of the current Vagrant environment."

      def execute
        state = nil
        results = target_vms.collect do |vm|
          if vm.created?
            if vm.vm.accessible?
              state = vm.vm.state.to_s
            else
              state = "inaccessible"
            end
          else
            state = "not_created"
          end

          "#{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
    end
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
vagrantup-0.8.9 lib/vagrant/command/status.rb
vagrantup-0.8.8 lib/vagrant/command/status.rb
vagrantup-0.8.7 lib/vagrant/command/status.rb
vagrantup-0.8.6 lib/vagrant/command/status.rb
vagrantup-0.8.10 lib/vagrant/command/status.rb
vagrant-0.8.10 lib/vagrant/command/status.rb
vagrant-0.8.8 lib/vagrant/command/status.rb
vagrant-0.8.7 lib/vagrant/command/status.rb
rvagrant-0.8.7.dev lib/vagrant/command/status.rb
vagrant-0.8.6 lib/vagrant/command/status.rb