YAML Mimics Makefiles
YMM is one of the first examples of YAAPL: YAML as a Programming Language
YMM uses standard YAML files with a few special conventions to function as a task runner. In addition to simply creating lists and dictionaries, YMM can execute commands (and thus return values) based on the 'control character' at the beginning of a line.
$ pip install ymm $ ymm --version
YMM files have a top-level dictionary, whose keys are called "actions."
Type $ ymm <action>
to execute and return the results of that action, which can be a dictionary or a list.
Dictionaries will set the results of that action to the key, which can be accessed as a {variable}
in future actions.
There are also two special actions:
init
which is always executed before any other actiondefault
which is executed if no action is specified
Variables cascade via the following rules
- Built-in Actions (see
src/ymm/builtin.yml
) - Environment variables (which are loaded at runtime)
- init
- prior actions
- current action
- '.' run this YMM action
- '$' run this in the shell
- '+' execute this Python string (use '"""' for docstrings)
- '^' pipe the prior result into this shell command
- '~' pipe the prior result into this jquery path
Because I love YAML, and miss rake
.
I tried PyPyr, which is brilliant but painfully verbose.
I was going to write a preprocessor, then realized it was simpler to just execute the commands myself.