Commit 3b95a37
committed
Make HTTPoison adapter compile only when HTTPoison is loaded
The adapter module references %HTTPoison.Response{} and %HTTPoison.Error{}
structs at compile time, so it could not be compiled in a consumer
project that drops httpoison from its deps — even though mix.exs already
declares httpoison as optional: true.
Wrap the defmodule block in Code.ensure_loaded?(HTTPoison) so the module
is only defined when HTTPoison is actually available. Funkspector's own
test matrix still pulls HTTPoison transitively (optional deps are
included in the package's own build), so test.adapters keeps exercising
both adapters.1 parent 1ab6710 commit 3b95a37
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
6 | 15 | | |
7 | 16 | | |
8 | 17 | | |
| |||
101 | 110 | | |
102 | 111 | | |
103 | 112 | | |
| 113 | + | |
0 commit comments