module Bootsnap::CompileCache::YAML

def self.install!

def self.install!
  require 'yaml'
  require 'msgpack'
  # MessagePack serializes symbols as strings by default.
  # We want them to roundtrip cleanly, so we use a custom factory.
  # see: https://github.com/msgpack/msgpack-ruby/pull/122
  factory = MessagePack::Factory.new
  factory.register_type(0x00, Symbol)
  Bootsnap::CompileCache::YAML.msgpack_factory = factory
  klass = class << ::YAML; self; end
  klass.send(:define_method, :load_file) do |path|
    Bootsnap::CompileCache::Native.fetch(
      path.to_s,
      Bootsnap::CompileCache::YAML
    )
  end
end