Finds the next ancestor of orig_klass after klass.
# File lib/rdoc/ri/driver.rb, line 513
def lookup_ancestor(klass, orig_klass)
# This is a bit hacky, but ri will go into an infinite
# loop otherwise, since Object has an Object ancestor
# for some reason. Depending on the documentation state, I've seen
# Kernel as an ancestor of Object and not as an ancestor of Object.
if ((orig_klass == "Object") &&
((klass == "Kernel") || (klass == "Object")))
return nil
end
cache = class_cache[orig_klass]
return nil unless cache
ancestors = [orig_klass]
ancestors.push(*cache.includes.map { |inc| inc['name'] })
ancestors << cache.superclass
ancestor_index = ancestors.index(klass)
if ancestor_index
ancestor = ancestors[ancestors.index(klass) + 1]
return ancestor if ancestor
end
lookup_ancestor klass, cache.superclass
end