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 support for Ruby 3.2 #14

Merged
merged 8 commits into from May 11, 2023
Merged

Conversation

mak-dunkelziffer
Copy link
Contributor

Random::DEFAULT seems to be deprecated in Ruby 3.2. I simply replaced it with Random.new and my specs worked. I am not sure, if this is the correct solution. Please investigate before merging.

@benhawker
Copy link

It seems to be the accepted solution elsewhere - see faker-ruby/faker#2487. @Qqwy is any chance we could get this one accepted please?

@Qqwy
Copy link
Owner

Qqwy commented May 11, 2023

@benhawker thanks for pinging me; for some reason I had missed this PR previously.

@mak-dunkelziffer thank you very much for your PR! Replacing Random::DEFAULT is indeed a good idea because we definitely want to support Ruby 3.2.
The proper replacement however is Random (the class) and not Random.new, in order to still use the 'global' RNG by default. (This is necessary in order to ensure that when you re-run your test suite with the same seed, the same input data is generated.)

I'll modify your PR for this, merge it, and release a new version of the gem 👍

@Qqwy
Copy link
Owner

Qqwy commented May 11, 2023

Running the test suite after applying the change encounters this problem: how the call myfun(**{}) is handled is changed in 3.0 (before it would pass an empty hash to the caller, now it passes nil.)

A fix for thas has now been added to this PR as well 😊

Qqwy added 5 commits May 11, 2023 21:19
… and 3.2

and drop version 2.5 since:
- the CI bundler build step does not seem to support it anymore
- It is a truly ancient version now as well; official support for 2.5
  from the Ruby lang teaam has ended long ago.
@Qqwy Qqwy merged commit c57caab into Qqwy:main May 11, 2023
4 checks passed
@Qqwy
Copy link
Owner

Qqwy commented May 11, 2023

Version 0.18.1 which includes these changes has been released!

@benhawker
Copy link

Thank you for this & for this library!

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.

None yet

3 participants