Class: Danger::CI
- Inherits:
-
Object
- Object
- Danger::CI
- Defined in:
- lib/danger/ci_source/ci_source.rb
Overview
“abstract” CI class
Direct Known Subclasses
AppVeyor, Appcenter, AzurePipelines, Bamboo, BitbucketPipelines, Bitrise, Buddybuild, Buildkite, CircleCI, Cirrus, CodeBuild, Codefresh, Codemagic, Codeship, Concourse, DotCi, Drone, GitHubActions, GitLabCI, Jenkins, LocalGitRepo, LocalOnlyGitRepo, Screwdriver, Semaphore, Surf, TeamCity, Travis, VSTS, XcodeCloud, XcodeServer
Instance Attribute Summary collapse
-
#pull_request_id ⇒ Object
Returns the value of attribute pull_request_id.
-
#repo_slug ⇒ Object
Returns the value of attribute repo_slug.
-
#repo_url ⇒ Object
Returns the value of attribute repo_url.
-
#supported_request_sources ⇒ Object
Returns the value of attribute supported_request_sources.
Class Method Summary collapse
- .available_ci_sources ⇒ Object
- .inherited(child_class) ⇒ Object
- .validates_as_ci?(_env) ⇒ Boolean
- .validates_as_pr?(_env) ⇒ Boolean
Instance Method Summary collapse
-
#initialize(_env) ⇒ CI
constructor
A new instance of CI.
- #supports?(request_source) ⇒ Boolean
Constructor Details
#initialize(_env) ⇒ CI
Returns a new instance of CI.
33 34 35 |
# File 'lib/danger/ci_source/ci_source.rb', line 33 def initialize(_env) raise "Subclass and overwrite initialize" end |
Instance Attribute Details
#pull_request_id ⇒ Object
Returns the value of attribute pull_request_id.
6 7 8 |
# File 'lib/danger/ci_source/ci_source.rb', line 6 def pull_request_id @pull_request_id end |
#repo_slug ⇒ Object
Returns the value of attribute repo_slug.
6 7 8 |
# File 'lib/danger/ci_source/ci_source.rb', line 6 def repo_slug @repo_slug end |
#repo_url ⇒ Object
Returns the value of attribute repo_url.
6 7 8 |
# File 'lib/danger/ci_source/ci_source.rb', line 6 def repo_url @repo_url end |
#supported_request_sources ⇒ Object
Returns the value of attribute supported_request_sources.
6 7 8 |
# File 'lib/danger/ci_source/ci_source.rb', line 6 def supported_request_sources @supported_request_sources end |
Class Method Details
.available_ci_sources ⇒ Object
13 14 15 |
# File 'lib/danger/ci_source/ci_source.rb', line 13 def self.available_ci_sources @available_ci_sources ||= Set.new end |
.inherited(child_class) ⇒ Object
8 9 10 11 |
# File 'lib/danger/ci_source/ci_source.rb', line 8 def self.inherited(child_class) available_ci_sources.add child_class super end |
.validates_as_ci?(_env) ⇒ Boolean
25 26 27 |
# File 'lib/danger/ci_source/ci_source.rb', line 25 def self.validates_as_ci?(_env) abort "You need to include a function for #{self} for validates_as_ci?" end |
.validates_as_pr?(_env) ⇒ Boolean
29 30 31 |
# File 'lib/danger/ci_source/ci_source.rb', line 29 def self.validates_as_pr?(_env) abort "You need to include a function for #{self} for validates_as_pr?" end |
Instance Method Details
#supports?(request_source) ⇒ Boolean
21 22 23 |
# File 'lib/danger/ci_source/ci_source.rb', line 21 def supports?(request_source) supported_request_sources.include?(request_source) end |