This is purely an experiment, but I\'m wondering if it\'s possible to get a list of the require
\'d gems at runtime via some kind of metaprogramming. For example
Just a slight touch to add to the previous -- consider that in order to precisely replace the behaviour of #require then you must also return a boolean value, so this is a more faithful override:
module Kernel
alias :orig_require :require
def require(name)
print "Requiring #{name}"
is_okay = orig_require(name)
puts " - #{is_okay ? 'Yup!' : 'Nope :('}"
is_okay
end
end
Interestingly with some testing I was doing -- tracking down a chain of stuff blowing up when requiring a module -- then this became necessary!