Sha256: f9cd1e3d11ebaa53595f4744e0493933fc580baf5a448beed836a890657640e4

Contents?: true

Size: 1.56 KB

Versions: 74

Compression:

Stored size: 1.56 KB

Contents

module CC
  module Analyzer
    class Container
      class Result
        attr_reader \
          :container_name,
          :duration,
          :exit_status,
          :output_byte_count,
          :stderr,
          :stdout

        def initialize(
          container_name: "",
          duration: 0,
          exit_status: 0,
          maximum_output_exceeded: false,
          output_byte_count: 0,
          skipped: false,
          stderr: "",
          stdout: "",
          timed_out: false
        )
          @container_name = container_name
          @duration = duration
          @exit_status = exit_status
          @maximum_output_exceeded = maximum_output_exceeded
          @output_byte_count = output_byte_count
          @skipped = skipped
          @stderr = stderr
          @stdout = stdout
          @timed_out = timed_out
        end

        def self.skipped(ex)
          new(
            exit_status: 0,
            skipped: true,
            stderr: ex.message,
          )
        end

        def merge_from_exception(ex)
          self.exit_status = 99
          self.stderr = ex.message
          self
        end

        def timed_out?
          @timed_out
        end

        def maximum_output_exceeded?
          @maximum_output_exceeded
        end

        def errored?
          timed_out? ||
            maximum_output_exceeded? ||
            exit_status.nil? ||
            exit_status.nonzero?
        end

        def skipped?
          @skipped
        end

        private

        attr_writer :exit_status, :stderr
      end
    end
  end
end

Version data entries

74 entries across 74 versions & 2 rubygems

Version Path
codeclimate-fede-0.85.35 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.33 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.32 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.31 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.30 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.21 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.24 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.23 lib/cc/analyzer/container/result.rb
codeclimate-0.85.23 lib/cc/analyzer/container/result.rb
codeclimate-0.85.22 lib/cc/analyzer/container/result.rb
codeclimate-0.85.21 lib/cc/analyzer/container/result.rb
codeclimate-0.85.19 lib/cc/analyzer/container/result.rb
codeclimate-0.85.18 lib/cc/analyzer/container/result.rb
codeclimate-0.85.17 lib/cc/analyzer/container/result.rb
codeclimate-0.85.15 lib/cc/analyzer/container/result.rb
codeclimate-0.85.14 lib/cc/analyzer/container/result.rb
codeclimate-0.85.13 lib/cc/analyzer/container/result.rb
codeclimate-0.85.12 lib/cc/analyzer/container/result.rb
codeclimate-0.85.11 lib/cc/analyzer/container/result.rb
codeclimate-0.85.10 lib/cc/analyzer/container/result.rb