module ActiveSupport::Dependencies
def self.clear
reload. That involves more things, like deleting unloaded classes from the
Rails.application.reloader.reload! is the public interface for application
Private method that reloads constants autoloaded by the main autoloader.
def self.clear unload_interlock do _autoloaded_tracked_classes.clear autoloader.reload end end
def self.eager_load?(path)
def self.eager_load?(path) _eager_load_paths.member?(path) end
def self.load_interlock(&block)
preventing any other thread from being inside a #run_interlock
Execute the supplied block while holding an exclusive lock,
def self.load_interlock(&block) interlock.loading(&block) end
def self.run_interlock(&block)
Execute the supplied block without interference from any
def self.run_interlock(&block) interlock.running(&block) end
def self.search_for_file(relpath)
def self.search_for_file(relpath) relpath += ".rb" unless relpath.end_with?(".rb") autoload_paths.each do |autoload_path| abspath = File.join(autoload_path, relpath) return abspath if File.file?(abspath) end nil end
def self.unload_interlock(&block)
preventing any other thread from being inside a #run_interlock
Execute the supplied block while holding an exclusive lock,
def self.unload_interlock(&block) interlock.unloading(&block) end