1# ========================================== 2# Unity Project - A Test Framework for C 3# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 4# [Released under MIT License. Please refer to license.txt for details] 5# ========================================== 6 7require 'yaml' 8 9module YamlHelper 10 def self.load(body) 11 if YAML.respond_to?(:unsafe_load) 12 YAML.unsafe_load(body) 13 else 14 YAML.load(body) 15 end 16 end 17 18 def self.load_file(file) 19 body = File.read(file) 20 self.load(body) 21 end 22end 23