class Rake::Funnel::ExecutionError

Attributes

command[R]
description[R]
exit_code[R]
output[R]

Public Class Methods

new(command = nil, exit_code = nil, output = nil, description = nil) click to toggle source
Calls superclass method
# File lib/rake/funnel/execution_error.rb, line 8
def initialize(command = nil, exit_code = nil, output = nil, description = nil)
  super(description)

  @description = description
  @command = command
  @exit_code = exit_code
  @output = output
end

Public Instance Methods

to_s() click to toggle source
Calls superclass method
# File lib/rake/funnel/execution_error.rb, line 17
def to_s
  msg = [] << inspect_description << inspect_command << inspect_exit_code << last_output
  msg = msg.flatten.compact
  msg = [super.to_s] if msg.empty?

  msg.join("\n")
end

Private Instance Methods

inspect_command() click to toggle source
# File lib/rake/funnel/execution_error.rb, line 31
def inspect_command
  ['Error executing:', command] if command
end
inspect_description() click to toggle source
# File lib/rake/funnel/execution_error.rb, line 27
def inspect_description
  [description] if description
end
inspect_exit_code() click to toggle source
# File lib/rake/funnel/execution_error.rb, line 35
def inspect_exit_code
  ["Exit code: #{exit_code}"] if exit_code
end
last_output() click to toggle source
# File lib/rake/funnel/execution_error.rb, line 39
def last_output
  ['Command output (last 10 lines):', output.encode('UTF-8').split("\n").last(10)] if output
end