When you create a new GitHub repository via the API, you can specify a .gitignore template to apply to the repository upon creation.
Get a single template
github = Github.new github.gitignore.get "template-name"
Use the raw media type to get the raw contents.
github = Github.new github.gitignore.get "template-name", accept: 'applicatin/vnd.github.raw'
# File lib/github_api/gitignore.rb, line 36 def get(*args) params = arguments(args, :required => [:name]).params if (media = params.delete('accept')) params['accept'] = media params['raw'] = true end get_request("/gitignore/templates/#{name}", params) end
List all templates available to pass as an option when creating a repository.
github = Github.new github.gitignore.list github.gitignore.list { |template| ... }
# File lib/github_api/gitignore.rb, line 15 def list(*args) arguments(args) response = get_request("/gitignore/templates", arguments.params) return response unless block_given? response.each { |el| yield el } end