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
+9 -1
View File
@@ -9,9 +9,17 @@ module RakefileHelpers
C_EXTENSION = '.c'.freeze
def load_yaml(yaml_string)
begin
return YAML.load(yaml_string, aliases: true)
rescue ArgumentError
return YAML.load(yaml_string)
end
end
def load_configuration(config_file)
$cfg_file = config_file
$cfg = YAML.load(File.read($cfg_file))
$cfg = load_yaml(File.read('./targets/' + $cfg_file))
$colour_output = false unless $cfg['colour']
end