Trim comment characters from docstrings

A very naive attempt. Simple removes any leading whitespace, the comment
character and then one space.
This commit is contained in:
Charlie Sharpsteen 2014-05-22 23:42:10 -07:00
parent 66af766dba
commit 9ef57b594e
1 changed files with 4 additions and 1 deletions

View File

@ -51,7 +51,10 @@ module Puppetx::Yardoc::Pops
source_text.slice(0, line-1).reverse.each do |line|
if COMMENT_PATTERN.match(line)
comments.unshift line
# FIXME: The gsub trims comments, but is extremely optimistic: It
# assumes only one space separates the comment body from the
# comment character.
comments.unshift line.gsub(/^\s*#\s/, '')
else
# No comment found on this line. We must be done piecing together a
# comment block.