summaryrefslogtreecommitdiff
path: root/lib/api/templates.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/templates.rb')
-rw-r--r--lib/api/templates.rb32
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/api/templates.rb b/lib/api/templates.rb
index 51f357d9477..c4b1c4f2d52 100644
--- a/lib/api/templates.rb
+++ b/lib/api/templates.rb
@@ -6,14 +6,14 @@ module API
GLOBAL_TEMPLATE_TYPES = {
gitignores: {
- gitlab_version: 8.8
+ gitlab_version: 8.8,
},
gitlab_ci_ymls: {
- gitlab_version: 8.9
+ gitlab_version: 8.9,
},
dockerfiles: {
- gitlab_version: 8.15
- }
+ gitlab_version: 8.15,
+ },
}.freeze
helpers do
@@ -23,12 +23,12 @@ module API
end
end
- desc 'Get the list of the available license template' do
- detail 'This feature was introduced in GitLab 8.7.'
+ desc "Get the list of the available license template" do
+ detail "This feature was introduced in GitLab 8.7."
success ::API::Entities::License
end
params do
- optional :popular, type: Boolean, desc: 'If passed, returns only popular licenses'
+ optional :popular, type: Boolean, desc: "If passed, returns only popular licenses"
use :pagination
end
get "templates/licenses" do
@@ -40,17 +40,17 @@ module API
present paginate(::Kaminari.paginate_array(templates)), with: ::API::Entities::License
end
- desc 'Get the text for a specific license' do
- detail 'This feature was introduced in GitLab 8.7.'
+ desc "Get the text for a specific license" do
+ detail "This feature was introduced in GitLab 8.7."
success ::API::Entities::License
end
params do
- requires :name, type: String, desc: 'The name of the template'
+ requires :name, type: String, desc: "The name of the template"
end
- get "templates/licenses/:name", requirements: { name: /[\w\.-]+/ } do
+ get "templates/licenses/:name", requirements: {name: /[\w\.-]+/} do
template = TemplateFinder.build(:licenses, nil, name: params[:name]).execute
- not_found!('License') unless template.present?
+ not_found!("License") unless template.present?
template.resolve!(
project_name: params[:project].presence,
@@ -63,7 +63,7 @@ module API
GLOBAL_TEMPLATE_TYPES.each do |template_type, properties|
gitlab_version = properties[:gitlab_version]
- desc 'Get the list of the available template' do
+ desc "Get the list of the available template" do
detail "This feature was introduced in GitLab #{gitlab_version}."
success Entities::TemplatesList
end
@@ -75,14 +75,14 @@ module API
present paginate(templates), with: Entities::TemplatesList
end
- desc 'Get the text for a specific template present in local filesystem' do
+ desc "Get the text for a specific template present in local filesystem" do
detail "This feature was introduced in GitLab #{gitlab_version}."
success Entities::Template
end
params do
- requires :name, type: String, desc: 'The name of the template'
+ requires :name, type: String, desc: "The name of the template"
end
- get "templates/#{template_type}/:name", requirements: { name: /[\w\.-]+/ } do
+ get "templates/#{template_type}/:name", requirements: {name: /[\w\.-]+/} do
finder = TemplateFinder.build(template_type, nil, name: declared(params)[:name])
new_template = finder.execute