summaryrefslogtreecommitdiff
path: root/lib/api/templates.rb
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2019-02-28 19:57:34 +0100
committerToon Claes <toon@gitlab.com>2019-02-28 19:57:34 +0100
commit62d7990b9bb30cf33ed87017c5c633d1cccc75c2 (patch)
treec3e1b69c58a412ba1c6f50a0337a23d9f9d6e1a4 /lib/api/templates.rb
parentf6453eca992a9c142268e78ac782cef98110d183 (diff)
downloadgitlab-ce-tc-standard-gem.tar.gz
Ran standardrb --fix on the whole codebasetc-standard-gem
Inspired by https://twitter.com/searls/status/1101137953743613952 I decided to try https://github.com/testdouble/standard on our codebase. It's opinionated, but at least it's a _standard_.
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