Sha256: c4deda4c28727abcf92b4509c0c6aaa8ed1bdf60538a5c4589eb3cbee1bd8c16

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

module Octokit
  class Client

    # Methods for the Commit Statuses API
    #
    # @see http://developer.github.com/v3/repos/statuses/
    module Statuses

      # List all statuses for a given commit
      #
      # @param repo [String, Repository, Hash] A GitHub repository
      # @param sha [String] The SHA1 for the commit
      # @return [Array<Sawyer::Resource>] A list of statuses
      # @see http://developer.github.com/v3/repos/status
      def statuses(repo, sha, options={})
        get "repos/#{Repository.new(repo)}/statuses/#{sha}", options
      end
      alias :list_statuses :statuses

      # Create status for a commit
      #
      # @param repo [String, Repository, Hash] A GitHub repository
      # @param sha [String] The SHA1 for the commit
      # @param state [String] The state: pending, success, failure, error
      # @return [Sawyer::Resource] A status
      # @see http://developer.github.com/v3/repos/status
      def create_status(repo, sha, state, options={})
        options.merge!(:state => state)
        post "repos/#{Repository.new(repo)}/statuses/#{sha}", options
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
octokit-2.0.0.pre lib/octokit/client/statuses.rb