, load, require, . . , . , ActiveSupport const_missing (ConstantName.to_s.underscore require 'constant_name'). , , "require".
, ( active_support)
$require_level = []
alias :orig_require :require
def require(file)
puts "#{$require_level.join}#{file}"
$require_level << "-"
r = orig_require(file)
$require_level.pop
r
end
require 'foo'
require 'baz'
ben@legba-2:~ $ ruby check_requires.rb
foo
-bar
baz
.
EDIT:
, . . . . , , , 1 , "- # {file}" . , , , . , , , . .
const_missing method_missing. , , AnObject.some_unknown_method ruby AnObject.method_missing(:some_unknown_method) , NoMethodError, SomeUnknownConstant a const_missing(:SomeUnknownConstant) , NameError. Rails const_missing , , . , , . SomeUnknownConstant some_unknown_constant.rb
.