Cascade (Cascade v0.3.0)
View SourceGenerate code from templates.
Summary
Functions
@spec generate( name :: atom(), root_path :: String.t(), args_or_opts :: keyword() | [String.t()], opts :: keyword() ) :: {:error, String.t()} | :ok
Generate the code associated to the given template name.
root_pathis expected to be the root directory under which the template will be generated.args_or_optscan be an arbitrary keyword list with the template options or a list of command line arguments passed to themix cascadetask. In the latter case the arguments will be validated using the template'sCascade.Template.args_schema/0.
Options
:force- if set existing files are overwritten without asking, defaults tofalse.
@spec templates() :: keyword()
Returns all available templates.
All modules implementing the Cascade.Template behaviour will be returned.