Parent

Methods

Class/Module Index [+]

Quicksearch

Github::Client::Gitignore

When you create a new GitHub repository via the API, you can specify a .gitignore template to apply to the repository upon creation.

Public Instance Methods

all(*args) click to toggle source
Alias for: list
find(*args) click to toggle source
Alias for: get
get(*args) click to toggle source

Get a single template

@see developer.github.com/v3/gitignore/#get-a-single-template

@example

github = Github.new
github.gitignore.get "template-name"

Use the raw media type to get the raw contents.

@examples

github = Github.new
github.gitignore.get "template-name", accept: 'applicatin/vnd.github.raw'

@api public

# File lib/github_api/client/gitignore.rb, line 41
def get(*args)
  arguments(args, required: [:name])
  params = arguments.params

  if (media = params.delete('accept'))
    params['accept'] = media
    params['raw'] = true
  end

  get_request("/gitignore/templates/#{arguments.name}", params)
end
Also aliased as: find
list(*args) click to toggle source

List all templates available to pass as an option when creating a repository.

@see developer.github.com/v3/gitignore/#listing-available-templates

@example

github = Github.new
github.gitignore.list
github.gitignore.list { |template| ... }

@api public

# File lib/github_api/client/gitignore.rb, line 17
def list(*args)
  arguments(args)

  response = get_request("/gitignore/templates", arguments.params)
  return response unless block_given?
  response.each { |el| yield el }
end
Also aliased as: all

[Validate]

Generated with the Darkfish Rdoc Generator 2.