From 803270fc6b8ed3ba718f7e231b149caef70aa1ae Mon Sep 17 00:00:00 2001 From: gabrielgatu Date: Thu, 8 Sep 2016 11:34:42 +0200 Subject: Support for Elixir configuration file #1208 Contribution for Google Summer of code 2016 by Gabriel Gatu --- lib/ejabberd/config_util.ex | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/ejabberd/config_util.ex (limited to 'lib/ejabberd/config_util.ex') 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 -- cgit v1.2.3