Mix.Bonny (bonny v1.5.0)

Copy Markdown View Source

Mix task helpers

Summary

Functions

Get the OTP app name

Appends append_content to target. If target does not exist, a new file with new_file_content is created.

Capitalizes the string if it does not begin with a capital letter.

Get the OTP app name with dashes

Prepends append_content to target. If target does not exist, a new file with new_file_content is created.

Render text to a file.

Functions

add_or_create_with(mode, target, content_to_add, new_file_content, check)

@spec add_or_create_with(:append | :prepend, binary(), binary(), binary(), binary()) ::
  term()

app_dir_name()

@spec app_dir_name() :: binary()

app_name()

@spec app_name() :: binary()

Get the OTP app name

append_or_create_with(target, content_to_append, new_file_content, check)

@spec append_or_create_with(binary(), binary(), binary(), binary()) :: term()

Appends append_content to target. If target does not exist, a new file with new_file_content is created.

copy(source, target)

@spec copy(binary(), binary()) :: term()

ensure_module_name(string)

Capitalizes the string if it does not begin with a capital letter.

error(message)

hyphenated_app_name()

@spec hyphenated_app_name() :: binary()

Get the OTP app name with dashes

no_umbrella!()

@spec no_umbrella!() :: any()

parse_args(args, defaults, cli_opts \\ [])

@spec parse_args([binary()], Keyword.t(), Keyword.t()) ::
  {Keyword.t(), [binary()], [{binary(), nil | binary()}]}

Parse CLI input

prepend_or_create_with(target, content_to_prepend, new_file_content, check)

@spec prepend_or_create_with(binary(), binary(), binary(), binary()) :: term()

Prepends append_content to target. If target does not exist, a new file with new_file_content is created.

render(source, target)

@spec render(binary(), binary()) :: term()

Render text to a file.

Special handling for the path "-" will render to STDOUT

render_template(source, target, bindings)

@spec render_template(binary(), binary(), keyword()) :: term()

template(name)

@spec template(binary()) :: binary()