summaryrefslogtreecommitdiff
path: root/lib/api/deployments.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/deployments.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/deployments.rb')
-rw-r--r--lib/api/deployments.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/api/deployments.rb b/lib/api/deployments.rb
index eb45df31ff9..6deb89a6809 100644
--- a/lib/api/deployments.rb
+++ b/lib/api/deployments.rb
@@ -8,34 +8,34 @@ module API
before { authenticate! }
params do
- requires :id, type: String, desc: 'The project ID'
+ requires :id, type: String, desc: "The project ID"
end
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
- desc 'Get all deployments of the project' do
- detail 'This feature was introduced in GitLab 8.11.'
+ desc "Get all deployments of the project" do
+ detail "This feature was introduced in GitLab 8.11."
success Entities::Deployment
end
params do
use :pagination
- optional :order_by, type: String, values: %w[id iid created_at ref], default: 'id', desc: 'Return deployments ordered by `id` or `iid` or `created_at` or `ref`'
- optional :sort, type: String, values: %w[asc desc], default: 'asc', desc: 'Sort by asc (ascending) or desc (descending)'
+ optional :order_by, type: String, values: %w[id iid created_at ref], default: "id", desc: "Return deployments ordered by `id` or `iid` or `created_at` or `ref`"
+ optional :sort, type: String, values: %w[asc desc], default: "asc", desc: "Sort by asc (ascending) or desc (descending)"
end
# rubocop: disable CodeReuse/ActiveRecord
- get ':id/deployments' do
+ get ":id/deployments" do
authorize! :read_deployment, user_project
present paginate(user_project.deployments.order(params[:order_by] => params[:sort])), with: Entities::Deployment
end
# rubocop: enable CodeReuse/ActiveRecord
- desc 'Gets a specific deployment' do
- detail 'This feature was introduced in GitLab 8.11.'
+ desc "Gets a specific deployment" do
+ detail "This feature was introduced in GitLab 8.11."
success Entities::Deployment
end
params do
- requires :deployment_id, type: Integer, desc: 'The deployment ID'
+ requires :deployment_id, type: Integer, desc: "The deployment ID"
end
- get ':id/deployments/:deployment_id' do
+ get ":id/deployments/:deployment_id" do
authorize! :read_deployment, user_project
deployment = user_project.deployments.find(params[:deployment_id])