Avoid using {...} for multi-line blocks
This commit is contained in:
parent
6579c336f9
commit
da884aabc7
|
@ -74,7 +74,7 @@ Style/BlockComments:
|
|||
|
||||
Style/BlockEndNewline:
|
||||
Description: 'Put end statement of multiline block on its own line.'
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Style/Blocks:
|
||||
Description: >-
|
||||
|
@ -82,7 +82,7 @@ Style/Blocks:
|
|||
always ugly).
|
||||
Prefer {...} over do...end for single-line blocks.
|
||||
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Style/BracesAroundHashParameters:
|
||||
Description: 'Enforce braces style around hash parameters.'
|
||||
|
|
|
@ -120,7 +120,7 @@ module APIGuard
|
|||
end
|
||||
|
||||
def oauth2_bearer_token_error_handler
|
||||
Proc.new {|e|
|
||||
Proc.new do |e|
|
||||
response = case e
|
||||
when MissingTokenError
|
||||
Rack::OAuth2::Server::Resource::Bearer::Unauthorized.new
|
||||
|
@ -150,7 +150,7 @@ module APIGuard
|
|||
end
|
||||
|
||||
response.finish
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
module API
|
||||
# Internal access API
|
||||
class Internal < Grape::API
|
||||
before {
|
||||
authenticate_by_gitlab_shell_token!
|
||||
}
|
||||
before { authenticate_by_gitlab_shell_token! }
|
||||
|
||||
namespace 'internal' do
|
||||
# Check if git command is allowed to project
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
module API
|
||||
# namespaces API
|
||||
class Namespaces < Grape::API
|
||||
before {
|
||||
before do
|
||||
authenticate!
|
||||
authenticated_as_admin!
|
||||
}
|
||||
end
|
||||
|
||||
resource :namespaces do
|
||||
# Get a namespaces list
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
module API
|
||||
# Hooks API
|
||||
class SystemHooks < Grape::API
|
||||
before {
|
||||
before do
|
||||
authenticate!
|
||||
authenticated_as_admin!
|
||||
}
|
||||
end
|
||||
|
||||
resource :hooks do
|
||||
# Get the list of system hooks
|
||||
|
|
Loading…
Reference in New Issue