Class: Engineyard::Local::Command::Base

Inherits:
Vagrant::Command::Base show all
Defined in:
lib/engineyard-local/command/base.rb

Direct Known Subclasses

Exec, Help, List, Rails, Start, Status, Stop, Terminate, Up, Update, VagrantAction

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Vagrant::Command::Base

#cookbook_status

Methods included from Helpers

#insert_linebreaks, #merge_run_options, #run

Constructor Details

#initialize(env, options) ⇒ Base

Returns a new instance of Base.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/engineyard-local/command/base.rb', line 68

def initialize(env, options)
  @env, @options = env, options
  @cookbook_status_already_checked ||= :not_checked

  unless Command::COMMANDS_WITH_NO_COOKBOOK_CHECK.include? self.class
    begin
      with_target_vms() do |vm|
        if vm.created? && vm.state == :running
          @env.ui.info(cookbook_status, :prefix => false) unless Engineyard::Local.cookbook_version_verified?
          Engineyard::Local.cookbook_version_verified
        else
          cookbook_status(:partial, false)
        end
      end
    rescue Vagrant::Errors::NoEnvironmentError
      # Ignore this error. It will happen any time an ey-local/vagrant command is invoked
      # in a directory that is not yet setup with a Vagrant environment.
    end
  end
  
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



66
67
68
# File 'lib/engineyard-local/command/base.rb', line 66

def env
  @env
end

#optionsObject (readonly)

Returns the value of attribute options.



66
67
68
# File 'lib/engineyard-local/command/base.rb', line 66

def options
  @options
end