Sha256: d87830b7712a0b252741d846e5e8db981d1dbe9835314fc173a601bf797070d8

Contents?: true

Size: 789 Bytes

Versions: 2

Compression:

Stored size: 789 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

2 entries across 2 versions & 1 rubygems

Version Path
frontkick-0.5.1 lib/frontkick/result.rb
frontkick-0.5.0 lib/frontkick/result.rb