module Versed::Reader

Public Class Methods

read(path) click to toggle source

Reads YAML from a file @param path [String] The path to the file @return [Hash] The parsed YAML file

# File lib/versed/reader.rb, line 9
def self.read(path)
  begin
    return YAML.load(IO.read(path))
  rescue YAML::Error => e
    puts "Encountered an error reading YAML from #{path}"
    puts e.message
    exit 1
  rescue StandardError => e
    puts e.message
    exit 1
  end
end