Sha256: 7cc5a8a3f794566962a7e27976d36f8f56d4004f4e82723557348364f6260e5f

Contents?: true

Size: 639 Bytes

Versions: 2

Compression:

Stored size: 639 Bytes

Contents

module Buildbox
  class Result
    require 'securerandom'

    attr_reader :uuid, :command
    attr_accessor :output, :finished, :exit_status

    def initialize(command)
      @uuid     = SecureRandom.uuid
      @output   = ""
      @finished = false
      @command  = command
    end

    def finished?
      finished
    end

    def success?
      exit_status == 0
    end

    def as_json
      { :uuid        => @uuid,
        :command     => @command,
        :output      => clean_output,
        :exit_status => @exit_status }
    end

    private

    def clean_output
      Buildbox::UTF8.clean(@output).chomp
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
buildbox-0.0.4 lib/buildbox/result.rb
buildbox-0.0.3 lib/buildbox/result.rb