module

Croupier

Every exception croupier raises on purpose, in one hierarchy, so callers can rescue by type (rescue Croupier::Error).

Constants

ID_HASH_LENGTH = 12

Length of the SHA1 prefix used for generated task ids (tasks with outputs and no explicit id): long enough to avoid realistic collisions, short enough to stay readable in logs

Log = ::Log.for("croupier")

Log with "croupier" as the source

TaskManager = TaskManagerType.new

The global task manager (singleton)

VERSION = {{ (`shards version /tmp/tmp.HLdGHD/src/src`).chomp.stringify }}

Class methods

collect_tree(dir : String, entries : Array(String)) : Nil

Append every path under dir (files and subdirectories, dotfiles included, dir itself excluded) to entries. The tree is walked rather than globbed, so metacharacters in a name (a directory called "assets[2]") are taken literally. A symlinked dir is followed; symlinked directories inside the tree are not descended into. Directory digests are built from this list, so changing its shape re-stales every directory input (specs pin it).

Source
hash_file(path : String) : String

SHA1 of a file's contents, read in chunks so large files are never held in memory whole. Raises if the file can't be opened.

Source

Nested types