class RDoc::RI::Driver

def ancestors_of klass

def ancestors_of klass
  ancestors = []
  unexamined = [klass]
  seen = []
  loop do
    break if unexamined.empty?
    current = unexamined.shift
    seen << current
    stores = classes[current]
    break unless stores and not stores.empty?
    klasses = stores.map do |store|
      store.ancestors[current]
    end.flatten.uniq
    klasses = klasses - seen
    ancestors.push(*klasses)
    unexamined.push(*klasses)
  end
  ancestors.reverse
end