Exception: PmdTester::CmdException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/pmdtester/cmd.rb

Overview

The exception should be raised when the shell command failed.

Constant Summary collapse

COMMON_MSG =
'An error occurred while executing the shell command'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cmd, stdout, error, status) ⇒ CmdException

Returns a new instance of CmdException.



75
76
77
78
79
80
81
# File 'lib/pmdtester/cmd.rb', line 75

def initialize(cmd, stdout, error, status)
  @cmd = cmd
  @stdout = stdout
  @error = error
  @status = status
  @message = "#{COMMON_MSG} '#{cmd}' #{status}"
end

Instance Attribute Details

#cmdObject (readonly)

Returns the value of attribute cmd.



67
68
69
# File 'lib/pmdtester/cmd.rb', line 67

def cmd
  @cmd
end

#errorObject (readonly)

Returns the value of attribute error.



69
70
71
# File 'lib/pmdtester/cmd.rb', line 69

def error
  @error
end

#messageObject (readonly)

Returns the value of attribute message.



71
72
73
# File 'lib/pmdtester/cmd.rb', line 71

def message
  @message
end

#statusObject (readonly)

Returns the value of attribute status.



70
71
72
# File 'lib/pmdtester/cmd.rb', line 70

def status
  @status
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



68
69
70
# File 'lib/pmdtester/cmd.rb', line 68

def stdout
  @stdout
end