Project

General

Profile

Actions

Feature #18190

closed

Split `Random::Formatter` from securerandom

Added by nobu (Nobuyoshi Nakada) over 2 years ago. Updated about 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:105395]

Description

Now Random::Formatter methods are defined in securerandom.rb, since it was split from SecureRandom module historically.
However this module does not need to be SecureRandom but just to respond to bytes method.
I propose to move Random::Formatter module to another file, random_formatter.rb or random/formatter.rb.
And keep only that file in ruby core and remove from securerandom library in future.


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #18183: make SecureRandom.choose publicClosednobu (Nobuyoshi Nakada)Actions
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

Updated by matz (Yukihiro Matsumoto) over 2 years ago

Accepted.

Matz.

Updated by Eregon (Benoit Daloze) over 2 years ago

+1, I agree Random::Formatter should be defined in core, along Random which is already core.

Actions #4

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Status changed from Open to Closed

Applied in changeset git|12a0a89e22fbc312e4a95a7749bc153532daa855.


[ruby/securerandom] Split Random::Formatter from SecureRandom [Feature #18190]

https://github.com/ruby/securerandom/commit/1e57277b9e

Updated by Eregon (Benoit Daloze) about 1 year ago

To clarify, random/formatter is now a stdlib (not loaded by default).

Random::Formatter is defined in core but has few methods before require 'random/formatter':

$ ruby -e 'puts Random::Formatter.instance_methods(false)'
rand
random_number
$ ruby -rrandom/formatter -e 'puts Random::Formatter.instance_methods(false)'
random_number
uuid
rand
alphanumeric
hex
random_bytes
base64
urlsafe_base64
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0