Commit c21a2349 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Make fixes to pass rubocop

parent 3c5f9ff9
...@@ -21,4 +21,3 @@ guard 'rspec' do ...@@ -21,4 +21,3 @@ guard 'rspec' do
watch(%r{^spec/acceptance/(.+)\.feature$}) watch(%r{^spec/acceptance/(.+)\.feature$})
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' } watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
end end
...@@ -15,6 +15,6 @@ class GitAccessStatus ...@@ -15,6 +15,6 @@ class GitAccessStatus
end end
def to_json def to_json
{status: @status, message: @message}.to_json { status: @status, message: @message }.to_json
end end
end end
\ No newline at end of file
...@@ -34,19 +34,19 @@ class GitlabPostReceive ...@@ -34,19 +34,19 @@ class GitlabPostReceive
# A standard terminal window is (at least) 80 characters wide. # A standard terminal window is (at least) 80 characters wide.
total_width = 80 total_width = 80
# Git prefixes remote messages with "remote: ", so this width is subtracted # Git prefixes remote messages with "remote: ", so this width is subtracted
# from the width available to us. # from the width available to us.
total_width -= "remote: ".length total_width -= "remote: ".length
# Our centered text shouldn't start or end right at the edge of the window, # Our centered text shouldn't start or end right at the edge of the window,
# so we add some horizontal padding: 2 chars on either side. # so we add some horizontal padding: 2 chars on either side.
text_width = total_width - 2 * 2 text_width = total_width - 2 * 2
# Automatically wrap message at text_width (= 68) characters: # Automatically wrap message at text_width (= 68) characters:
# Splits the message up into the longest possible chunks matching # Splits the message up into the longest possible chunks matching
# "<between 0 and text_width characters><space or end-of-line>". # "<between 0 and text_width characters><space or end-of-line>".
# The last result is always an empty string (0 chars and the end-of-line), # The last result is always an empty string (0 chars and the end-of-line),
# so drop that. # so drop that.
# message.scan returns a nested array of capture groups, so flatten. # message.scan returns a nested array of capture groups, so flatten.
lines = message.scan(/(.{,#{text_width}})(?:\s|$)/)[0...-1].flatten lines = message.scan(/(.{,#{text_width}})(?:\s|$)/)[0...-1].flatten
...@@ -67,7 +67,7 @@ class GitlabPostReceive ...@@ -67,7 +67,7 @@ class GitlabPostReceive
def update_redis def update_redis
queue = "#{config.redis_namespace}:queue:post_receive" queue = "#{config.redis_namespace}:queue:post_receive"
msg = JSON.dump({'class' => 'PostReceive', 'args' => [@repo_path, @actor, @changes]}) msg = JSON.dump({ 'class' => 'PostReceive', 'args' => [@repo_path, @actor, @changes] })
if system(*config.redis_command, 'rpush', queue, msg, if system(*config.redis_command, 'rpush', queue, msg,
err: '/dev/null', out: '/dev/null') err: '/dev/null', out: '/dev/null')
return true return true
......
...@@ -91,7 +91,7 @@ class GitlabShell ...@@ -91,7 +91,7 @@ class GitlabShell
# This method is not covered by Rspec because it ends the current Ruby process. # This method is not covered by Rspec because it ends the current Ruby process.
def exec_cmd(*args) def exec_cmd(*args)
Kernel::exec({'PATH' => ENV['PATH'], 'LD_LIBRARY_PATH' => ENV['LD_LIBRARY_PATH'], 'GL_ID' => ENV['GL_ID']}, *args, unsetenv_others: true) Kernel::exec({ 'PATH' => ENV['PATH'], 'LD_LIBRARY_PATH' => ENV['LD_LIBRARY_PATH'], 'GL_ID' => ENV['GL_ID'] }, *args, unsetenv_others: true)
end end
def api def api
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment