Class: Bio::CommandResult

Inherits:
Object
  • Object
show all
Defined in:
lib/bio-commandeer/commandeer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commandObject

Returns the value of attribute command.



56
57
58
# File 'lib/bio-commandeer/commandeer.rb', line 56

def command
  @command
end

#statusObject

Returns the value of attribute status.



56
57
58
# File 'lib/bio-commandeer/commandeer.rb', line 56

def status
  @status
end

#stderrObject

Returns the value of attribute stderr.



56
57
58
# File 'lib/bio-commandeer/commandeer.rb', line 56

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout.



56
57
58
# File 'lib/bio-commandeer/commandeer.rb', line 56

def stdout
  @stdout
end

#timed_outObject

Returns the value of attribute timed_out.



56
57
58
# File 'lib/bio-commandeer/commandeer.rb', line 56

def timed_out
  @timed_out
end

Instance Method Details

#raise_if_failedObject



58
59
60
61
62
63
64
# File 'lib/bio-commandeer/commandeer.rb', line 58

def raise_if_failed
  if @timed_out
    raise Bio::CommandFailedException, "Command timed out. Command run was #{command}."
  elsif @status.exitstatus != 0
    raise Bio::CommandFailedException, "Command returned non-zero exit status (#{@status.exitstatus}), likely indicating failure. Command run was #{@command} and the STDERR was:\n#{@stderr}\nSTDOUT was: #{@stdout}"
  end
end