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

Ruby 3.1 / psych 4.0 YAML#safe_load requires permitted classes in keyword parameter #23

Merged
merged 2 commits into from
May 2, 2022
Merged

Ruby 3.1 / psych 4.0 YAML#safe_load requires permitted classes in keyword parameter #23

merged 2 commits into from
May 2, 2022

Conversation

quatauta
Copy link
Contributor

@quatauta quatauta commented May 1, 2022

Since psych 4.0, YAML#safe_load requires the permitted classes in keyword parameter permitted_classes. Ruby 3.1 ships with psych 4.0.

This PR adds Ruby 3.1 to the GitHub Actions matrix, and updates the calls to YAML#safe_load checking if the method accepts keyword parameter permitted_classes (available since psych 3.1.0).

For older versions of psych (not accepting YAML#safe_load keyword parameter permitted_classes; up to psych 3.0.3), the permitted classes are specified a second positional parameter (whitelisted_classes psych <=3.0.3, legacy_permitted_classes psych >=3.1.0 <4.0.0)

Closes #22.

@jaredbeck jaredbeck merged commit 777a625 into jaredbeck:master May 2, 2022
@jaredbeck
Copy link
Owner

Thanks Daniel. Nice work!

@jaredbeck
Copy link
Owner

Released in 0.6.1

@quatauta quatauta deleted the 22-ruby-3-1-yaml-safe-load-requires-keyword-parameter branch May 2, 2022 18:49
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.

[ruby-3.1.2] Unable to calculate libyears for ruby itself: wrong number of arguments (given 2, expected 1)
2 participants