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.



81
82
83
84
85
86
87
# File 'lib/pmdtester/cmd.rb', line 81

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.



73
74
75
# File 'lib/pmdtester/cmd.rb', line 73

def cmd
  @cmd
end

#errorObject (readonly)

Returns the value of attribute error.



75
76
77
# File 'lib/pmdtester/cmd.rb', line 75

def error
  @error
end

#messageObject (readonly)

Returns the value of attribute message.



77
78
79
# File 'lib/pmdtester/cmd.rb', line 77

def message
  @message
end

#statusObject (readonly)

Returns the value of attribute status.



76
77
78
# File 'lib/pmdtester/cmd.rb', line 76

def status
  @status
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



74
75
76
# File 'lib/pmdtester/cmd.rb', line 74

def stdout
  @stdout
end