Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 9751c5f4 authored by Lucas Nussbaum's avatar Lucas Nussbaum
Browse files

[input_loader] Ruby3.1 compatibility: specify Date and Time classes as permitted

parent 8a9c6ff8
No related branches found
No related tags found
No related merge requests found
Pipeline #860693 failed
......@@ -21,9 +21,15 @@ def load_yaml_file_hierarchy(directory = File.expand_path("../../input/grid5000/
# Load YAML
if /\.y.*ml\.erb$/.match(filename)
# For files with .erb.yaml extensions, process the template before loading the YAML.
file_hash = YAML::load(ERB.new(File.read(filename)).result(binding))
file_hash = YAML::load(
ERB.new(File.read(filename)).result(binding),
permitted_classes: [Date, Time]
)
else
file_hash = YAML::load_file(filename)
file_hash = YAML::load_file(
filename,
permitted_classes: [Date, Time]
)
end
if not file_hash
raise StandardError.new("loaded hash is empty")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment