Sha256: 0eb8de58f305042c4f13b5555683bc0b472dae4b0c8ef62a9d2698ca218904ff

Contents?: true

Size: 813 Bytes

Versions: 66

Compression:

Stored size: 813 Bytes

Contents

module CC
  module Analyzer
    class RaisingContainerListener < ContainerListener
      def initialize(engine_name, failure_ex, timeout_ex)
        @engine_name = engine_name
        @failure_ex = failure_ex
        @timeout_ex = timeout_ex
      end

      def timed_out(data)
        message = "engine #{engine_name} ran for #{data.duration} seconds"
        message << " and was killed"

        raise timeout_ex, message
      end

      def finished(data)
        unless data.status.success?
          message = "engine #{engine_name} failed"
          message << " with status #{data.status.exitstatus}"
          message << " and stderr \n#{data.stderr}"

          raise failure_ex, message
        end
      end

      private

      attr_reader :engine_name, :failure_ex, :timeout_ex
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
codeclimate-0.16.3 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.16.2 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.16.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.16.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.15.2 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.15.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.15.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.14.7 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.14.6 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.14.5 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.14.4 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.14.3 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.14.2 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.14.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.14.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.13.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.11.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.10.1 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.10.0 lib/cc/analyzer/raising_container_listener.rb
codeclimate-0.9.7 lib/cc/analyzer/raising_container_listener.rb