Skip to content

Repository files navigation

Spell

A simple and declarative task runner for project automation.

(I wanted an excuse to try out Ruby)

Spell and Nox

Spell owns task names, task dependencies, workflow, and command execution. Nox owns source files, toolchains, compilers, linking, build targets, and artifacts. Use Spell to select a project action and Nox to perform its build or other Nox-managed work.

Installation

Spell's development environment is provided by Nix:

nix develop
nox task setup
nox task test
nox task build
nox install

The flake supplies Ruby, Bundler, RuboCop, and Nox; it does not use the host Ruby installation. To use the command in a project, make the executable available on your PATH or install the gem built with nox task build.

Basic usage

Save the following as spell in a project directory:

project("example") {
    task("build") {
        description "Build the project"
        command "nox build"
    }

    task("test") {
        description "Run tests"
        depends "build"
        command "nox test"
    }

    task("format") {
        description "Format source files"
        command "lapdance ."
    }

    task("check") {
        description "Run project checks"
        depends "format"
        depends "test"
        command "nox check"
    }
}

Spell loads spell first and also accepts spell.rb. Both files contain Ruby using Spell's small DSL. Braces make project and task nesting visible; task names and commands are strings, dependencies are explicit, and ordinary tasks need only a few declarations. An optional description appears in the task listing.

Development

From this repository, enter the reproducible development shell and use Nox's task automation commands:

nix develop
nox task setup
nox task test
nox task format
nox task check
nox task build
nox task clean

The Nox noxfile defines these development tasks. build packages the Ruby gem; Spell itself has no compiler or language specific build graph. Tests use Ruby's standard library and Minitest.

Current Nox requires at least one target in nox.build before it can run noxfile tasks, and since it does not have a Ruby packaging target, Spell's nox.build simply declares a minimal Gradle help task required by that parser; the project workflow does not invoke it. Run the documented nox task commands for Spell development, with gem packaging handled by RubyGems.

About

A simple and declarative task runner for project automation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages