From 64c3f6233bbad8d0af9116feccb480faa99b7544 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 24 Jan 2013 02:01:47 +0100 Subject: [PATCH] Improved root directory detection. --- lib/session.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/session.rb b/lib/session.rb index 1498c76e1..284c53453 100644 --- a/lib/session.rb +++ b/lib/session.rb @@ -1,8 +1,18 @@ require 'json' module Session - @path = Dir.pwd.to_s + '/tmp/websocket' - @pid = Dir.pwd.to_s + '/tmp/pids/sessionworker.pid' + + # get application root directory + @root = Dir.pwd.to_s + if !@root + @root = Rails.root + end + + # get working directories + @path = @root + '/tmp/websocket' + @pid = @root + '/tmp/pids/sessionworker.pid' + + # create global vars for threads @@user_threads = {} @@client_threads = {}