module Bootsnap::CompileCache::YAML
def self.install!(cache_dir)
def self.install!(cache_dir) 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( cache_dir, path.to_s, Bootsnap::CompileCache::YAML ) end end