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-0.85.24 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.54 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.53 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.52 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.51 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.50 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.49 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.48 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.47 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.46 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.45 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.44 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.43 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.42 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.41 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.40 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.39 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.38 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.37 lib/cc/analyzer/container/result.rb
codeclimate-fede-0.85.36 lib/cc/analyzer/container/result.rb