diff --git a/lib/avrora/client.ex b/lib/avrora/client.ex index ca89b7f7..39df17e4 100644 --- a/lib/avrora/client.ex +++ b/lib/avrora/client.ex @@ -103,18 +103,6 @@ defmodule Avrora.Client do @opts unquote(opts) @otp_app Keyword.get(@opts, :otp_app) - def schemas_path do - path = get(@opts, :schemas_path, "./priv/schemas") - - if is_nil(@otp_app), do: Path.expand(path), else: Application.app_dir(@otp_app, path) - end - - def registry_ssl_cacert_path do - path = get(@opts, :registry_ssl_cacert_path, nil) - - if is_nil(path), do: nil, else: Path.expand(path) - end - def registry_url, do: get(@opts, :registry_url, nil) def registry_auth, do: get(@opts, :registry_auth, nil) def registry_user_agent, do: get(@opts, :registry_user_agent, "Avrora/#{version()} Elixir") @@ -134,10 +122,14 @@ defmodule Avrora.Client do if is_nil(@otp_app) do def self, do: __MODULE__ + def schemas_path, do: Path.expand(get(@opts, :schemas_path, "./priv/schemas")) + def registry_ssl_cacert_path, do: nil defp get(opts, key, default), do: Keyword.get(opts, key, default) else def self, do: get(@opts, :config, __MODULE__) + def schemas_path, do: Application.app_dir(@otp_app, get(@opts, :schemas_path, "./priv/schemas")) + def registry_ssl_cacert_path, do: Path.expand(get(@opts, :registry_ssl_cacert_path, nil)) defp get(opts, key, default) do app_opts = Application.get_env(@otp_app, unquote(:"Elixir.#{module}"), [])