未验证 提交 f8cbc1dd 编写于 作者: B bogdanvlviv

Return back "/" to the end of RAILS_GEM_ROOT

- The "/" was removed in 40bdbce1 during
refactoring. It may cause regression since looks like was added
intentionaly because it is possible that a name of any another gem
can start with /rails/, so slash was added to ensure that it is "rails"
gem.
I would like to backport this to `5-2-stable` too.

- Use `__dir__` instead of `__FILE__`. Follow up #29176.
上级 d26f48a5
......@@ -125,7 +125,7 @@ def extract_callstack(callstack)
]
end
RAILS_GEM_ROOT = File.expand_path("../../../..", __FILE__) + "/"
RAILS_GEM_ROOT = File.expand_path("../../..", __dir__) + "/"
def ignored_callstack(path)
path.start_with?(RAILS_GEM_ROOT) ||
......
......@@ -104,7 +104,7 @@ def _extract_callstack(callstack)
end
end
RAILS_GEM_ROOT = File.expand_path("../../../..", __dir__)
RAILS_GEM_ROOT = File.expand_path("../../../..", __dir__) + "/"
def ignored_callstack(path)
path.start_with?(RAILS_GEM_ROOT) || path.start_with?(RbConfig::CONFIG["rubylibdir"])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册