diff options
author | Toon Claes <toon@gitlab.com> | 2019-02-28 19:57:34 +0100 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2019-02-28 19:57:34 +0100 |
commit | 62d7990b9bb30cf33ed87017c5c633d1cccc75c2 (patch) | |
tree | c3e1b69c58a412ba1c6f50a0337a23d9f9d6e1a4 /lib/api/broadcast_messages.rb | |
parent | f6453eca992a9c142268e78ac782cef98110d183 (diff) | |
download | gitlab-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/broadcast_messages.rb')
-rw-r--r-- | lib/api/broadcast_messages.rb | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/lib/api/broadcast_messages.rb b/lib/api/broadcast_messages.rb index 19148758fc5..2855e2e5fac 100644 --- a/lib/api/broadcast_messages.rb +++ b/lib/api/broadcast_messages.rb @@ -14,8 +14,8 @@ module API end end - desc 'Get all broadcast messages' do - detail 'This feature was introduced in GitLab 8.12.' + desc "Get all broadcast messages" do + detail "This feature was introduced in GitLab 8.12." success Entities::BroadcastMessage end params do @@ -27,16 +27,16 @@ module API present paginate(messages), with: Entities::BroadcastMessage end - desc 'Create a broadcast message' do - detail 'This feature was introduced in GitLab 8.12.' + desc "Create a broadcast message" do + detail "This feature was introduced in GitLab 8.12." success Entities::BroadcastMessage end params do - requires :message, type: String, desc: 'Message to display' - optional :starts_at, type: DateTime, desc: 'Starting time', default: -> { Time.zone.now } - optional :ends_at, type: DateTime, desc: 'Ending time', default: -> { 1.hour.from_now } - optional :color, type: String, desc: 'Background color' - optional :font, type: String, desc: 'Foreground color' + requires :message, type: String, desc: "Message to display" + optional :starts_at, type: DateTime, desc: "Starting time", default: -> { Time.zone.now } + optional :ends_at, type: DateTime, desc: "Ending time", default: -> { 1.hour.from_now } + optional :color, type: String, desc: "Background color" + optional :font, type: String, desc: "Foreground color" end post do message = BroadcastMessage.create(declared_params(include_missing: false)) @@ -48,32 +48,32 @@ module API end end - desc 'Get a specific broadcast message' do - detail 'This feature was introduced in GitLab 8.12.' + desc "Get a specific broadcast message" do + detail "This feature was introduced in GitLab 8.12." success Entities::BroadcastMessage end params do - requires :id, type: Integer, desc: 'Broadcast message ID' + requires :id, type: Integer, desc: "Broadcast message ID" end - get ':id' do + get ":id" do message = find_message present message, with: Entities::BroadcastMessage end - desc 'Update a broadcast message' do - detail 'This feature was introduced in GitLab 8.12.' + desc "Update a broadcast message" do + detail "This feature was introduced in GitLab 8.12." success Entities::BroadcastMessage end params do - requires :id, type: Integer, desc: 'Broadcast message ID' - optional :message, type: String, desc: 'Message to display' - optional :starts_at, type: DateTime, desc: 'Starting time' - optional :ends_at, type: DateTime, desc: 'Ending time' - optional :color, type: String, desc: 'Background color' - optional :font, type: String, desc: 'Foreground color' - end - put ':id' do + requires :id, type: Integer, desc: "Broadcast message ID" + optional :message, type: String, desc: "Message to display" + optional :starts_at, type: DateTime, desc: "Starting time" + optional :ends_at, type: DateTime, desc: "Ending time" + optional :color, type: String, desc: "Background color" + optional :font, type: String, desc: "Foreground color" + end + put ":id" do message = find_message if message.update(declared_params(include_missing: false)) @@ -83,14 +83,14 @@ module API end end - desc 'Delete a broadcast message' do - detail 'This feature was introduced in GitLab 8.12.' + desc "Delete a broadcast message" do + detail "This feature was introduced in GitLab 8.12." success Entities::BroadcastMessage end params do - requires :id, type: Integer, desc: 'Broadcast message ID' + requires :id, type: Integer, desc: "Broadcast message ID" end - delete ':id' do + delete ":id" do message = find_message destroy_conditionally!(message) |