View Source Mix.Pow (Pow v1.0.39)

Utilities module for mix tasks.

Summary

Functions

Fetches the context base module for the app.

Fetches the library path for the context app.

Raises an exception if application doesn't have Ecto as dependency.

Raises an exception if application doesn't have Phoenix as dependency.

Injects files with inline content

Raises an exception if the project is an umbrella app.

Parses argument options into a map.

Parses arguments into schema name and schema plural.

Functions

app_base(app)

@spec app_base(atom()) :: atom()

Fetches the context base module for the app.

context_lib_path(ctx_app, rel_path)

@spec context_lib_path(atom(), Path.t()) :: Path.t()

Fetches the library path for the context app.

ensure_ecto!(task, args)

@spec ensure_ecto!(binary(), OptionParser.argv()) :: :ok

Raises an exception if application doesn't have Ecto as dependency.

ensure_phoenix!(task, args)

@spec ensure_phoenix!(binary(), OptionParser.argv()) :: :ok

Raises an exception if application doesn't have Phoenix as dependency.

inject_files(file_injections)

@spec inject_files([map()]) :: :ok | :error

Injects files with inline content

no_umbrella!(task)

@spec no_umbrella!(binary()) :: :ok

Raises an exception if the project is an umbrella app.

parse_options(args, switches, default_opts)

Parses argument options into a map.

schema_options_from_args(arg1 \\ [])

@spec schema_options_from_args([binary()]) :: map()

Parses arguments into schema name and schema plural.