Remove unused method RDoc::Require#top_level that always raises NoMethodError - #1813
Merged
Conversation
Documentation previewCommit: |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The removed method is broken and has no remaining callers in the repository.
Pull request overview
Removes a long-broken, unused RDoc::Require#top_level API and its obsolete state.
Changes:
- Removes the unused
@top_levelinitialization. - Removes the method referencing deleted
RDoc::TopLevelAPIs.
File summaries
| File | Description |
|---|---|
lib/rdoc/code_object/require.rb |
Removes obsolete top-level lookup logic. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
st0012
approved these changes
Sep 6, 2026
| @@ -16,7 +16,6 @@ class Require < CodeObject | |||
| def initialize(name, comment) | |||
| super() | |||
| @name = name.gsub(/'|"/, "") #' | |||
Member
There was a problem hiding this comment.
Not related, but does the #' here does anything?
Member
Author
There was a problem hiding this comment.
Removed.
It's strange. There's two more #' comments in lib/rdoc/context.rb 🤔
…hodError It has been broken since 2d88424 (Move global parse state to RDoc::Store) removed TopLevel.all_files_hash and TopLevel.all_files. Result of `RDoc::Require.new('a','b').top_level` is basically unchanged. Before: NoMethodError(undefined method 'all_files_hash') After: NoMethodError(undefined method 'top_level')
tompng
force-pushed
the
rm_require_deadcode
branch
from
September 7, 2026 12:37
e37929e to
f467787
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It has been broken since 2d88424 (Move global parse state to RDoc::Store) removed TopLevel.all_files_hash and TopLevel.all_files.
Result of
RDoc::Require.new('a','b').top_levelis basically unchanged.Before:
NoMethodError(undefined method 'all_files_hash')After:
NoMethodError(undefined method 'top_level')