Class: Nova::Remote::Fake::Commands Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/nova/remote/fake/commands.rb

Overview

This class is abstract.

Manages running commands.

Instance Method Summary collapse

Instance Method Details

#command_exists?(command) ⇒ Boolean

This method is abstract.
Note:

Does nothing. Always returns false since this is the fake remote.

Checks to see if the command exists.

Parameters:

  • command (String)

    the command to check the existance of.

Returns:

  • (Boolean)


37
38
39
# File 'lib/nova/remote/fake/commands.rb', line 37

def command_exists?(command)
  false
end

#line(command, arguments = "", options = {}) ⇒ Command::Runner

This method is abstract.
Note:

Does nothing. Since we’re a fake remote, we’ll overwrite the backend with a fake one.

Creates a CommandLine with its default runner.

Parameters:

  • command (String)

    the command to run.

  • arguments (String) (defaults to: "")

    the arguments to be passed to the command.

Returns:

  • (Command::Runner)

    the runner.

See Also:



22
23
24
25
26
27
# File 'lib/nova/remote/fake/commands.rb', line 22

def line(command, arguments = "", options = {})
  options.merge! :logger => Nova.logger
  c = Command::Runner.new(command, arguments, options)
  c.backend = Command::Runner::Backends::Fake.new
  c
end