lib/docurium/docparser.rb in docurium-0.4.2 vs lib/docurium/docparser.rb in docurium-0.5.0
- old
+ new
@@ -24,11 +24,11 @@
UnsavedFile.new(full_path, contents)
end
# Override the path we want to filter by
filename = File.join(tmpdir, orig_filename)
- tu = Index.new.parse_translation_unit(filename, [], unsaved, {:detailed_preprocessing_record => 1})
+ tu = Index.new.parse_translation_unit(filename, ["-DDOCURIUM=1"], unsaved, {:detailed_preprocessing_record => 1})
FileUtils.remove_entry(tmpdir)
cursor = tu.cursor
@@ -147,10 +147,11 @@
end
end
def extract_subject_desc(comment)
subject = comment.child.text
- desc = (comment.find_all { |cmt| cmt.kind == :comment_paragraph }).drop(1).map(&:text).join("\n\n")
+ paras = comment.find_all { |cmt| cmt.kind == :comment_paragraph }.drop(1).map { |p| p.map(&:text).join() }
+ desc = paras.join("\n\n")
return subject, desc
end
def extract_function(cursor)
comment = cursor.comment