aboutsummaryrefslogtreecommitdiff
path: root/lib/ejabberd/config_util.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ejabberd/config_util.ex')
-rw-r--r--lib/ejabberd/config_util.ex18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/ejabberd/config_util.ex b/lib/ejabberd/config_util.ex
new file mode 100644
index 000000000..6592104a2
--- /dev/null
+++ b/lib/ejabberd/config_util.ex
@@ -0,0 +1,18 @@
+defmodule Ejabberd.ConfigUtil do
+ @moduledoc """
+ Module containing utility functions for
+ the config file.
+ """
+
+ @doc """
+ Returns true when the config file is based on elixir.
+ """
+ @spec is_elixir_config(list) :: boolean
+ def is_elixir_config(filename) when is_list(filename) do
+ is_elixir_config(to_string(filename))
+ end
+
+ def is_elixir_config(filename) do
+ String.ends_with?(filename, "exs")
+ end
+end