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

Allow psych v4 #98

Merged
merged 1 commit into from
May 31, 2022
Merged

Allow psych v4 #98

merged 1 commit into from
May 31, 2022

Conversation

orien
Copy link
Contributor

@orien orien commented Apr 18, 2022

Context

Version 4 of the psych gem has been released and is provided with Ruby 3.1. Let's make cfn-model compatible with this new major version for psych!

Change

Relax the gem dependency constraints so psych V3 or V4 can be used.

In psych v4, the YAML.load method has been updated to provide a similar interface and semantics to YAML.safe_load. Refactor the code to use YAML.safe_load for a consistent behaviour between psych V3 and V4.

Considerations

Psych will automatically convert strings that look like dates to Ruby Date objects. We need to permit this class when loading CloudFormation YAML.

The permitted_classes keyword argument for YAML.safe_load was introduced in psych v3.1.0. So this is now the minimum compatible version of psych.

In psych v4, the YAML.load method has been updated to provide a similar
interface and semantics to YAML.safe_load. Refactor the code to use
YAML.safe_load for a consistent behaviour between psych V3 and V4.

Psych will automatically convert strings that look like dates to Ruby
Date objects. We need to permit this class when loading CloudFormation
YAML.

The permitted_classes keyword argument for YAML.safe_load was introduced
in psych v3.1.0. So this is now the minimum compatible version of psych.
@orien
Copy link
Contributor Author

orien commented Apr 18, 2022

The RSpec test suite passes when running with psych v4.0.3 or v3.1.0.

@orien
Copy link
Contributor Author

orien commented May 30, 2022

@arothian Could I please request a review from you?

@arothian arothian merged commit 57f6382 into stelligent:master May 31, 2022
@orien orien deleted the psych-4 branch June 19, 2022 01:31
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