Sha256: 3ec017d0eaeff2c97361745f43a1150896404b18f88d7ad55705762d90e18fa4

Contents?: true

Size: 1.08 KB

Versions: 16

Compression:

Stored size: 1.08 KB

Contents

module Octokit
  class Client
    module Downloads 

      # List available downloads for a repository
      #
      # @param repo [String, Repository, Hash] A Github Repository
      # @return [Array] A list of available downloads
      # @see http://developer.github.com/v3/repos/downloads/#list-downloads-for-a-repository
      # @example List all downloads for Github/Hubot
      #   Octokit.downloads("github/hubot")
      def downloads(repo, options={})
        get("repos/#{Repository.new(repo)}/downloads", options, 3)
      end

      # Get single download for a repository
      #
      # @param repo [String, Repository, Hash] A GitHub repository
      # @param id [Integer] ID of the download 
      # @return [Download] A single download from the repository
      # @see http://developer.github.com/v3/repos/downloads/#get-a-single-download
      # @example Get the "Robawt" download from Github/Hubot 
      #   Octokit.download("github/hubot")
      def download(repo, id, options={})
        get("repos/#{Repository.new(repo)}/downloads/#{id}", options, 3)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
octokit-1.6.1 lib/octokit/client/downloads.rb
octokit-1.6.0 lib/octokit/client/downloads.rb
octokit-1.5.0 lib/octokit/client/downloads.rb
octokit-1.4.0 lib/octokit/client/downloads.rb
octokit-1.3.0 lib/octokit/client/downloads.rb
octokit-1.2.1 lib/octokit/client/downloads.rb
octokit-1.2.0 lib/octokit/client/downloads.rb
octokit-1.1.1 lib/octokit/client/downloads.rb
octokit-1.1.0 lib/octokit/client/downloads.rb
octokit-1.0.7 lib/octokit/client/downloads.rb
octokit-1.0.6 lib/octokit/client/downloads.rb
octokit-1.0.5 lib/octokit/client/downloads.rb
octokit-1.0.4 lib/octokit/client/downloads.rb
octokit-1.0.3 lib/octokit/client/downloads.rb
octokit-1.0.2 lib/octokit/client/downloads.rb
octokit-1.0.1 lib/octokit/client/downloads.rb