Sha256: 330b40e6ec078a3b26e9ef87860ba16f94403241e9dfa72434e7bf0a7a80419c
Contents?: true
Size: 543 Bytes
Versions: 33
Compression:
Stored size: 543 Bytes
Contents
module Misc def self.load_yaml(yaml) case yaml when IO, StringIO if YAML.respond_to?(:unsafe_load) YAML.unsafe_load(yaml) else YAML.load(yaml) end when (defined?(Path) && Path) yaml.open do |io| load_yaml(io) end when String if Misc.is_filename?(yaml) File.open(yaml) do |io| load_yaml(io) end else load_yaml(StringIO.new(yaml)) end else raise "Unkown YAML object: #{Misc.fingerprint yaml}" end end end
Version data entries
33 entries across 33 versions & 1 rubygems