Sha256: bac663461a546b07f76dec5fd2cfb83a52603f41bf6367eec2e7390ee861a04d

Contents?: true

Size: 1001 Bytes

Versions: 4

Compression:

Stored size: 1001 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)
      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)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
octokit-1.22.0 lib/octokit/client/statuses.rb
octokit-1.21.0 lib/octokit/client/statuses.rb
octokit-1.20.0 lib/octokit/client/statuses.rb
octokit-1.19.0 lib/octokit/client/statuses.rb