require IEx; IEx.pry()
-
Exit
prysession inside anIExsessionrespawn
-
pryin test suiteiex -S mix test --trace
-
Official docs
-
Debugging in views, tests, etc
| defp set_other_secret(_) do | |
| original_config = Application.get_env(:my_app, MyApp.Example) | |
| hash = generate_fake_hash() | |
| updated_config = Keyword.put(original_config, :other_secret, hash) | |
| Application.put_env(:my_app, MyApp.Example, updated_config) | |
| on_exit(fn -> | |
| Application.put_env(:my_app, MyApp.Example, original_config) | |
| end) |
| [other_secret: "original_secret"] |
| Application.put_env(:my_app, MyApp.Example, other_secret: original_secret) |
| defp set_other_secret(_) do | |
| original_secret = Application.get_env(:my_app, MyApp.Example)[:other_secret] | |
| hash = fake_hash() | |
| Application.put_env(:my_app, MyApp.Example, other_secret: hash) | |
| on_exit(fn -> | |
| Application.put_env(:my_app, MyApp.Example, other_secret: original_secret) | |
| end) | |
| {:ok, other_secret: hash} |
| [other_secret: "original_secret"] |
| @config Application.compile_env(:my_app, MyApp.Example) | |
| @api_key @config[:api_key] | |
| @base_url @config[:base_url] |
| config :my_app, MyApp.Example, | |
| api_key: env!("EXAMPLE_API_KEY", :string, ""), | |
| hook_secret: env!("EXAMPLE_HOOK_SECRET", :string, ""), | |
| verification_secret: env!("EXAMPLE_VERIFICATION_SECRET", :string, ""), | |
| base_url: "https://myapp.api.example.com" |
require IEx; IEx.pry()
Exit pry session inside an IEx session
respawnpry in test suite
iex -S mix test --traceOfficial docs
Debugging in views, tests, etc
| Mapping.create_destination() |
| docker-compose web mix run priv/repo/seeds.exs |