class Bakelite::FS::Registry

Overview

Concrete registry implementation managing volumes and union routing

Defined in:

bakelite/fs.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

Instance Method Detail

def [](path : String) : Item #

def []?(path : String) : Item | Nil #

def each_file(&block : Item -> ) : Nil #

Iterates over all visible unique items in union priority order.


def extract_all(destination_dir : Path | String, overwrite : Bool = true) : Int32 #

Extracts all visible union files into destination_dir on disk.


def extract_folder(prefix : String, destination_dir : Path | String, overwrite : Bool = true) : Int32 #

Extracts all visible files matching virtual prefix into destination_dir.


def extract_volume(name : Symbol | String, destination_dir : Path | String, overwrite : Bool = true) : Int32 #

Extracts all files from a specific volume into destination_dir on disk.


def extract_volume_folder(name : Symbol | String, prefix : String, destination_dir : Path | String, overwrite : Bool = true) : Int32 #

Extracts a specific subfolder from a specific volume into destination_dir on disk.


def files : Array(String) #

Returns an array of all virtual paths visible through the union router.


def get(path : String) : Item #

Queries a path, raising KeyError if not found in any mounted volume.


def get?(path : String) : Item | Nil #

Queries a path across all mounted volumes using union routing. Volumes with higher priority shadow lower-priority volumes.


def glob(pattern : String, &block : Item -> ) : Nil #

Matches all visible files using glob patterns.


def glob(pattern : String) : Array(Item) #

def has_file?(path : String) : Bool #

def mount(volume : Volume) : Volume #

Mounts a volume into this registry. Re-sorts volumes by priority descending.


def mount_file(archive_path : String | Path, volume_name : Symbol | String | Nil = nil, mount : String | Nil = nil, priority : Int32 = 0) : Volume | Nil #

Mounts an external .bkl archive file or executable overlay


def mount_self!(priority : Int32 = 0) : Bool #

Automatically inspects Process.executable_path for appended Bakelite volumes


def open(path : String) : IO #

def open(path : String, &block : IO -> T) : T forall T #

def root_volume : Volume #

Default root volume for direct bakes without explicit volume declaration.


def unmount(volume_name : Symbol | String) : Bool #

Unmounts a volume by its identifier. Cannot unmount root volume.


def volume(name : Symbol | String) : Volume #

Retrieves a volume by name. Raises KeyError if missing.


def volume?(name : Symbol | String) : Volume | Nil #

Retrieves a volume by name, returning nil if missing.


def volumes : Array(Volume) #