module Bootsnap::CompileCache::YAML::Psych4::Patch

Public Instance Methods

load_file(path, *args) click to toggle source
Calls superclass method
# File lib/bootsnap/compile_cache/yaml.rb, line 222
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::Psych4::SafeLoad,
    kwargs,
  )
end
unsafe_load_file(path, *args) click to toggle source
Calls superclass method
# File lib/bootsnap/compile_cache/yaml.rb, line 242
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::Psych4::UnsafeLoad,
    kwargs,
  )
end