Fix compatibility with RDoc 6.13.0#375
Merged
jonathanhefner merged 2 commits intorails:mainfrom Mar 24, 2025
Merged
Conversation
ruby/rdoc@694987b removed support for `file_dir` and `class_dir`, which we used to prefix URL paths with `files/` or `classes/` (for example, in the URLs for https://api.rubyonrails.org/files/activerecord/lib/active_record/base_rb.html and https://api.rubyonrails.org/classes/ActiveRecord/Base.html). Note that RDoc < 6.13.0 _requires_ these methods when implementing a custom generator. Omitting them will cause RDoc to raise a `NoMethodError`. This commit monkey patches `RDoc::TopLevel` and `RDoc::ClassModule` to restore the behavior in way that is also compatible with RDoc < 6.13.0.
ruby/rdoc@f517b02 changed the signature of `RDoc::Store#initialize` from: ```ruby def initialize(path = nil, type = nil) ``` to: ```ruby def initialize(options, path: nil, type: nil) ``` which is a breaking change. This commit modifies `rdoc_top_level_for` to use the new signature. Because the issue only affects our testing code, this commit ignores compatibility with RDoc < 6.13.0.
Member
Author
|
I merged this to fix CI, but I have left feedback on ruby/rdoc#1304 and ruby/rdoc#1309, and I am hoping we can revert after RDoc 6.13.1 is released. |
jonathanhefner
added a commit
to jonathanhefner/sdoc
that referenced
this pull request
Mar 30, 2025
Follow-up to rails#375. RDoc 6.13.1 has been released, and includes support for the `class_module_path_prefix` and `file_path_prefix` options (added in ruby/rdoc@3bc179d), which serve as replacements for the `class_dir` and `file_dir` methods. This commit removes the RDoc monkey patch added in e2d849f in favor of using those options. This means SDoc will be incompatible with RDoc 6.13.0 specifically, but that shouldn't be a significant issue (and compatibility with RDoc < 6.13.0 is preserved).
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.
This PR addresses two issues with RDoc 6.13.0:
ruby/rdoc@694987b removed support for
file_dirandclass_dir, which we use to prefix URL paths withfiles/orclasses/(for example, in the URLs for https://api.rubyonrails.org/files/activerecord/lib/active_record/base_rb.html and https://api.rubyonrails.org/classes/ActiveRecord/Base.html).ruby/rdoc@f517b02 changed the signature of
RDoc::Store#initializefrominitialize(path = nil, type = nil)toinitialize(options, path: nil, type: nil), which is a breaking change.