2 # Used to implement Module#autoload.
8 attr_reader :original_path
10 def initialize(name, scope, path)
14 @path, = __split_path__(path)
19 # When any code that finds a constant sees an instance of Autoload as its match,
20 # it calls this method on us
27 # Called by Autoload.remove
29 scope.__send__(:remove_const, name)
36 # Initializes as a Hash with an empty array as the default value
38 @autoloads ||= Hash.new {|h,k| h[k] = Array.new }
42 # Called by Autoload#initialize
44 autoloads[al.path] << al
48 # Called by require; see kernel/core/compile.rb
50 al = autoloads.delete(path)
52 al.each {|a| a.discard }