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

Fog::Collection delegates methods to Array, which doesn't work for methods with keywords in Ruby 3.2 #293

Closed
DimitriosLisenko opened this issue Dec 22, 2023 · 1 comment

Comments

@DimitriosLisenko
Copy link
Contributor

Context

Ruby 3.2 makes it so that delegating *args to a method that accepts keywords an ArgumentError. This is what's happening in Fog::Collection because it delegates methods to Array with *args, but some Array methods accept keywords (e.g. Array#shuffle).

Solution

For maximum compatibility across all Ruby 2.x and 3.x versions, methods that delegate with *args should be marked with ruby2_keywords. I have created a PR here to address this: #292

Relevant links

https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/
https://eregon.me/blog/2019/11/10/the-delegation-challenge-of-ruby27.html

@geemus
Copy link
Member

geemus commented Dec 22, 2023

I believe this was closed by #296

@geemus geemus closed this as completed Dec 22, 2023
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

No branches or pull requests

2 participants