This method is deprecated or moved on the latest stable version.
The last existing version (v2_2_9) is shown here.
read_directive(allowed)
public
Directives are modifier comments that can appear after class, module, or
method names. For example:
def fred# :yields: a, b
or:
class MyClass# :nodoc:
We return the directive name and any parameters as a two element array if
the name is in allowed. A directive can be found anywhere up to
the end of the current line.
# File lib/rdoc/parser/ruby.rb, line 1922
def read_directive allowed
tokens = []
while tk = get_tk do
tokens << tk
case tk
when TkNL, TkDEF then
return
when TkCOMMENT then
return unless tk.text =~ /\s*:?([\w-]+):\s*(.*)/
directive = $1.downcase
return [directive, $2] if allowed.include? directive
return
end
end
ensure
unless tokens.length == 1 and TkCOMMENT === tokens.first then
tokens.reverse_each do |token|
unget_tk token
end
end
end