module Rubellite::VFS

Overview

In-memory Virtual Filesystem (VFS) for mounting Ruby scripts, packages, and gems directly into CRuby's require and load pipeline with zero disk I/O.

Defined in:

rubellite/vfs.cr

Class Method Summary

Class Method Detail

def self.files : Array(String) #

Returns a list of all currently mounted virtual paths


[View source]
def self.hook_ruby! : Nil #

Automatically installs the VFS hooks in CRuby Kernel#require and Kernel#load


[View source]
def self.mount(path : String, code : String) : Nil #

Mounts an in-memory Ruby script under the given virtual path


[View source]
def self.mount_dir(prefix : String, files : Hash(String, String)) : Nil #

Mounts a dictionary of files under a directory prefix


[View source]
def self.mount_file(path : String, code : String) : Nil #

Alias for mount


[View source]
def self.mount_gem(name : String, files : Hash(String, String)) : Nil #

Mounts a virtual gem bundle with a standard structure: lib/gem_name.rb and optional sub-files


[View source]
def self.mounted?(path : String) : Bool #

Checks if a virtual path is mounted


[View source]
def self.normalize_path(path : String) : String #

Normalizes a path by replacing backslashes and trimming leading dots or slashes


[View source]
def self.read(path : String) : String | Nil #

Reads the content of a mounted virtual file


[View source]
def self.reset! : Nil #

Clears all mounted virtual files and resets loaded features in Ruby


[View source]
def self.unmount(path : String) : Bool #

Unmounts a virtual file from the VFS


[View source]