Skip to content
Open
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
13 changes: 9 additions & 4 deletions lib/rdoc/parser/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@
#
# == Hidden methods and attributes
#
# 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

#
# ##
# # :attr_writer: ghost_writer
Expand All @@ -148,8 +148,13 @@
# def regular_method() end
#
# Note that by default, the :method: directive will be ignored if there is a
# standard rdocable item following it.

# standard rdocable item following it:
#
# ##
# # :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.

class RDoc::Parser::Ruby < RDoc::Parser

parse_files_matching(/\.rbw?$/)
Expand Down