mirror of
https://github.com/ThrowTheSwitch/Unity
synced 2025-02-02 09:18:44 -05:00
24 lines
572 B
Ruby
24 lines
572 B
Ruby
# =========================================================================
|
|
# Unity - A Test Framework for C
|
|
# ThrowTheSwitch.org
|
|
# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams
|
|
# SPDX-License-Identifier: MIT
|
|
# =========================================================================
|
|
|
|
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
|