2 require 'rdoc/ri/descriptions'
3 require 'rdoc/ri/writer'
4 require 'rdoc/markup/to_flow'
8 def initialize(ri_cache)
12 def top_level_namespace
16 def lookup_namespace_in(target, namespaces)
19 result.concat(n.contained_modules_matching(target))
24 def find_class_by_name(full_name)
25 names = full_name.split(/::/)
28 ns = ns.contained_class_named(name)
34 def find_methods(name, is_class_method, namespaces)
36 namespaces.each do |ns|
37 result.concat ns.methods_matching(name, is_class_method)
43 # Return the MethodDescription for a given MethodEntry by deserializing the
46 def get_method(method_entry)
47 path = method_entry.path_name
48 File.open(path) { |f| RI::Description.deserialize(f) }
52 # Return a class description
54 def get_class(class_entry)
56 for path in class_entry.path_names
57 path = RiWriter.class_desc_path(path, class_entry)
58 desc = File.open(path) {|f| RI::Description.deserialize(f) }
69 # Return the names of all classes and modules
73 find_classes_in(res, @cache.toplevel)
77 # Return a list of all classes, modules, and methods
81 find_names_in(res, @cache.toplevel)
86 def find_classes_in(res, klass)
87 classes = klass.classes_and_modules
90 find_classes_in(res, c)
95 def find_names_in(res, klass)
96 classes = klass.classes_and_modules
99 res.concat c.all_method_names
100 find_names_in(res, c)