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

Public Instance Methods

load_file(path, *args) click to toggle source
Calls superclass method
# File lib/bootsnap/compile_cache/yaml.rb, line 299
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

  begin
    CompileCache::Native.fetch(
      CompileCache::YAML.cache_dir,
      File.realpath(path),
      CompileCache::YAML::Psych3,
      kwargs,
    )
  rescue Errno::EACCES
    CompileCache.permission_error(path)
  end
end
unsafe_load_file(path, *args) click to toggle source
Calls superclass method
# File lib/bootsnap/compile_cache/yaml.rb, line 323
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

  begin
    CompileCache::Native.fetch(
      CompileCache::YAML.cache_dir,
      File.realpath(path),
      CompileCache::YAML::Psych3,
      kwargs,
    )
  rescue Errno::EACCES
    CompileCache.permission_error(path)
  end
end