rubycas/rubycas-client — Issue #27: Incorrect local storage for temporary session files
Author: brodock
Created: 2011-11-25 17:18:46+00:00
State: open

As of this bug dated 2008: http://code.google.com/p/rubycas-client/issues/detail?id=23 the problem went back in Rails 3.1:

The following line (storage.rb 72):

DEFAULT_TMP_DIR = defined?(Rails.root) ? "#{Rails.root}/tmp" : "#{Dir.pwd}/tmp"

Will return "/tmp" because Rails.root will not be defined at that run time.

The solution that best repaired it was removing the constant and putting it as a local variable inside initialize method, maintaining the functionality and repairing the wrong behaviour.

FYI, I'm using Rails 3.1 with Ruby 1.9.3-p0

I will attach a pull request in a minutes