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
Conversation
It seems to be the accepted solution elsewhere - see faker-ruby/faker#2487. @Qqwy is any chance we could get this one accepted please? |
@benhawker thanks for pinging me; for some reason I had missed this PR previously. @mak-dunkelziffer thank you very much for your PR! Replacing I'll modify your PR for this, merge it, and release a new version of the gem 👍 |
- Use `Random` (the class) on Ruby >= 3 - Use `Random::DEFAULT` on Ruby < 3. (since 3.x this is deprecated)
since the behaviour of `myfun(**{})` changed c.f. https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/#other-minor-changes-empty-hash
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 😊 |
… 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.
…test-core` needs to be updated first.
Version 0.18.1 which includes these changes has been released! |
Thank you for this & for this library! |
Random::DEFAULT
seems to be deprecated in Ruby 3.2. I simply replaced it withRandom.new
and my specs worked. I am not sure, if this is the correct solution. Please investigate before merging.