Module: Octokit::Client::Statuses

Included in:
Octokit::Client
Defined in:
lib/octokit/client/statuses.rb

Overview

Methods for the Commit Statuses API

Instance Method Summary collapse

Instance Method Details

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

Create status for a commit

Parameters:

  • repo (String, Repository, Hash)

    A GitHub repository

  • sha (String)

    The SHA1 for the commit

  • state (String)

    The state: pending, success, failure, error

Returns:

  • (Sawyer::Resource)

    A status

See Also:



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

def create_status(repo, sha, state, options = {})
  options.merge!(:state => state)
  post "repos/#{Repository.new(repo)}/statuses/#{sha}", options
end

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

List all statuses for a given commit

Parameters:

  • repo (String, Repository, Hash)

    A GitHub repository

  • sha (String)

    The SHA1 for the commit

Returns:

  • (Array<Sawyer::Resource>)

    A list of statuses

See Also:



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

def statuses(repo, sha, options = {})
  get "repos/#{Repository.new(repo)}/statuses/#{sha}", options
end