1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 00:15:58 +01:00

Fix broken YAML parsing on later Rubies with Psych >=4.0

YAML.load is now interpreted as YAML.safe_load, which breaks where the
YAML file contains aliases. If we can assume our yaml files are
trusted (since this a development tool), we can check for the presence
of YAML.unsafe_load and use it instead if it exists.
This commit is contained in:
Martyn Jago
2022-05-27 15:08:11 +01:00
parent e54c9787b7
commit b44c2dd095
6 changed files with 37 additions and 12 deletions

View File

@@ -51,8 +51,8 @@ class UnityTestRunnerGenerator
def self.grab_config(config_file)
options = default_options
unless config_file.nil? || config_file.empty?
require 'yaml'
yaml_guts = YAML.load_file(config_file)
require_relative 'yaml_helper'
yaml_guts = YamlHelper.load_file(config_file)
options.merge!(yaml_guts[:unity] || yaml_guts[:cmock])
raise "No :unity or :cmock section found in #{config_file}" unless options
end