module Bootsnap::LoadPathCache

def setup(cache_path:, development_mode:, ignore_directories:, readonly: false)

def setup(cache_path:, development_mode:, ignore_directories:, readonly: false)
  unless supported?
    warn("[bootsnap/setup] Load path caching is not supported on this implementation of Ruby") if $VERBOSE
    return
  end
  store = Store.new(cache_path, readonly: readonly)
  @loaded_features_index = LoadedFeaturesIndex.new
  @load_path_cache = Cache.new(store, $LOAD_PATH, development_mode: development_mode)
  PathScanner.ignored_directories = ignore_directories if ignore_directories
  @enabled = true
  require_relative("load_path_cache/core_ext/kernel_require")
  require_relative("load_path_cache/core_ext/loaded_features")
end

def supported?

def supported?
  RUBY_ENGINE == "ruby" &&
    RUBY_PLATFORM =~ /darwin|linux|bsd|mswin|mingw|cygwin/
end

def unload!

def unload!
  @enabled = false
  @loaded_features_index = nil
  @realpath_cache = nil
  @load_path_cache = nil
  ChangeObserver.unregister($LOAD_PATH)
end