提交 885a5993 编写于 作者: J José Valim

Just track "require" if we have something in the watching stack.

A patch has been provided earlier and we have asked for feedback:

    https://gist.github.com/1437939

Except one case, all other cases showed improvements in boot time.
上级 9dee5400
......@@ -87,6 +87,10 @@ def each(&block)
@stack.each(&block)
end
def watching?
!@watching.empty?
end
# return a list of new constants found since the last call to watch_namespaces
def new_constants
constants = []
......@@ -226,7 +230,7 @@ def require_association(file_name)
end
def load_dependency(file)
if Dependencies.load?
if Dependencies.load? && ActiveSupport::Dependencies.constant_watch_stack.watching?
Dependencies.new_constants_in(Object) { yield }
else
yield
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册