Skip to content

Merge Ruby's fixed doc #685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions lib/rdoc/parser/c.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

##
# RDoc::Parser::C attempts to parse C extension files. It looks for
# the standard patterns that you find in extensions: <tt>rb_define_class,
# rb_define_method</tt> and so on. It tries to find the corresponding
# the standard patterns that you find in extensions: +rb_define_class+,
# +rb_define_method+ and so on. It tries to find the corresponding
# C source for the methods and extract comments, but if we fail
# we don't worry too much.
#
# The comments associated with a Ruby method are extracted from the C
# comment block associated with the routine that _implements_ that
# method, that is to say the method whose name is given in the
# <tt>rb_define_method</tt> call. For example, you might write:
# +rb_define_method+ call. For example, you might write:
#
# /*
# * Returns a new array that is a one-dimensional flattening of this
Expand All @@ -24,8 +24,7 @@
# * a.flatten #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# */
# static VALUE
# rb_ary_flatten(ary)
# VALUE ary;
# rb_ary_flatten(VALUE ary)
# {
# ary = rb_obj_dup(ary);
# rb_ary_flatten_bang(ary);
Expand All @@ -35,16 +34,16 @@
# ...
#
# void
# Init_Array()
# Init_Array(void)
# {
# ...
# rb_define_method(rb_cArray, "flatten", rb_ary_flatten, 0);
#
# Here RDoc will determine from the rb_define_method line that there's a
# Here RDoc will determine from the +rb_define_method+ line that there's a
# method called "flatten" in class Array, and will look for the implementation
# in the method rb_ary_flatten. It will then use the comment from that
# in the method +rb_ary_flatten+. It will then use the comment from that
# method in the HTML output. This method must be in the same source file
# as the rb_define_method.
# as the +rb_define_method+.
#
# The comment blocks may include special directives:
#
Expand All @@ -70,15 +69,15 @@
# [Document-variable: +name+]
# Documentation for the named +rb_define_variable+
#
# [Document-method: +method_name+]
# [Document-method\: +method_name+]
# Documentation for the named method. Use this when the method name is
# unambiguous.
#
# [Document-method: <tt>ClassName::method_name<tt>]
# [Document-method\: <tt>ClassName::method_name</tt>]
# Documentation for a singleton method in the given class. Use this when
# the method name alone is ambiguous.
#
# [Document-method: <tt>ClassName#method_name<tt>]
# [Document-method\: <tt>ClassName#method_name</tt>]
# Documentation for a instance method in the given class. Use this when the
# method name alone is ambiguous.
#
Expand Down Expand Up @@ -1266,4 +1265,3 @@ def scan
end

end

2 changes: 1 addition & 1 deletion lib/rdoc/rdoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# rdoc.document argv
#
# Where +argv+ is an array of strings, each corresponding to an argument you'd
# give rdoc on the command line. See <tt>rdoc --help<tt> for details.
# give rdoc on the command line. See <tt>rdoc --help</tt> for details.

class RDoc::RDoc

Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class RDoc::Task < Rake::TaskLib
attr_accessor :template

##
# Name of format generator (<tt>--format<tt>) used by rdoc. (defaults to
# Name of format generator (<tt>--format</tt>) used by rdoc. (defaults to
# rdoc's default)

attr_accessor :generator
Expand Down