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.



90
91
92
93
94
95
96
# File 'lib/pmdtester/cmd.rb', line 90

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.



82
83
84
# File 'lib/pmdtester/cmd.rb', line 82

def cmd
  @cmd
end

#errorObject (readonly)

Returns the value of attribute error.



84
85
86
# File 'lib/pmdtester/cmd.rb', line 84

def error
  @error
end

#messageObject (readonly)

Returns the value of attribute message.



86
87
88
# File 'lib/pmdtester/cmd.rb', line 86

def message
  @message
end

#statusObject (readonly)

Returns the value of attribute status.



85
86
87
# File 'lib/pmdtester/cmd.rb', line 85

def status
  @status
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



83
84
85
# File 'lib/pmdtester/cmd.rb', line 83

def stdout
  @stdout
end