class Pronto::Formatter::GithubCombinedStatusFormatter

Public Class Methods

name() click to toggle source
# File lib/pronto/formatter/github_combined_status_formatter.rb, line 6
def self.name
  'github_combined_status'
end

Public Instance Methods

format(messages, repo, _) click to toggle source
# File lib/pronto/formatter/github_combined_status_formatter.rb, line 10
def format(messages, repo, _)
  client = Github.new(repo)
  head = repo.head_commit_sha

  create_status(client, head, messages.uniq || [])
end

Private Instance Methods

create_status(client, sha, messages) click to toggle source
# File lib/pronto/formatter/github_combined_status_formatter.rb, line 19
def create_status(client, sha, messages)
  builder = GithubStatusFormatter::StatusBuilder.new(nil, messages)
  status = Status.new(sha, builder.state,
                      'pronto', builder.description)

  client.create_commit_status(status)
end