Skip to content

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
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