Sha256: bb19545c6768cebcf5ec2170c7b4ec7a2ad36b4ee0582c64b0e2ff0fa68670db
Contents?: true
Size: 888 Bytes
Versions: 20
Compression:
Stored size: 888 Bytes
Contents
require "set" module Danger # "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_as_ci?(_env) abort "You need to include a function for #{self} for validates_as_ci?" end def self.validates_as_pr?(_env) abort "You need to include a function for #{self} for validates_as_pr?" end def initialize(_env) raise "Subclass and overwrite initialize" end end end
Version data entries
20 entries across 20 versions & 1 rubygems