Class: Train::Extras::CommandWrapperBase

Inherits:
Object
  • Object
show all
Defined in:
lib/train/extras/command_wrapper.rb

Overview

Define the interface of all command wrappers.

Direct Known Subclasses

LinuxCommand, WindowsCommand

Instance Method Summary collapse

Instance Method Details

#run(_command) ⇒ String

Wrap a command and return the augmented command which can be executed.

Parameters:

  • command (Strin)

    that will be wrapper

Returns:

  • (String)

    result of wrapping the command

Raises:



21
22
23
# File 'lib/train/extras/command_wrapper.rb', line 21

def run(_command)
  raise Train::ClientError, "#{self.class} does not implement #run(command)"
end

#verifyAny

Verify that the command wrapper is initialized properly and working.

Returns:

  • (Any)

    verification result, nil if all went well, otherwise a message

Raises:



13
14
15
# File 'lib/train/extras/command_wrapper.rb', line 13

def verify
  raise Train::ClientError, "#{self.class} does not implement #verify()"
end