lib/active_support/dependencies.rb in activesupport-5.2.0 vs lib/active_support/dependencies.rb in activesupport-5.2.1.rc1
- old
+ new
@@ -222,10 +222,12 @@
def require_or_load(file_name)
Dependencies.require_or_load(file_name)
end
+ # :doc:
+
# Interprets a file using <tt>mechanism</tt> and marks its defined
# constants as autoloaded. <tt>file_name</tt> can be either a string or
# respond to <tt>to_path</tt>.
#
# Use this method in code that absolutely needs a certain constant to be
@@ -239,9 +241,11 @@
raise ArgumentError, "the file name must either be a String or implement #to_path -- you passed #{file_name.inspect}"
end
Dependencies.depend_on(file_name, message)
end
+
+ # :nodoc:
def load_dependency(file)
if Dependencies.load? && Dependencies.constant_watch_stack.watching?
Dependencies.new_constants_in(Object) { yield }
else