Handle yaml.load in a way that is ruby version agnostic.

This commit is contained in:
Mark VanderVoord
2023-02-06 16:46:48 -05:00
parent 69258f7034
commit bbfaf0425f
4 changed files with 27 additions and 6 deletions
+5 -1
View File
@@ -108,7 +108,11 @@ class CMockConfig
def self.load_config_file_from_yaml(yaml_filename)
require 'yaml'
require 'fileutils'
YAML.load_file(yaml_filename)[:cmock]
begin
return YAML.load_file(yaml_filename, aliases: true)[:cmock]
rescue ArgumentError
return YAML.load_file(yaml_filename)[:cmock]
end
end
def path(new_path)