module Croupier

Overview

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

Defined in:

croupier.cr
croupier/errors.cr
croupier/graph.cr
croupier/hash_state.cr
croupier/kv_store.cr
croupier/linux_watcher.cr
croupier/run_plan.cr
croupier/runner.cr
croupier/task_registry.cr
croupier/watcher.cr
croupier/worker_pool.cr
task.cr

Constant Summary

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 /home/runner/work/croupier/croupier/src`).chomp.stringify }}

Class Method Summary

Class Method Detail

def self.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).


[View source]
def self.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.


[View source]