App-Dothe
view release on metacpan or search on metacpan
README.mkdn view on Meta::CPAN
# NAME
App::Dothe - YAML-based task runner
# VERSION
version 0.0.1
# DESCRIPTION
Task runner heavily inspired by Task ([https://github.com/go-task/task](https://github.com/go-task/task)).
Basically, I wanted `Task`, but with a `foreach` construct.
See `perldoc App::DoThe` for the syntax of the `Dothe.yml` file.
# DOTHE SYNTAX
The configuration file is in YAML. It follows, by and large, the
format used by Task.
By default, \`dothe\` looks for the file \`Dothe.yml\`.
Where entries can be templates, they are evaluated via [Text::Template](https://metacpan.org/pod/Text::Template).
Basically, that means that in a template all that is surrounded by double curley braces
is evaluated as Perl code. Those code snippets are evaluated within the
`App::Dothe::Sandbox` namespace, and have all the `vars` variables
accessible to them.
## `code` section
Takes an array. Each item will be eval'ed in the namespace
used by the template code.
For example, to have access to [Path::Tiny](https://metacpan.org/pod/Path::Tiny)'s
`path`:
```perl
code:
- use Path::Tiny;
tasks:
import-all:
sources:
- /home/yanick/work/blog_entries/**/entry
foreach: sources
cmds:
- task: import
vars: { dir: '{{ path($item)->parent }}' }
```
## `vars` section
Takes a hash of variable names and values. Those are variables that will be accessible to all
tasks.
E.g.,
```
vars:
entries_file: ./content/_shared/entries.md
blog_entries_root: /home/yanick/work/blog_entries
```
## `tasks` section
Takes a hash of task names and their definitions.
E.g.,
```
tasks:
something:
sources: [ ./src/foo.source ]
generates: [ ./dest/foo.dest ]
foreach: sources
cmds:
- ./tools/process_entry.pl {{$item}}
```
### `task`
( run in 0.580 second using v1.01-cache-2.11-cpan-6aa56a78535 )