Skip to content

Split Random::Formatter to core and stdlib#2661

Merged
ksss merged 5 commits intoruby:masterfrom
ksss:random-formatter
Oct 6, 2025
Merged

Split Random::Formatter to core and stdlib#2661
ksss merged 5 commits intoruby:masterfrom
ksss:random-formatter

Conversation

@ksss
Copy link
Collaborator

@ksss ksss commented Sep 15, 2025

Fix #2660

In CRuby, the methods of Random::Formatter are split between core and the stdlib random/formatter.
I propose that RBS will also create new stdlib random/formatter modules and separate the methods.

  • core
    • rand
    • random_number
  • stdlib
    • base64
    • hex
    • random_bytes
    • urlsafe_base64
    • uuid
    • alphanumeric

This change is non-backward compatible.
However, since random-formatter is only used with securerandom and seems unlikely to cause significant issues,
we have not added migration code like stringio.

See also:

In CRuby, the methods of `Random::Formatter` are split between core and the stdlib random/formatter.
RBS will also create new stdlib random/formatter modules and separate the methods.

* core
    * rand
    * random_number
* stdlib
    * base64
    * hex
    * random_bytes
    * urlsafe_base64
    * uuid
    * alphanumeric

See also:
* https://bugs.ruby-lang.org/issues/18190
* https://bugs.ruby-lang.org/issues/20893
@ksss ksss added this to the RBS 4.0 milestone Sep 17, 2025
@ksss ksss added this pull request to the merge queue Oct 6, 2025
Merged via the queue into ruby:master with commit 955a9cb Oct 6, 2025
20 checks passed
@ksss ksss deleted the random-formatter branch October 6, 2025 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The additional methods for Random::Formatter should be part of the standard library.

1 participant