Skip to content

Add example of :method: directive getting ignored.#1588

Open
p8 wants to merge 1 commit intoruby:masterfrom
p8:expand-method-directive-ignore
Open

Add example of :method: directive getting ignored.#1588
p8 wants to merge 1 commit intoruby:masterfrom
p8:expand-method-directive-ignore

Conversation

@p8
Copy link
Contributor

@p8 p8 commented Jan 30, 2026

Also make the comment about hidden methods slightly clearer — these
methods don't appear in the code, but they appear in the generated
documentation.

Also make the comment about hidden methods slightly clearer — these
methods don't appear in the code, but they appear in the generated
documentation.
@p8 p8 requested a deployment to fork-preview-protection January 30, 2026 18:31 — with GitHub Actions Waiting
# You can provide documentation for methods that don't appear using
# the :method:, :singleton-method: and :attr: directives:
# You can provide documentation for methods that don't appear in the code
# using the :method:, :singleton-method: and :attr: directives:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part looks good to me

# # :method: ghost_method
# # ghost_method will be ignored.
#
# def standard_rdocable_method() end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part seems it's just describing a bug or unintentional behavior in detail.

In this example, HTML contains ":method: ghost_method" as a plain text. Looks like a bug.

##
# :method: ghost_method
# ghost_method will be ignored.
def standard_rdocable_method() end # rdocable item

In this example, :method: directive is ignored, nothing is documented. I also think this is a bug too.

##
# :method: foobarbaz_foo
attr_reader("#{PREFIX}_foo") # RDoc::Parser::Ruby thinks this is an rdocable item

In both cases, result will changed in the experimental (and the next default) RDoc::Parser::PrismRuby parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants