Class: Danger::CISource::CI

Inherits:
Object
  • Object
show all
Defined in:
lib/danger/ci_source/ci_source.rb

Overview

“abstract” CI class

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_env) ⇒ CI

Returns a new instance of CI.



30
31
32
# File 'lib/danger/ci_source/ci_source.rb', line 30

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

Instance Attribute Details

#pull_request_idObject

Returns the value of attribute pull_request_id.



7
8
9
# File 'lib/danger/ci_source/ci_source.rb', line 7

def pull_request_id
  @pull_request_id
end

#repo_slugObject

Returns the value of attribute repo_slug.



7
8
9
# File 'lib/danger/ci_source/ci_source.rb', line 7

def repo_slug
  @repo_slug
end

#repo_urlObject

Returns the value of attribute repo_url.



7
8
9
# File 'lib/danger/ci_source/ci_source.rb', line 7

def repo_url
  @repo_url
end

#supported_request_sourcesObject

Returns the value of attribute supported_request_sources.



7
8
9
# File 'lib/danger/ci_source/ci_source.rb', line 7

def supported_request_sources
  @supported_request_sources
end

Class Method Details

.available_ci_sourcesObject



14
15
16
# File 'lib/danger/ci_source/ci_source.rb', line 14

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

.inherited(child_class) ⇒ Object



9
10
11
12
# File 'lib/danger/ci_source/ci_source.rb', line 9

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

.validates?(_env) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/danger/ci_source/ci_source.rb', line 26

def self.validates?(_env)
  false
end

Instance Method Details

#supports?(request_source) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/danger/ci_source/ci_source.rb', line 22

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