Commit 4d92ca1f authored by Valery Sizov's avatar Valery Sizov

code style fixes

parent 077e328a
......@@ -41,7 +41,7 @@ Repository.__elasticsearch__.create_index!
repo = Repository.new
params = {from_rev: FROM_SHA, to_rev: TO_SHA}.compact
params = { from_rev: FROM_SHA, to_rev: TO_SHA }.compact
print "Indexing commits..."
repo.index_commits(params)
......
......@@ -3,22 +3,21 @@ module Elastic
Error = Class.new(StandardError)
def initialize
connection_info = {
host: Gitlab.config.elasticsearch.host,
port: Gitlab.config.elasticsearch.port
}.to_json
# We accept any form of settings, including string and array
# This is why JSON is needed
@vars = {
'ELASTIC_CONNECTION_INFO' => {
host: Gitlab.config.elasticsearch.host,
port: Gitlab.config.elasticsearch.port
}.to_json,
'ELASTIC_CONNECTION_INFO' => connection_info,
'RAILS_ENV' => Rails.env
}
end
def run(project_id, repo_path, from_sha=nil, to_sha=nil)
vars = @vars.merge({
'FROM_SHA' => from_sha,
'TO_SHA' => to_sha
})
def run(project_id, repo_path, from_sha = nil, to_sha = nil)
vars = @vars.merge({ 'FROM_SHA' => from_sha, 'TO_SHA' => to_sha })
command = ['bin/elastic_repo_indexer', project_id.to_s, repo_path]
......
......@@ -5,7 +5,7 @@ module Gitlab
module Popen
extend self
def popen(cmd, path=nil, vars={})
def popen(cmd, path = nil, vars = {})
unless cmd.is_a?(Array)
raise "System commands must be given as an array of strings"
end
......
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