[ruby/yaml] Support old version of Psych
https://github.com/ruby/yaml/commit/5b39653c52
This commit is contained in:
parent
c1f6ad561b
commit
2bf9c82f1b
@ -69,7 +69,15 @@ class YAML::Store < PStore
|
||||
end
|
||||
|
||||
def load(content)
|
||||
table = YAML.respond_to?(:safe_load) ? YAML.safe_load(content, permitted_classes: [Symbol]) : YAML.load(content)
|
||||
table = if YAML.respond_to?(:safe_load)
|
||||
if Psych::VERSION >= "3.1"
|
||||
YAML.safe_load(content, permitted_classes: [Symbol])
|
||||
else
|
||||
YAML.safe_load(content, [Symbol])
|
||||
end
|
||||
else
|
||||
YAML.load(content)
|
||||
end
|
||||
if table == false || table == nil
|
||||
{}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user