summaryrefslogtreecommitdiff
path: root/lib/api/features.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/features.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/features.rb')
-rw-r--r--lib/api/features.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/api/features.rb b/lib/api/features.rb
index 4dc1834c644..3beccec88bf 100644
--- a/lib/api/features.rb
+++ b/lib/api/features.rb
@@ -7,9 +7,9 @@ module API
helpers do
def gate_value(params)
case params[:value]
- when 'true'
+ when "true"
true
- when '0', 'false'
+ when "0", "false"
false
else
params[:value].to_i
@@ -26,7 +26,7 @@ module API
end
resource :features do
- desc 'Get a list of all features' do
+ desc "Get a list of all features" do
success Entities::Feature
end
get do
@@ -35,17 +35,17 @@ module API
present features, with: Entities::Feature, current_user: current_user
end
- desc 'Set the gate value for the given feature' do
+ desc "Set the gate value for the given feature" do
success Entities::Feature
end
params do
- requires :value, type: String, desc: '`true` or `false` to enable/disable, an integer for percentage of time'
- optional :feature_group, type: String, desc: 'A Feature group name'
- optional :user, type: String, desc: 'A GitLab username'
+ requires :value, type: String, desc: "`true` or `false` to enable/disable, an integer for percentage of time"
+ optional :feature_group, type: String, desc: "A Feature group name"
+ optional :user, type: String, desc: "A GitLab username"
optional :group, type: String, desc: "A GitLab group's path, such as 'gitlab-org'"
- optional :project, type: String, desc: 'A projects path, like gitlab-org/gitlab-ce'
+ optional :project, type: String, desc: "A projects path, like gitlab-org/gitlab-ce"
end
- post ':name' do
+ post ":name" do
feature = Feature.get(params[:name])
targets = gate_targets(params)
value = gate_value(params)
@@ -70,8 +70,8 @@ module API
present feature, with: Entities::Feature, current_user: current_user
end
- desc 'Remove the gate value for the given feature'
- delete ':name' do
+ desc "Remove the gate value for the given feature"
+ delete ":name" do
Feature.get(params[:name]).remove
status 204