module Octokit::Client::Statuses

Methods for the Commit Statuses API

@see developer.github.com/v3/repos/statuses/

Public Instance Methods

combined_status(repo, ref, options = {}) click to toggle source

Get the combined status for a ref

@param repo [Integer, String, Repository, Hash] a GitHub repository @param ref [String] A Sha or Ref to fetch the status of @return [Sawyer::Resource] The combined status for the commit @see developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref

# File lib/octokit/client/statuses.rb, line 26
def combined_status(repo, ref, options = {})
  get "#{Repository.path repo}/commits/#{ref}/status", options
end
Also aliased as: status
create_status(repo, sha, state, options = {}) click to toggle source

Create status for a commit

@param repo [Integer, String, Repository, Hash] A GitHub repository @param sha [String] The SHA1 for the commit @param state [String] The state: pending, success, failure, error @option options [String] :context A context to differentiate this status from others @option options [String] :target_url A link to more details about this status @option options [String] :description A short human-readable description of this status @return [Sawyer::Resource] A status @see developer.github.com/v3/repos/statuses/#create-a-status

# File lib/octokit/client/statuses.rb, line 41
def create_status(repo, sha, state, options = {})
  options = options.merge(:state => state)
  post "#{Repository.path repo}/statuses/#{sha}", options
end
list_statuses(repo, sha, options = {})
Alias for: statuses
status(repo, ref, options = {})
Alias for: combined_status
statuses(repo, sha, options = {}) click to toggle source

List all statuses for a given commit

@param repo [Integer, String, Repository, Hash] A GitHub repository @param sha [String] The SHA1 for the commit @return [Array<Sawyer::Resource>] A list of statuses @see developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref

# File lib/octokit/client/statuses.rb, line 15
def statuses(repo, sha, options = {})
  paginate "#{Repository.path repo}/statuses/#{sha}", options
end
Also aliased as: list_statuses