Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 toYAML.safe_load
. Refactor the code to useYAML.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 forYAML.safe_load
was introduced in psych v3.1.0. So this is now the minimum compatible version of psych.