1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Import RDoc 3

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2010-12-20 03:22:49 +00:00
parent d7effd506f
commit 2ef9c50c6e
106 changed files with 8878 additions and 4179 deletions

View file

@ -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