Sha256: ddda8244d00109804832d15ecc353daff177724990ea514a1d08002e75c35157

Contents?: true

Size: 748 Bytes

Versions: 1

Compression:

Stored size: 748 Bytes

Contents

module Danger
  module CISource
    # "abstract" CI class
    class CI
      attr_accessor :repo_slug, :pull_request_id, :repo_url, :supported_request_sources

      def self.inherited(child_class)
        available_ci_sources.add child_class
        super
      end

      def self.available_ci_sources
        @available_ci_sources ||= Set.new
      end

      def supported_request_sources
        raise "CISource subclass must specify the supported request sources"
      end

      def supports?(request_source)
        supported_request_sources.include? request_source
      end

      def self.validates?(_env)
        false
      end

      def initialize(_env)
        raise "Subclass and overwrite initialize"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
danger-0.8.2 lib/danger/ci_source/ci_source.rb