module Bootsnap::LoadPathCache::CoreExt::ActiveSupport

def self.with_bootsnap_fallback(error)

def self.with_bootsnap_fallback(error)
  yield
rescue error => e
  # NoMethodError is a NameError, but we only want to handle actual
  # NameError instances.
  raise unless e.class == error
  without_bootsnap_cache { yield }
end

def self.without_bootsnap_cache

def self.without_bootsnap_cache
  prev = Thread.current[:without_bootsnap_cache] || false
  Thread.current[:without_bootsnap_cache] = true
  yield
ensure
  Thread.current[:without_bootsnap_cache] = prev
end