diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-20 03:22:49 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-20 03:22:49 +0000 |
commit | 2ef9c50c6e405717d06362787c4549ca4f1c6485 (patch) | |
tree | ee99486567461dd5796f3d6edcc9e204187f2666 /lib/rdoc/parser/simple.rb | |
parent | d7effd506f5b91a636f2e6452ef1946b923007c7 (diff) | |
download | ruby-2ef9c50c6e405717d06362787c4549ca4f1c6485.tar.gz |
Import RDoc 3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parser/simple.rb')
-rw-r--r-- | lib/rdoc/parser/simple.rb | 13 |
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 |