module Bootsnap::CompileCache::YAML::Psych3::Patch

def load_file(path, *args)

def load_file(path, *args)
  return super unless CompileCache::YAML.supported_internal_encoding?
  return super if args.size > 1
  if (kwargs = args.first)
    return super unless kwargs.is_a?(Hash)
    return super unless (kwargs.keys - CompileCache::YAML.supported_options).empty?
  end
  CompileCache::Native.fetch(
    CompileCache::YAML.cache_dir,
    File.realpath(path),
    CompileCache::YAML::Psych3,
    kwargs,
  )
end

def unsafe_load_file(path, *args)

def unsafe_load_file(path, *args)
  return super unless CompileCache::YAML.supported_internal_encoding?
  return super if args.size > 1
  if (kwargs = args.first)
    return super unless kwargs.is_a?(Hash)
    return super unless (kwargs.keys - CompileCache::YAML.supported_options).empty?
  end
  CompileCache::Native.fetch(
    CompileCache::YAML.cache_dir,
    File.realpath(path),
    CompileCache::YAML::Psych3,
    kwargs,
  )
end