Module: Octokit::Client::Statuses

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

Instance Method Summary collapse

Instance Method Details

#create_status(repo, sha, state, options = {}) ⇒ Hash

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:

  • (Hash)

    A status

See Also:



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

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

#github_statusHash

Returns the current system status

Returns:

  • (Hash)

    GitHub status

See Also:



32
33
34
# File 'lib/octokit/client/statuses.rb', line 32

def github_status
  get('status.json', {:endpoint => Octokit.status_api_endpoint})
end

#github_status_last_messageHash

Returns the last human communication, status, and timestamp.

Returns:

  • (Hash)

    GitHub status last message

See Also:



40
41
42
# File 'lib/octokit/client/statuses.rb', line 40

def github_status_last_message
  get('last-message.json', {:endpoint => Octokit.status_api_endpoint})
end

#github_status_messagesArray<Hash>

Returns the most recent human communications with status and timestamp.

Returns:

  • (Array<Hash>)

    GitHub status messages

See Also:



48
49
50
# File 'lib/octokit/client/statuses.rb', line 48

def github_status_messages
  get('messages.json', {:endpoint => Octokit.status_api_endpoint})
end

#statuses(repo, sha, options = {}) ⇒ Array 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)

    A list of statuses

See Also:



11
12
13
# File 'lib/octokit/client/statuses.rb', line 11

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