Class: Danger::RequestSources::RequestSource
- Inherits:
-
Object
- Object
- Danger::RequestSources::RequestSource
- Defined in:
- lib/danger/request_source/request_source.rb
Constant Summary collapse
- DANGER_REPO_NAME =
"danger".freeze
Instance Attribute Summary collapse
-
#ci_source ⇒ Object
Returns the value of attribute ci_source.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#host ⇒ Object
Returns the value of attribute host.
-
#ignored_violations ⇒ Object
Returns the value of attribute ignored_violations.
-
#scm ⇒ Object
Returns the value of attribute scm.
Class Method Summary collapse
Instance Method Summary collapse
- #fetch_details ⇒ Object
- #file_url(_organisation: nil, _repository: nil, _branch: "master", _path: nil) ⇒ Object
-
#initialize(_ci_source, _environment) ⇒ RequestSource
constructor
A new instance of RequestSource.
- #organisation ⇒ Object
- #setup_danger_branches ⇒ Object
- #update_pull_request!(_warnings: [], _errors: [], _messages: [], _markdowns: []) ⇒ Object
- #validates_as_api_source? ⇒ Boolean
-
#validates_as_ci? ⇒ Boolean
What does this do?.
Constructor Details
#initialize(_ci_source, _environment) ⇒ RequestSource
Returns a new instance of RequestSource.
17 18 19 |
# File 'lib/danger/request_source/request_source.rb', line 17 def initialize(_ci_source, _environment) raise "Subclass and overwrite initialize" end |
Instance Attribute Details
#ci_source ⇒ Object
Returns the value of attribute ci_source.
6 7 8 |
# File 'lib/danger/request_source/request_source.rb', line 6 def ci_source @ci_source end |
#environment ⇒ Object
Returns the value of attribute environment.
6 7 8 |
# File 'lib/danger/request_source/request_source.rb', line 6 def environment @environment end |
#host ⇒ Object
Returns the value of attribute host.
6 7 8 |
# File 'lib/danger/request_source/request_source.rb', line 6 def host @host end |
#ignored_violations ⇒ Object
Returns the value of attribute ignored_violations.
6 7 8 |
# File 'lib/danger/request_source/request_source.rb', line 6 def ignored_violations @ignored_violations end |
#scm ⇒ Object
Returns the value of attribute scm.
6 7 8 |
# File 'lib/danger/request_source/request_source.rb', line 6 def scm @scm end |
Class Method Details
.available_request_sources ⇒ Object
13 14 15 |
# File 'lib/danger/request_source/request_source.rb', line 13 def self.available_request_sources @available_request_sources ||= Set.new end |
.inherited(child_class) ⇒ Object
8 9 10 11 |
# File 'lib/danger/request_source/request_source.rb', line 8 def self.inherited(child_class) available_request_sources.add child_class super end |
Instance Method Details
#fetch_details ⇒ Object
50 51 52 |
# File 'lib/danger/request_source/request_source.rb', line 50 def fetch_details raise "Subclass and overwrite initialize" end |
#file_url(_organisation: nil, _repository: nil, _branch: "master", _path: nil) ⇒ Object
58 59 60 |
# File 'lib/danger/request_source/request_source.rb', line 58 def file_url(_organisation: nil, _repository: nil, _branch: "master", _path: nil) raise "Subclass and overwrite file_url" end |
#organisation ⇒ Object
54 55 56 |
# File 'lib/danger/request_source/request_source.rb', line 54 def organisation raise "Subclass and overwrite organisation" end |
#setup_danger_branches ⇒ Object
46 47 48 |
# File 'lib/danger/request_source/request_source.rb', line 46 def setup_danger_branches raise "Subclass and overwrite setup_danger_branches" end |
#update_pull_request!(_warnings: [], _errors: [], _messages: [], _markdowns: []) ⇒ Object
42 43 44 |
# File 'lib/danger/request_source/request_source.rb', line 42 def update_pull_request!(_warnings: [], _errors: [], _messages: [], _markdowns: []) raise "Subclass and overwrite update_pull_request!" end |
#validates_as_api_source? ⇒ Boolean
26 27 28 |
# File 'lib/danger/request_source/request_source.rb', line 26 def validates_as_api_source? raise "Subclass and overwrite validates_as_api_source?" end |
#validates_as_ci? ⇒ Boolean
What does this do?
22 23 24 |
# File 'lib/danger/request_source/request_source.rb', line 22 def validates_as_ci? !!self.scm.origins.match(%r{#{Regexp.escape self.host}(:|/)(?<repo_slug>.+/.+?)(?:\.git)?$}) end |