From: Erik Hollensbe Date: 2008-09-02T12:26:51+09:00 Subject: Re: Where the Required Things Are (#175) Matthew Moss wrote: >> I think I'm gonna keep that around, looks useful to me. > > You're not the first person to say that. > > It would probably be useful, all around, to squish a couple of these > solutions together into a nice feature set and make a gem or rubyforge > pkg out of it. A require wrapper would be pretty slick: module Kernel def wrap_require(method=nil) if block_given? @@require_wrapper = block.to_proc else @@require_wrapper = method end end @@old_require = method(:require) def require(*args) res = @@old_require.call(*args) @@require_wrapper.call(*args) if (@@require_wrapper and res) return res end end Dunno if it really warrants a gem though. Maybe a snippet? -Erik -- Posted via http://www.ruby-forum.com/.