Project

General

Profile

Bug #13275

RDoc bug for "Document-method: []"

Added by stomar (Marcus Stollsteimer) about 2 years ago. Updated almost 2 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
[ruby-core:79894]

Description

RDoc doesn't handle Document-method directives for #[] correctly. When multiple directives are given, "Document-method: []" shows up as a code block, at the beginning of the docs for the method of the directive before:

$ cat document-method-test.c 
/*
 * Document-method: foo
 * Document-method: []
 * Document-method: bar
 *
 * Does nothing.
 */
static VALUE
rb_my_method(void)
{

}

rb_cFoo = rb_define_class("Foo", rb_cObject);
rb_define_method(rb_cFoo, "foo", rb_my_method, 0);
rb_define_method(rb_cFoo, "bar", rb_my_method, 0);
rb_define_method(rb_cFoo, "[]", rb_my_method, 0);

The directive affects the docs for #foo:

$ rdoc --ri document-method-test.c -o mydoc
$ ri Foo.foo -d mydoc

Foo.foo

(from /.../.../mydoc)
------------------------------------------------------------------------------
  foo()

------------------------------------------------------------------------------

  Document-method: []

Does nothing.

When the order of the Document-method directives is changed, with Document-method: [] as the first one, everything is rendered correctly.

Real life example: https://docs.ruby-lang.org/en/2.3.0/Proc.html#method-i-call


Related issues

Related to Ruby trunk - Bug #13273: [DOC] Proc#call docs show "Document-method: []" directiveClosedActions

History

#1

Updated by stomar (Marcus Stollsteimer) about 2 years ago

  • Related to Bug #13273: [DOC] Proc#call docs show "Document-method: []" directive added

Updated by stomar (Marcus Stollsteimer) almost 2 years ago

The docs for Proc#call have been fixed with above workaround in r57767 and related backports; the bug still exists, though.

I also opened an issue on GitHub: https://github.com/rdoc/rdoc/issues/452.

Also available in: Atom PDF