123456789_123456789_123456789_123456789_123456789_

Module: Octokit::Client::Statuses

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/octokit/client/statuses.rb

Overview

Methods for the Commit Statuses API

Instance Method Summary

Instance Method Details

#combined_status(repo, ref, options = {}) ⇒ Sawyer::Resource Also known as: #status

Get the combined status for a ref

Parameters:

  • repo (Integer, String, Repository, Hash)

    a GitHub repository

  • ref (String)

    A Sha or Ref to fetch the status of

Returns:

  • (Sawyer::Resource)

    The combined status for the commit

See Also:

[ GitHub ]

  
# File 'lib/octokit/client/statuses.rb', line 26

def combined_status(repo, ref, options = {})
  get "#{Repository.path repo}/commits/#{ref}/status", options
end

#create_status(repo, sha, state, options = {}) ⇒ Sawyer::Resource

Create status for a commit

Parameters:

  • repo (Integer, String, Repository, Hash)

    A GitHub repository

  • sha (String)

    The SHA1 for the commit

  • state (String)

    The state: pending, success, failure, error

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :context (String)

    A context to differentiate this status from others

  • :target_url (String)

    A link to more details about this status

  • :description (String)

    A short human-readable description of this status

Returns:

  • (Sawyer::Resource)

    A status

See Also:

[ GitHub ]

  
# 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.

[ GitHub ]

  
# File 'lib/octokit/client/statuses.rb', line 18

alias list_statuses statuses

#status(repo, ref, options = {})

Alias for #combined_status.

[ GitHub ]

  
# File 'lib/octokit/client/statuses.rb', line 29

alias status combined_status

#statuses(repo, sha, options = {}) ⇒ Array<Sawyer::Resource> Also known as: #list_statuses

List all statuses for a given commit

Parameters:

  • repo (Integer, String, Repository, Hash)

    A GitHub repository

  • sha (String)

    The SHA1 for the commit

Returns:

  • (Array<Sawyer::Resource>)

    A list of statuses

See Also:

[ GitHub ]

  
# File 'lib/octokit/client/statuses.rb', line 15

def statuses(repo, sha, options = {})
  paginate "#{Repository.path repo}/statuses/#{sha}", options
end