diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-09-26 22:52:01 +0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-09-27 00:32:26 +0400 |
commit | afc4a75499b6678a643e6b62f703f8e7e1eb0f0a (patch) | |
tree | 19855be537491fb2e1f79907e034f8f199915f46 /lib | |
parent | 82c3f6260366147803d5f63d575231f77c7e73ce (diff) |
Use Rails.root.join where appropriate
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/backend/gitolite_config.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/logger.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/merge.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/satellite.rb | 6 |
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/gitlab/backend/gitolite_config.rb b/lib/gitlab/backend/gitolite_config.rb index f51e8efc370..ffe15fb1123 100644 --- a/lib/gitlab/backend/gitolite_config.rb +++ b/lib/gitlab/backend/gitolite_config.rb @@ -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 diff --git a/lib/gitlab/logger.rb b/lib/gitlab/logger.rb index 9405163dced..cf9a4c4afa2 100644 --- a/lib/gitlab/logger.rb +++ b/lib/gitlab/logger.rb @@ -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 diff --git a/lib/gitlab/merge.rb b/lib/gitlab/merge.rb index 180135745f8..de8e737a8f3 100644 --- a/lib/gitlab/merge.rb +++ b/lib/gitlab/merge.rb @@ -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 diff --git a/lib/gitlab/satellite.rb b/lib/gitlab/satellite.rb index 4bcbfe8db88..9d8dfb8e0a4 100644 --- a/lib/gitlab/satellite.rb +++ b/lib/gitlab/satellite.rb @@ -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 |