Use Rails.root.join where appropriate
This commit is contained in:
parent
82c3f62603
commit
afc4a75499
11 changed files with 17 additions and 17 deletions
|
@ -10,7 +10,7 @@ module Gitlab
|
|||
attr_reader :config_tmp_dir, :ga_repo, :conf
|
||||
|
||||
def config_tmp_dir
|
||||
@config_tmp_dir ||= File.join(Rails.root, 'tmp',"gitlabhq-gitolite-#{Time.now.to_i}")
|
||||
@config_tmp_dir ||= Rails.root.join('tmp',"gitlabhq-gitolite-#{Time.now.to_i}")
|
||||
end
|
||||
|
||||
def ga_repo
|
||||
|
@ -19,7 +19,7 @@ module Gitlab
|
|||
|
||||
def apply
|
||||
Timeout::timeout(30) do
|
||||
File.open(File.join(Rails.root, 'tmp', "gitlabhq-gitolite.lock"), "w+") do |f|
|
||||
File.open(Rails.root.join('tmp', "gitlabhq-gitolite.lock"), "w+") do |f|
|
||||
begin
|
||||
# Set exclusive lock
|
||||
# to prevent race condition
|
||||
|
|
|
@ -15,7 +15,7 @@ module Gitlab
|
|||
end
|
||||
|
||||
def self.build
|
||||
new(File.join(Rails.root, "log", file_name))
|
||||
new(Rails.root.join("log", file_name))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -28,7 +28,7 @@ module Gitlab
|
|||
|
||||
def process
|
||||
Grit::Git.with_timeout(30.seconds) do
|
||||
lock_file = File.join(Rails.root, "tmp", "merge_repo_#{project.path}.lock")
|
||||
lock_file = Rails.root.join("tmp", "merge_repo_#{project.path}.lock")
|
||||
|
||||
File.open(lock_file, "w+") do |f|
|
||||
f.flock(File::LOCK_EX)
|
||||
|
@ -36,7 +36,7 @@ module Gitlab
|
|||
unless project.satellite.exists?
|
||||
raise "You should run: rake gitlab:app:enable_automerge"
|
||||
end
|
||||
|
||||
|
||||
project.satellite.clear
|
||||
|
||||
Dir.chdir(project.satellite.path) do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module Gitlab
|
||||
class Satellite
|
||||
|
||||
|
||||
PARKING_BRANCH = "__parking_branch"
|
||||
|
||||
attr_accessor :project
|
||||
|
@ -14,7 +14,7 @@ module Gitlab
|
|||
end
|
||||
|
||||
def path
|
||||
File.join(Rails.root, "tmp", "repo_satellites", project.path)
|
||||
Rails.root.join("tmp", "repo_satellites", project.path)
|
||||
end
|
||||
|
||||
def exists?
|
||||
|
@ -36,6 +36,6 @@ module Gitlab
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue