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

Import RDoc r101.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2008-07-18 00:46:16 +00:00
parent 0af4a490b4
commit fd25f74d64
45 changed files with 6952 additions and 4397 deletions

View file

@ -14,21 +14,25 @@ class RDoc::Markup::PreProcess
##
# Look for common options in a chunk of text. Options that we don't handle
# are passed back to our caller as |directive, param|
# are yielded to the caller.
def handle(text)
text.gsub!(/^([ \t#]*):(\w+):\s*(.+)?\n/) do
text.gsub!(/^([ \t]*#?[ \t]*):(\w+):([ \t]*)(.+)?\n/) do
next $& if $3.empty? and $4 and $4[0, 1] == ':'
prefix = $1
directive = $2.downcase
param = $3
param = $4
case directive
when "include"
when 'include' then
filename = param.split[0]
include_file(filename, prefix)
include_file filename, prefix
else
yield(directive, param)
result = yield directive, param
result = "#{prefix}:#{directive}: #{param}\n" unless result
result
end
end
end