On Thu, May 3, 2012 at 6:53 AM, Yusuke Endoh <mame / tsg.ne.jp> wrote: > 2012/5/3 Nikolai Weibull <now / bitwi.se>: >> so if you have a file that provides A::B and B has already been >> provided by another library, then defined? won work. > > Then, defined?(A::B.some_class_method) or else. That 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 leak its lookup into parent namespaces.