提交 58dec093 编写于 作者: C Carlhuda

Update rails application root detection to take into consideration a callstack...

Update rails application root detection to take into consideration a callstack that includes the rack library
上级 c102db93
......@@ -31,7 +31,7 @@ def after_initialize(&blk)
def root
@root ||= begin
call_stack = caller.map { |p| p.split(':').first }
root_path = call_stack.detect { |p| p !~ %r[railties/lib/rails] }
root_path = call_stack.detect { |p| p !~ %r[railties/lib/rails|rack/lib/rack] }
root_path = File.dirname(root_path)
while root_path && File.directory?(root_path) && !File.exist?("#{root_path}/config.ru")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册