From: Nikolai Weibull Date: 2012-05-03T14:29:20+09:00 Subject: [ruby-core:44842] Re: [ruby-trunk - Feature #6376][Feedback] Feature lookup and checking if feature is loaded On Thu, May 3, 2012 at 6:53 AM, Yusuke Endoh wrote: > 2012/5/3 Nikolai Weibull : >> so if you have a file that provides A::B and B has already been >> provided by another library, then defined? won���t work. > > Then, defined?(A::B.some_class_method) or else. That���s far from good enough. > Anyway, I don't think it is a good idea to depend whether a feature is > "loaded" by require or not. > What we really need to know is, whether a feature that you need is > "defined", doesn't it? Yes, certainly. Add loaded?/feature? that works like defined? except that it doesn���t leak its lookup into parent namespaces.