View Source Mix.Bonny (bonny v1.4.0)

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

Link to this function

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

View Source
@spec add_or_create_with(:append | :prepend, binary(), binary(), binary(), binary()) ::
  term()
@spec app_dir_name() :: binary()
@spec app_name() :: binary()

Get the OTP app name

Link to this function

append_or_create_with(target, content_to_append, new_file_content, check)

View Source
@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.

@spec copy(binary(), binary()) :: term()
Link to this function

ensure_module_name(string)

View Source

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

@spec hyphenated_app_name() :: binary()

Get the OTP app name with dashes

@spec no_umbrella!() :: any()
Link to this function

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

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

Parse CLI input

Link to this function

prepend_or_create_with(target, content_to_prepend, new_file_content, check)

View Source
@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.

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

Render text to a file.

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

Link to this function

render_template(source, target, bindings)

View Source
@spec render_template(binary(), binary(), keyword()) :: term()
@spec template(binary()) :: binary()