ExEnv (ExEnv v0.3.5)

View Source

Tool provides support of Elixir terms in system env variables. For security reasons only literals/terms are allowed in configs (no functions, macros, modules etc).

Summary

Functions

Works as Mix.Config.Config macro. Gets single argument, name of otp_app (atom). Infers config system variable name from otp_app argument: capitalize name and adds _CONFIG postfix.

Works as &ExEnv.config/1 macro, but second argument is explicit system variable name.

Functions

config(otp_app_ast)

(macro)

Works as Mix.Config.Config macro. Gets single argument, name of otp_app (atom). Infers config system variable name from otp_app argument: capitalize name and adds _CONFIG postfix.

Example

  # reads, validates and evaluates BEST_APP_CONFIG system variable
  ExEnv.config(:best_app)

config(otp_app_ast, os_var_name_ast)

(macro)

Works as &ExEnv.config/1 macro, but second argument is explicit system variable name.

Example

  # reads, validates and evaluates MY_FAVORITE_APP_DATA system variable
  ExEnv.config(:best_app, "MY_FAVORITE_APP_DATA")