Exception: MRubyPortable::CommandError

Inherits:
Error
  • Object
show all
Defined in:
lib/mruby_portable/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commandObject (readonly)

Returns the value of attribute command.



7
8
9
# File 'lib/mruby_portable/error.rb', line 7

def command
  @command
end

#stderrObject (readonly)

Returns the value of attribute stderr.



7
8
9
# File 'lib/mruby_portable/error.rb', line 7

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



7
8
9
# File 'lib/mruby_portable/error.rb', line 7

def stdout
  @stdout
end