Sha256: 97db9bb5ab167431d9b87c731b97ad9cc61127fc050dbc17f20b6ab5a95518dd

Contents?: true

Size: 1007 Bytes

Versions: 8

Compression:

Stored size: 1007 Bytes

Contents

module Octokit
  class Client
    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] 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, 3)
      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 [Hash] 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, 3)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
octokit-1.18.0 lib/octokit/client/statuses.rb
octokit-1.17.1 lib/octokit/client/statuses.rb
octokit-1.17.0 lib/octokit/client/statuses.rb
octokit-1.15.1 lib/octokit/client/statuses.rb
octokit-1.15.0 lib/octokit/client/statuses.rb
octokit-1.14.0 lib/octokit/client/statuses.rb
octokit-1.13.0 lib/octokit/client/statuses.rb
octokit-1.12.0 lib/octokit/client/statuses.rb