Exception: Rant::CommandError
- Defined in:
- lib/rant/rantsys.rb
Overview
class MultiFileList
Instance Attribute Summary collapse
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(cmd, status = nil, msg = nil) ⇒ CommandError
constructor
A new instance of CommandError.
- #message ⇒ Object
Constructor Details
#initialize(cmd, status = nil, msg = nil) ⇒ CommandError
Returns a new instance of CommandError.
133 134 135 136 137 |
# File 'lib/rant/rantsys.rb', line 133 def initialize(cmd, status=nil, msg=nil) @msg = msg @cmd = cmd @status = status end |
Instance Attribute Details
#cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
131 132 133 |
# File 'lib/rant/rantsys.rb', line 131 def cmd @cmd end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
132 133 134 |
# File 'lib/rant/rantsys.rb', line 132 def status @status end |
Instance Method Details
#message ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/rant/rantsys.rb', line 138 def if !@msg && cmd if status "Command failed with status #{status.exitstatus}:\n" + "[#{cmd}]" else "Command failed:\n[#{cmd}]" end else @msg end end |