class Dopi::Command::Custom

Public Instance Methods

run() click to toggle source
# File lib/dopi/command/custom.rb, line 28
def run
  result = []
  cmd_stdout, cmd_stderr, cmd_exit_code = local_command(env, command_string)
  # Output Parser
  result << check_output(cmd_stdout)
  result << check_output(cmd_stderr)
  # Exit Code Parser
  result << check_exit_code(cmd_exit_code)
  result.all?
end
run_noop() click to toggle source
# File lib/dopi/command/custom.rb, line 39
def run_noop
  log(:info, "(NOOP) Executing '#{command_string}' for command #{name}")
  log(:info, "(NOOP) Environment: #{env.to_s}")
end
validate() click to toggle source
# File lib/dopi/command/custom.rb, line 16
def validate
  #validate_exec
  # remove after the refactoring is complete
  unless Dopi::Command::Custom > self.class && self.method(:exec).owner == self.class
    log_validation_method('exec_valid?', CommandParsingError)
  end
  validate_env
  validate_arguments
  validate_exit_code
  validate_output
end

Private Instance Methods

command_string() click to toggle source
# File lib/dopi/command/custom.rb, line 46
def command_string
  exec + ' ' + arguments
end