Sha256: 571b0152bd96c830761403973f3f168d41a16ba402ba8e1d8b0b896916b0a877

Contents?: true

Size: 784 Bytes

Versions: 9

Compression:

Stored size: 784 Bytes

Contents

module Frontkick
  class Result
    attr_accessor :stdout, :stderr, :exit_code, :duration
    alias :status :exit_code
    alias :status= :exit_code=
    alias :exitstatus :exit_code # for compatibility with Open3 Process::Status
    alias :exitstatus= :exit_code= # for compatibility with Open3 Process::Status

    def initialize(params)
      @stdout = params[:stdout] || ""
      @stderr = params[:stderr] || ""
      @exit_code = params[:exit_code] || 0
      @duration = params[:duration] || 0
    end

    def output
      @stdout
    end

    def errors
      @stderr
    end

    def successful?
      @exit_code == 0
    end
    alias :success? :successful? # for compatibility with Open3 Process::Status
  end
  CommandResult = Result # for lower version compatibility
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
frontkick-0.4.9 lib/frontkick/result.rb
frontkick-0.4.8 lib/frontkick/result.rb
frontkick-0.4.7 lib/frontkick/result.rb
frontkick-0.4.6 lib/frontkick/result.rb
frontkick-0.4.5 lib/frontkick/result.rb
frontkick-0.4.4 lib/frontkick/result.rb
frontkick-0.4.3 lib/frontkick/result.rb
frontkick-0.4.1 lib/frontkick/result.rb
frontkick-0.3.5 lib/frontkick/result.rb