Class: Vagrant::Plugin::Remote::Command

Inherits:
V2::Command show all
Defined in:
lib/vagrant/plugin/remote/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from V2::Command

synopsis

Methods included from Util::SafePuts

#safe_puts

Constructor Details

#initialize(argv, env, **kwargs) ⇒ Command

Returns a new instance of Command.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/vagrant/plugin/remote/command.rb', line 12

def initialize(argv, env, **kwargs)
  @logger = Log4r::Logger.new("vagrant::remote::command")
  @logger.debug("initializing command with remote backend")
  @argv = argv
  @env  = env
  @client = kwargs.delete(:client)
  if @client.nil?
    raise ArgumentError,
      "Remote client is required for `#{self.class.name}`"
  end
end

Instance Attribute Details

#clientObject

Add an attribute accesor for the client when applied to the Command class



10
11
12
# File 'lib/vagrant/plugin/remote/command.rb', line 10

def client
  @client
end

Instance Method Details

#executeObject



24
25
26
# File 'lib/vagrant/plugin/remote/command.rb', line 24

def execute
  client.execute(@argv)
end