module Gitlab::Client::Templates

Defines methods related to templates. @see docs.gitlab.com/ce/api/templates/dockerfiles.html @see docs.gitlab.com/ce/api/templates/gitignores.html @see docs.gitlab.com/ce/api/templates/gitlab_ci_ymls.html @see docs.gitlab.com/ce/api/templates/licenses.html

Public Instance Methods

dockerfile_template(key) click to toggle source

Get a single Dockerfile template.

@example

Gitlab.dockerfile_template('Binary')

@param [String] key The key of the Dockerfile template @return [Gitlab::ObjectifiedHash]

# File lib/gitlab/client/templates.rb, line 27
def dockerfile_template(key)
  get("/templates/dockerfiles/#{key}")
end
dockerfile_templates() click to toggle source

Get all Dockerfile templates.

@example

Gitlab.dockerfile_templates

@return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/templates.rb, line 16
def dockerfile_templates
  get('/templates/dockerfiles')
end
gitignore_template(key) click to toggle source

Get a single gitignore template.

@example

Gitlab.gitignore_template('Ruby')

@param [String] key The key of the gitignore template @return [Gitlab::ObjectifiedHash]

# File lib/gitlab/client/templates.rb, line 48
def gitignore_template(key)
  get("/templates/gitignores/#{key}")
end
gitignore_templates() click to toggle source

Get all gitignore templates.

@example

Gitlab.gitignore_templates

@return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/templates.rb, line 37
def gitignore_templates
  get('/templates/gitignores')
end
gitlab_ci_yml_template(key) click to toggle source

Get a single ‘gitlab_ci.yml` template.

@example

Gitlab.gitlab_ci_yml_template('Ruby')

@param [String] key The key of the gitlab_ci_yml template @return [Gitlab::ObjectifiedHash]

# File lib/gitlab/client/templates.rb, line 69
def gitlab_ci_yml_template(key)
  get("/templates/gitlab_ci_ymls/#{key}")
end
gitlab_ci_yml_templates() click to toggle source

Get all ‘gitlab_ci.yml` templates.

@example

Gitlab.gitlab_ci_yml_templates

@return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/templates.rb, line 58
def gitlab_ci_yml_templates
  get('/templates/gitlab_ci_ymls')
end
license_template(key, options = {}) click to toggle source

Get a single license template. You can pass parameters to replace the license placeholder.

@example

Gitlab.license_template('Ruby')

@param [String] key The key of the license template @param [Hash] options A customizable set of options. @option options [String] project(optional) The copyrighted project name. @option options [String] fullname(optional) The full-name of the copyright holder @return [Gitlab::ObjectifiedHash]

# File lib/gitlab/client/templates.rb, line 96
def license_template(key, options = {})
  get("/templates/licenses/#{key}", query: options)
end
license_templates(options = {}) click to toggle source

Get all license templates.

@example

Gitlab.license_templates
Gitlab.license_templates(popular: true)

@param [Hash] options A customizable set of options. @option options [Boolean] popular(optional) If passed, returns only popular licenses. @return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/templates.rb, line 82
def license_templates(options = {})
  get('/templates/licenses', query: options)
end