Module: Octokit::Client::Gitignore

Included in:
Octokit::Client
Defined in:
lib/octokit/client/gitignore.rb

Overview

Methods for the Gitignore API

See Also:

Instance Method Summary (collapse)

Instance Method Details

- (Sawyer::Resource) gitignore_template(template_name, options = {})

Get a gitignore template.

Use the raw media type to get the raw contents.

Examples:

Get the Ruby gitignore template

@client.gitignore_template('Ruby')

Parameters:

  • template_name (String)

    Name of the template. Template names are case sensitive, make sure to use a valid name from the .gitignore_templates list.

Returns:

  • (Sawyer::Resource)

    Gitignore template

See Also:



38
39
40
# File 'lib/octokit/client/gitignore.rb', line 38

def gitignore_template(template_name, options = {})
  get "gitignore/templates/#{template_name}", options
end

- (Array<String>) gitignore_templates(options = {})

Listing available gitignore templates.

These templates can be passed option when creating a repository.

Examples:

Git all the gitignore templates

@client.gitignore_templates

Returns:

  • (Array<String>)

    List of templates.

See Also:



19
20
21
# File 'lib/octokit/client/gitignore.rb', line 19

def gitignore_templates(options = {})
  get "gitignore/templates", options
end