Module: Bootsnap::CompileCache::YAML::Patch

Defined in:
lib/bootsnap/compile_cache/yaml.rb

Instance Method Summary collapse

Instance Method Details

#load_file(path, *args) ⇒ Object



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/bootsnap/compile_cache/yaml.rb', line 89

def load_file(path, *args)
  return super if args.size > 1
  if kwargs = args.first
    return super unless kwargs.is_a?(Hash)
    return super unless (kwargs.keys - ::Bootsnap::CompileCache::YAML.supported_options).empty?
  end

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