aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc/parser/simple.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/parser/simple.rb')
-rw-r--r--lib/rdoc/parser/simple.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/rdoc/parser/simple.rb b/lib/rdoc/parser/simple.rb
index e99d2d4319..1e82eb5097 100644
--- a/lib/rdoc/parser/simple.rb
+++ b/lib/rdoc/parser/simple.rb
@@ -1,7 +1,6 @@
##
# Parse a non-source file. We basically take the whole thing as one big
-# comment. If the first character in the file is '#', we strip leading pound
-# signs.
+# comment.
class RDoc::Parser::Simple < RDoc::Parser
@@ -32,10 +31,16 @@ class RDoc::Parser::Simple < RDoc::Parser
@top_level
end
- def remove_private_comments(comment)
- comment.gsub(/^--\n.*?^\+\+/m, '').sub(/^--\n.*/m, '')
+ ##
+ # Removes comments wrapped in <tt>--/++</tt>
+
+ def remove_private_comments text
+ text.gsub(/^--\n.*?^\+\+/m, '').sub(/^--\n.*/m, '')
end
+ ##
+ # Removes the encoding magic comment from +text+
+
def remove_coding_comment text
text.sub(/\A# .*coding[=:].*$/, '')
end