1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

revises the docs of require_dependency [ci skip]

This commit is contained in:
Xavier Noria 2013-10-01 10:10:53 +02:00
parent 276956d07c
commit 7dfbe58c70

View file

@ -198,7 +198,15 @@ module ActiveSupport #:nodoc:
Dependencies.require_or_load(file_name) Dependencies.require_or_load(file_name)
end end
# Files required this way can be reloaded in development mode # 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
# defined at that point. A typical use case is to make constant name
# resolution deterministic for constants with the same relative name in
# different namespaces whose evaluation would depend on load order
# otherwise.
def require_dependency(file_name, message = "No such file to load -- %s") def require_dependency(file_name, message = "No such file to load -- %s")
file_name = file_name.to_path if file_name.respond_to?(:to_path) file_name = file_name.to_path if file_name.respond_to?(:to_path)
unless file_name.is_a?(String) unless file_name.is_a?(String)