Sheety::DataDir
Manages the Sheety data directory
Class methods
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.
Extract embedded source files to data directory (only works in sheety CLI)
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.
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).
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.