Repository navigation
Conversation
Fix rubyGH-226 ruby/ruby uses `page_dir: doc` for RDoc but we don't. So the page for `doc/strscan/helper_methods.md` is generated as `strscan/helper_methods_md.html` in ruby/ruby and as `doc/strscan/helper_methods_md.html` in ruby/strscan. A relative link can't work in both: `doc/strscan/helper_methods.md` is broken on docs.ruby-lang.org and `helper_methods.md`/`strscan/helper_methods.md` are broken in ruby/strscan. See also rubyGH-179 and rubyGH-198. Use `page_dir: doc` in ruby/strscan too so that the same link, `strscan/helper_methods.md`, works in both. `page_dir` adds `doc` to the RDoc targets. Then the default target, `.`, isn't used. So the `rdoc` task specifies `.` explicitly. Use `rdoc .` instead of `rdoc` when you run `rdoc` directly. `gem install` doesn't read `.rdoc_options`. So `--page-dir=doc` is also added to `rdoc_options` in the gemspec. Note that RDoc 6.10.0 or earlier ignores it on `gem install`. So the link in the documents generated on `gem install` is broken with old RDoc. RDoc 6.14.0 or later works. Reported by Burdette Lamar. Thanks!!! Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the documentation layout and helper-methods link changes.
No open issues 🎉
What changed in this PR
Aligns StringScanner’s RDoc page layout with Ruby core so the helper-methods link works in both standalone documentation and docs.ruby-lang.org.
Changes:
- Sets
docas the page directory for checkout builds and gem-install documentation with compatible RDoc versions. - Updates the helper-methods link to use the shared page path.
- Explicitly includes the repository root in the RDoc task to preserve source discovery.
| File | Description |
|---|---|
strscan.gemspec |
Adds --page-dir=doc for install-time documentation. |
Rakefile |
Keeps the repository root among RDoc’s input targets. |
ext/strscan/strscan.c |
Updates the helper-methods documentation link. |
.rdoc_options |
Sets doc as the documentation page directory. |
Review effort: Balanced
This branch has not been deployed
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.
Fix GH-226
ruby/ruby uses
page_dir: docfor RDoc but we don't. So the page fordoc/strscan/helper_methods.mdis generated asstrscan/helper_methods_md.htmlin ruby/ruby and asdoc/strscan/helper_methods_md.htmlin ruby/strscan. A relative link can't work in both:doc/strscan/helper_methods.mdis broken on docs.ruby-lang.org andhelper_methods.md/strscan/helper_methods.mdare broken in ruby/strscan. See also GH-179 and GH-198.Use
page_dir: docin ruby/strscan too so that the same link,strscan/helper_methods.md, works in both.page_diraddsdocto the RDoc targets. Then the default target,., isn't used. So therdoctask specifies.explicitly. Userdoc .instead ofrdocwhen you runrdocdirectly.gem installdoesn't read.rdoc_options. So--page-dir=docis also added tordoc_optionsin the gemspec. Note that RDoc 6.10.0 or earlier ignores it ongem install. So the link in the documents generated ongem installis broken with old RDoc. RDoc 6.14.0 or later works.Reported by Burdette Lamar. Thanks!!!