Akd v0.2.1 Akd.Generator.Task View Source
This module handles the generation of a custom task which use Akd.Task
.
This can either directly be called, or called through a mix task,
mix akd.gen.task
.
This class uses EEx and Mix.Generator to fetch file contents from an eex template and populate the interpolated fields, writing it to the speficied file.
Usage:
The following call creates a file run.ex
at location path/to/file/run.ex
Akd.Generator.Task.gen(["run.ex"], path: "path/to/file")
Link to this section Summary
Link to this section Functions
This is the callback implementation for gen/2
.
This function takes in a list of inputs and a list of options and generates
a module that uses Akd.Task
at the specified path with the specified name.
The first element of the input is expected to be the name of the file.
The path can be sent to the opts
.
If no path is sent, it defaults to lib/
Examples:
Akd.Generator.Hook.gen(["task.ex"], [path: "some/path"])