module Bootsnap::CompileCache::YAML::Psych3

Public Instance Methods

input_to_output(data, _path, kwargs) click to toggle source
# File lib/bootsnap/compile_cache/yaml.rb, line 339
def input_to_output(data, _path, kwargs)
  ::YAML.load(data, **(kwargs || {}))
end
input_to_storage(contents, _) click to toggle source
# File lib/bootsnap/compile_cache/yaml.rb, line 318
def input_to_storage(contents, _)
  obj = ::YAML.load(contents)
  packer = CompileCache::YAML.msgpack_factory.packer
  packer.pack(false) # not safe loaded
  begin
    packer.pack(obj)
  rescue NoMethodError, RangeError
    return UNCOMPILABLE # The object included things that we can't serialize
  end
  packer.to_s
end
storage_to_output(data, kwargs) click to toggle source
# File lib/bootsnap/compile_cache/yaml.rb, line 330
def storage_to_output(data, kwargs)
  unpacker = CompileCache::YAML.msgpack_factory.unpacker(
    CompileCache::YAML.msgpack_unpacker_options(kwargs),
  )
  unpacker.feed(data)
  _safe_loaded = unpacker.unpack
  unpacker.unpack
end