module Kernel
def load(path, wrap = false)
def load(path, wrap = false) if resolved = Bootsnap::LoadPathCache.load_path_cache.find(path) load_without_cache(resolved, wrap) else # load also allows relative paths from pwd even when not in $: relative = File.expand_path(path) if File.exist?(File.expand_path(path)) return load_without_cache(relative, wrap) end raise Bootsnap::LoadPathCache::CoreExt.make_load_error(path) end rescue Bootsnap::LoadPathCache::ReturnFalse return false rescue Bootsnap::LoadPathCache::FallbackScan load_without_cache(path, wrap) end
def require(path)
def require(path) if resolved = Bootsnap::LoadPathCache.load_path_cache.find(path) require_without_cache(resolved) else raise Bootsnap::LoadPathCache::CoreExt.make_load_error(path) end rescue Bootsnap::LoadPathCache::ReturnFalse return false rescue Bootsnap::LoadPathCache::FallbackScan require_without_cache(path) end