Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-03 08:22:57 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-03 08:22:57 +0300
commitda884aabc7674c68eee23699efb357bc94aef8d3 (patch)
tree15565b2814b0e1269a98025330dd31652b9a0129
parent6579c336f96b00bb7897f7cbf2056286c1781281 (diff)
Avoid using {...} for multi-line blocks
-rw-r--r--.rubocop.yml4
-rw-r--r--lib/api/api_guard.rb4
-rw-r--r--lib/api/internal.rb4
-rw-r--r--lib/api/namespaces.rb4
-rw-r--r--lib/api/system_hooks.rb4
5 files changed, 9 insertions, 11 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index c3f3d7bca66..319efe7e0dc 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -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.'
diff --git a/lib/api/api_guard.rb b/lib/api/api_guard.rb
index be3d053efca..cb20bf0720d 100644
--- a/lib/api/api_guard.rb
+++ b/lib/api/api_guard.rb
@@ -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
diff --git a/lib/api/internal.rb b/lib/api/internal.rb
index a999cff09c0..7a89a26facc 100644
--- a/lib/api/internal.rb
+++ b/lib/api/internal.rb
@@ -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
diff --git a/lib/api/namespaces.rb b/lib/api/namespaces.rb
index f9f2ed90ccc..b90ed6af5fb 100644
--- a/lib/api/namespaces.rb
+++ b/lib/api/namespaces.rb
@@ -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
diff --git a/lib/api/system_hooks.rb b/lib/api/system_hooks.rb
index 3e239c5afe7..518964db50d 100644
--- a/lib/api/system_hooks.rb
+++ b/lib/api/system_hooks.rb
@@ -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