Is there any way, to track dynamically which classes or modules are included in required files.
a short example:
#my_module.rb
module MyCustomModule
def foo
end
end
#custom.rb
require 'my_module.rb'
#is here any way to track which modules are in the required 'my_module.rb'
#without parsing the file or having some naming conventions?
The aim is, to require dynamically a bunch of files and including the contained modules in a class, regardless of how they are named.