Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Random.random_number #5878

Closed
wants to merge 1 commit into from
Closed

add Random.random_number #5878

wants to merge 1 commit into from

Conversation

ahorek
Copy link
Contributor

@ahorek ahorek commented Sep 15, 2019

random_number is just an alias to rand

fixes

Random.new.random_number

Random.random_number (and SecureRandom.bytes #5773) is actually a ruby 2.6 feature, should I keep it or move it to 2.6 branch?

@ahorek
Copy link
Contributor Author

ahorek commented Sep 15, 2019

looking at the source again, it looks like SecureRandom defines this method dynamically after
require 'securerandom'
https://github.com/ruby/ruby/blob/master/random.c#L1567

@ahorek
Copy link
Contributor Author

ahorek commented Sep 15, 2019

SecureRandom should automatically extend the original Random class https://github.com/ruby/ruby/blob/c5eb24349a4535948514fe765c3ddb0628d81004/lib/securerandom.rb#L135

do we wanna support extending Random via Random::Formatter? anyway this PR is wrong, so closing for now.

@ahorek ahorek closed this Sep 15, 2019
@enebo enebo added this to the Invalid or Duplicate milestone Oct 30, 2019
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.

2 participants