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

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



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

def run(_command)
  fail 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



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

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