lib/rdoc/generator/markdown.rb in rdoc-markdown-0.1.12 vs lib/rdoc/generator/markdown.rb in rdoc-markdown-0.1.13
- old
+ new
@@ -89,16 +89,46 @@
type TEXT,
path TEXT
);
SQL
+ result = []
+
@classes.map do |klass|
- {
+ result << {
name: klass.full_name,
type: klass.type.capitalize,
path: turn_to_path(klass.full_name)
}
- end.each do |rec|
+
+ klass.method_list.each do |method|
+ next if method.visibility.to_s.eql?("private")
+
+ result << {
+ name: "#{klass.full_name}.#{method.name}",
+ type: "Method",
+ path: turn_to_path(klass.full_name)
+ }
+ end
+
+ klass.constants.sort_by { |x| x.name }.each do |const|
+ result << {
+ name: "#{klass.full_name}.#{const.name}",
+ type: "Constant",
+ path: turn_to_path(klass.full_name)
+ }
+ end
+
+ klass.attributes.sort_by { |x| x.name }.each do |attr|
+ result << {
+ name: "#{klass.full_name}.#{attr.name}",
+ type: "Attribute",
+ path: turn_to_path(klass.full_name)
+ }
+ end
+ end
+
+ result.each do |rec|
db.execute "insert into contentIndex (name, type, path) values (:name, :type, :path)", rec
end
end
def emit_classfiles