diff options
author | Omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-02-24 22:47:46 +1100 |
---|---|---|
committer | Omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-02-24 22:47:46 +1100 |
commit | 7b3afcaf77f96e7d62f6cd1623ead7f17512d79f (patch) | |
tree | b5f82c64e9c06a84e4d095ab4ac48712e860b673 /deps/Unity/auto/yaml_helper.rb | |
parent | b047be5252aeb981faea077409c1768fda0301d9 (diff) |
repo init. partial port of existing code
Diffstat (limited to 'deps/Unity/auto/yaml_helper.rb')
-rw-r--r-- | deps/Unity/auto/yaml_helper.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/deps/Unity/auto/yaml_helper.rb b/deps/Unity/auto/yaml_helper.rb new file mode 100644 index 0000000..3296ba0 --- /dev/null +++ b/deps/Unity/auto/yaml_helper.rb @@ -0,0 +1,22 @@ +# ========================================== +# Unity Project - A Test Framework for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + +require 'yaml' + +module YamlHelper + def self.load(body) + if YAML.respond_to?(:unsafe_load) + YAML.unsafe_load(body) + else + YAML.load(body) + end + end + + def self.load_file(file) + body = File.read(file) + self.load(body) + end +end |