Class: PullRequestBuilder::GithubStatusReporter
- Inherits:
-
Object
- Object
- PullRequestBuilder::GithubStatusReporter
- Includes:
- ActiveModel::Model
- Defined in:
- lib/pull_request_builder/github_status_reporter.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#osc ⇒ Object
Returns the value of attribute osc.
-
#package ⇒ Object
Returns the value of attribute package.
-
#repository ⇒ Object
Returns the value of attribute repository.
Instance Method Summary collapse
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
6 7 8 |
# File 'lib/pull_request_builder/github_status_reporter.rb', line 6 def client @client end |
#logger ⇒ Object
Returns the value of attribute logger.
6 7 8 |
# File 'lib/pull_request_builder/github_status_reporter.rb', line 6 def logger @logger end |
#osc ⇒ Object
Returns the value of attribute osc.
6 7 8 |
# File 'lib/pull_request_builder/github_status_reporter.rb', line 6 def osc @osc end |
#package ⇒ Object
Returns the value of attribute package.
6 7 8 |
# File 'lib/pull_request_builder/github_status_reporter.rb', line 6 def package @package end |
#repository ⇒ Object
Returns the value of attribute repository.
6 7 8 |
# File 'lib/pull_request_builder/github_status_reporter.rb', line 6 def repository @repository end |
Instance Method Details
#report ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/pull_request_builder/github_status_reporter.rb', line 8 def report if update? logger.info("Update status to state #{state}.") client.create_status(repository, package.commit_sha, state, ) else logger.info('State did not change, continue...') end rescue Octokit::Error => e logger.error("Status not updated: #{e}.") end |