Sha256: c054d079ef333569d63ade2ce452c9ff10a5913cd807961f94ad343859ad60d4

Contents?: true

Size: 753 Bytes

Versions: 11

Compression:

Stored size: 753 Bytes

Contents

module Rake::Funnel
  class ExecutionError < StandardError
    attr_reader :command, :exit_code, :output, :description

    def initialize(command = nil, exit_code = nil, output = nil, description = nil)
      super(description)

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

    def to_s
      msg = []
      (msg << description << nil) if description
      (msg << 'Error executing:' << command << nil) if command
      (msg << "Exit code: #{exit_code}" << nil) if exit_code
      (msg << 'Command output (last 10 lines):' << output.split("\n").last(10) << nil) if output

      msg = [super.to_s] if msg.empty?

      msg.join("\n")
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rake-funnel-0.3.2.pre lib/rake/funnel/execution_error.rb
rake-funnel-0.3.1.pre lib/rake/funnel/execution_error.rb
rake-funnel-0.3.0.pre lib/rake/funnel/execution_error.rb
rake-funnel-0.2.0.pre lib/rake/funnel/execution_error.rb
rake-funnel-0.1.0.pre lib/rake/funnel/execution_error.rb
rake-funnel-0.0.6.pre lib/rake/funnel/execution_error.rb
rake-funnel-0.0.5.pre lib/rake/funnel/execution_error.rb
rake-funnel-0.0.4.pre lib/rake/funnel/execution_error.rb
rake-funnel-0.0.3.pre lib/rake/funnel/execution_error.rb
rake-funnel-0.0.2.pre lib/rake/funnel/execution_error.rb
rake-funnel-0.0.1.pre lib/rake/funnel/execution_error.rb