Method: Github::Client::Repos::Contents#archive

Defined in:
lib/github_api/client/repos/contents.rb

#archive(*args) ⇒ Object

Note:

For private repositories, these links are temporary and expire quickly.

Get archive link

This method will return a 302 to a URL to download a tarball or zipball archive for a repository. Please make sure your HTTP framework is configured to follow redirects or you will need to use the Location header to make a second GET request.

Examples:

github = Github.new
github.repos.contents.archive 'user-name', 'repo-name',
  archive_format: "tarball",
  ref: "master"

Parameters:



232
233
234
235
236
237
238
239
# File 'lib/github_api/client/repos/contents.rb', line 232

def archive(*args)
  arguments(args, required: [:user, :repo])
  params         = arguments.params
  archive_format = params.delete('archive_format') || 'tarball'
  ref            = params.delete('ref') || 'master'

  get_request("/repos/#{arguments.user}/#{arguments.repo}/#{archive_format}/#{ref}", params)
end