Class: PullRequestBuilder::GithubStatusReporter

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
lib/pull_request_builder/github_status_reporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#clientObject

Returns the value of attribute client.



6
7
8
# File 'lib/pull_request_builder/github_status_reporter.rb', line 6

def client
  @client
end

#loggerObject

Returns the value of attribute logger.



6
7
8
# File 'lib/pull_request_builder/github_status_reporter.rb', line 6

def logger
  @logger
end

#oscObject

Returns the value of attribute osc.



6
7
8
# File 'lib/pull_request_builder/github_status_reporter.rb', line 6

def osc
  @osc
end

#packageObject

Returns the value of attribute package.



6
7
8
# File 'lib/pull_request_builder/github_status_reporter.rb', line 6

def package
  @package
end

#repositoryObject

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

#reportObject



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, options)
  else
    logger.info('State did not change, continue...')
  end
rescue Octokit::Error => e
  logger.error("Status not updated: #{e}.")
end