Exception: MRubyPortable::CommandError
- Defined in:
- lib/mruby_portable/error.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
-
#initialize(command, stdout, stderr) ⇒ CommandError
constructor
A new instance of CommandError.
Constructor Details
#initialize(command, stdout, stderr) ⇒ CommandError
Returns a new instance of CommandError.
9 10 11 12 13 14 15 |
# File 'lib/mruby_portable/error.rb', line 9 def initialize(command, stdout, stderr) @command = command @stdout = stdout @stderr = stderr detail = stderr.to_s.empty? ? stdout.to_s : stderr.to_s super("command failed: #{command.join(" ")}#{detail.empty? ? "" : "\n#{detail}"}") end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
7 8 9 |
# File 'lib/mruby_portable/error.rb', line 7 def command @command end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
7 8 9 |
# File 'lib/mruby_portable/error.rb', line 7 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
7 8 9 |
# File 'lib/mruby_portable/error.rb', line 7 def stdout @stdout end |