ruby / ruby/rdoc

rdoc 6.13.1 does not detect `private :new`

Open
#1,364 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
930
Forks
465
Avg merge
3d 10h
Merged PRs (30d)
27

Description

I'm not sure if this is a bug report or a feature request; I think it has worked in the past but I'm not sure.

Given an input foo.rb:

# Example Foo class should not document private new
class Foo
  class << self
    private :new
  end

  # This should not be documented
  def initialize(...)
  end
end

The generated documentation should not document the new class method.

Image

I can work around this by adding # :nodoc:, but it feels like something that should be detected by the parser.

I'm updating a gem to be Ruby 3.2+, so if there's a better way to mark a private new in those versions that rdoc does detect, I can use that instead.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the foo.rb reproducer and run rdoc to inspect how private :new is represented in the generated documentation. Trace the parser handling of the private declaration and verify that the generated documentation no longer lists the new class method, while initialize remains undocumented.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.