Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Permit
Time
class loading from YAML.
Since Psych 4.0, the `safe_load` is used as default loading mechanism. There are just a few permitted classes and `Time` is not one of them [[1]]. This results it test failure: ~~~ Error: test_converting_to_yaml(DocumentTest::TestSimpleConventionallyNamedDocument): Psych::DisallowedClass: Tried to load unspecified class: Time ~~~ Please also note that in YAML specs 1.2, the `timestamp` is not listed as supported tag anymore [[2]]. Given that: 1) ronn-ng does not provide any supported way of loading the serialized YAML. 2) The `to_yaml` does not appear to be used internally/externally anywhere. 3) If there were users of this functionality, it would have been already know, reported and fixed at this moment. The best course of action is fixing the test case by listing the `Time` as valid class for parsing. Fixes apjanke#80 [1]: https://docs.ruby-lang.org/en/master/Psych.html#method-c-safe_load [2]: yaml/yaml-spec#268
- Loading branch information
25158fa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
Using
load
with thepermitted_classes
named parameter would not work with ruby3.0. I think it would be better to usesafe_load
instead.