module

Sheety::DataDir

Manages the Sheety data directory

Class methods

ensure

Ensure the data directory exists

Source
ensure_dependencies

Ensure dependencies are installed (runs shards install if lib/ doesn't exist). Raises SetupError on failure: proceeding without lib/ only produces a confusing missing-require error from the compiler later.

Source
ensure_shard_yml

Ensure shard.yml exists in data directory

Source
extract_embedded_files

Extract embedded source files to data directory (only works in sheety CLI)

Source
file_hash(filename : String) : String

Calculate the SHA256 hash of a file's content, folded together with the sheety binary version, for content-based caching of generated binaries. Shared by the CLI launch path and the in-process rebuilder, which previously carried identical private copies.

Source
path

Get the Sheety data directory path

Source
prune_tmp(keep : Int32 = 5) : Nil

Remove stale generated build artifacts from tmp/: content-hash-named binaries and generated sources, one set per spreadsheet revision. Every edit (and every sheety upgrade) creates a new set, so without pruning they accumulate forever. Keeps the newest keep hash groups; never touches UUID-named state files (.kv, .croupier, intermediate YAMLs).

Source
sheety_version

A short, stable string identifying the current sheety binary (its mtime as unix seconds). Used to fold the sheety version into the generated- binary cache key, so rebuilding sheety (bug fixes, generator changes) invalidates stale cached binaries rather than silently reusing them. Returns "unknown" when sheety isn't on PATH (e.g. a generated or static binary running on a host without sheety installed) so callers hashing this never raise.

Source