diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-16 16:05:13 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-16 16:05:13 -0800 |
commit | c21a23499ea2acb63aa2f3abe97bd22e2ec63e2b (patch) | |
tree | f5124a76b60fb16225025f492e9145e2ce3c442c /lib | |
parent | 3c5f9ff923c6f3d0365174aba3567c9226a78311 (diff) | |
download | gitlab-shell-c21a23499ea2acb63aa2f3abe97bd22e2ec63e2b.tar.gz |
Make fixes to pass rubocop
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab_access_status.rb | 4 | ||||
-rw-r--r-- | lib/gitlab_post_receive.rb | 14 | ||||
-rw-r--r-- | lib/gitlab_shell.rb | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/gitlab_access_status.rb b/lib/gitlab_access_status.rb index 597fcbb..14ec1ef 100644 --- a/lib/gitlab_access_status.rb +++ b/lib/gitlab_access_status.rb @@ -15,6 +15,6 @@ class GitAccessStatus end def to_json - {status: @status, message: @message}.to_json + { status: @status, message: @message }.to_json end -end
\ No newline at end of file +end diff --git a/lib/gitlab_post_receive.rb b/lib/gitlab_post_receive.rb index 98b935b..2a73202 100644 --- a/lib/gitlab_post_receive.rb +++ b/lib/gitlab_post_receive.rb @@ -34,19 +34,19 @@ class GitlabPostReceive # A standard terminal window is (at least) 80 characters wide. 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. 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. text_width = total_width - 2 * 2 - # Automatically wrap message at text_width (= 68) characters: - # Splits the message up into the longest possible chunks matching + # Automatically wrap message at text_width (= 68) characters: + # Splits the message up into the longest possible chunks matching # "<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), - # so drop that. + # The last result is always an empty string (0 chars and the end-of-line), + # so drop that. # message.scan returns a nested array of capture groups, so flatten. lines = message.scan(/(.{,#{text_width}})(?:\s|$)/)[0...-1].flatten @@ -67,7 +67,7 @@ class GitlabPostReceive def update_redis 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, err: '/dev/null', out: '/dev/null') return true diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb index ed25e07..c01c9bf 100644 --- a/lib/gitlab_shell.rb +++ b/lib/gitlab_shell.rb @@ -91,7 +91,7 @@ class GitlabShell # This method is not covered by Rspec because it ends the current Ruby process. 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 def api |