Packages
persist_config
0.4.43
0.4.56
0.4.55
0.4.54
0.4.53
0.4.52
0.4.51
0.4.50
0.4.49
0.4.48
0.4.47
0.4.46
0.4.45
0.4.44
0.4.43
0.4.42
0.4.41
0.4.40
0.4.39
0.4.38
0.4.37
0.4.36
0.4.35
0.4.34
0.4.33
0.4.32
0.4.31
0.4.30
0.4.29
0.4.28
0.4.27
0.4.26
0.4.25
0.4.24
0.4.23
0.4.22
0.4.21
0.4.20
0.4.19
0.4.18
0.4.17
0.4.16
0.4.15
0.4.14
0.4.13
0.4.12
0.4.11
0.4.10
0.4.9
0.4.8
0.4.7
0.4.6
0.4.5
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.3.3
0.3.2
0.3.1
0.3.0
0.2.14
0.2.13
0.2.12
0.2.11
0.2.10
0.2.9
0.2.8
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.10
0.1.9
0.1.8
0.1.7
0.1.6
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
Persists configurations from given files at compile time.
Current section
Files
Jump to
Current section
Files
lib/runtime_check.exs
defmodule RuntimeCheck do
# When running your application locally with iex -S mix or mix run,
# `config/config.exs` is evaluated every time the application starts.
use PersistConfig
@dummy_test2 get_env(:dummy_test2)
@speed_of_light :speed_of_light_in_meters_per_second
@persist_config_all_env get_all_env(@app)
# Confirms that `config/config.exs` is persisted at runtime.
# To run in iex: mix run -e 'RuntimeCheck.check_env'
def check_env do
# Persisted at compile-time...
IO.inspect(@dummy_test2, label: "@dummy_test2")
# Persisted at runtime...
get_env(@speed_of_light) |> IO.inspect(label: @speed_of_light)
get_env(:pi) |> IO.inspect(label: :pi)
# Not persisted at runtime...
get_env(:dummy_test2) |> IO.inspect(label: :dummy_test2)
end
# To run in iex: mix run -e 'RuntimeCheck.check_all_env'
def check_all_env do
get_all_env(@app) |> IO.inspect(label: :persist_config_all_env)
IO.inspect(@persist_config_all_env, label: "@persist_config_all_env")
end
end