Skip to content

Small documentation adjustments for new/updated features#15634

Merged
zverok merged 6 commits intoruby:masterfrom
zverok:docs-small-adjustments
Dec 20, 2025
Merged

Small documentation adjustments for new/updated features#15634
zverok merged 6 commits intoruby:masterfrom
zverok:docs-small-adjustments

Conversation

@zverok
Copy link
Copy Markdown
Contributor

@zverok zverok commented Dec 18, 2025

Just a bunch of stuff I've noticed while reviewing and checking through NEWS.md and the relevant docs. All small enough to not split into multiple PRs, I believe (but every change is in its own commit):

  • Add basic docs to Range#to_set
  • Update Thread#raise and Fiber#raise signature to include cause:
    • I also updated a bit the general documentation for Fiber#raise, it had excessive explanations duplicating (old) those of Kernel#raise, but no Fiber-specific example
  • doc/language/character_selectors.rdoc: added String#strip to the list of methods that support selectors
  • doc/syntax/calling_methods.rdoc: simplified the language about *nil, removing the NilClass#to_a reference
  • Array:
    • #find: simplified code example a bit (it seems to be copied from Enumerable#find with then adjusting to arrays, but the additional example on array-of-pairs brought no new information)
    • #rfind: rewrote code example a bit (was copied from Enumerable#find with output adjusted, but still used general enumerables, not arrays, as example objects)

@zverok zverok self-assigned this Dec 18, 2025
Comment thread array.c
*
* With a block given, calls the block with successive elements of the array in
* reverse order; returns the last element for which the block returns a truthy
* reverse order; returns the first element for which the block returns a truthy
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one thing I am not so sure about, but for me, this still seems less confusing: it iterates in reverse order, and [in that backward order], finds the first ever element matching the condition, not the last one. But maybe the whole paragraph is better to be rephrased somehow to fully remove the ambiguity.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your change makes it clearer.

Copy link
Copy Markdown
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Comment thread cont.c
* Raises +FiberError+ if called on a Fiber belonging to another +Thread+.
*
* See Kernel#raise for more information.
* See Kernel#raise for more information on arguments.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not an issue with this PR, but it might be worth updating the Kernel#raise documentation to document that cause cannot be provided as the only argument to raise. This also applies to Fiber#raise and Thread#raise, but since they already reference Kernel#raise, does not need to be mentioned specifically in each.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍

Added one more separate commit with a (brief) phrase about that.

Comment thread thread.c Outdated
Comment thread range.c Outdated
@zverok zverok force-pushed the docs-small-adjustments branch from 7f6052c to 271e835 Compare December 19, 2025 18:18
@zverok zverok requested a review from nobu December 19, 2025 18:18
@launchable-app
Copy link
Copy Markdown

launchable-app Bot commented Dec 19, 2025

2/67075 Tests Failed

test/fiber/test_scheduler.rb#test_close_at_exit

test/ruby/test_gc.rb#test_stat
Failure:
TestGc#test_stat [/Users/runner/work/ruby/ruby/src/test/ruby/test_gc.rb:178]:
<185666> expected but was
<185002>.

[-> View Test suite health in main branch]

@nobu nobu added the Documentation Improvements to documentation. label Dec 20, 2025
@zverok zverok force-pushed the docs-small-adjustments branch from 271e835 to 31ef443 Compare December 20, 2025 09:56
@zverok zverok merged commit ec4ca91 into ruby:master Dec 20, 2025
50 checks passed
@zverok zverok deleted the docs-small-adjustments branch December 20, 2025 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements to documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants