Blame erlang-cuttlefish-0002-No-rebar_mustache-available.patch

a331d75
From: Peter Lemenkov <lemenkov@gmail.com>
a331d75
Date: Mon, 7 Mar 2016 16:26:49 +0300
a331d75
Subject: [PATCH] No rebar_mustache available
a331d75
a331d75
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
a331d75
a331d75
diff --git a/src/cuttlefish_unit.erl b/src/cuttlefish_unit.erl
a331d75
index 9c0ee40..3db7551 100644
a331d75
--- a/src/cuttlefish_unit.erl
a331d75
+++ b/src/cuttlefish_unit.erl
a331d75
@@ -25,15 +25,7 @@ render_template(FileName, Context) ->
a331d75
     Str1 = re:replace(Str0, "\"", "\\\\\"", ReOpts),
a331d75
 
a331d75
     %% the mustache module is only available in the context of a rebar run.
a331d75
-    case {code:ensure_loaded(mustache), code:ensure_loaded(rebar_mustache)} of
a331d75
-        {{module, mustache}, _} ->
a331d75
-            mustache:render(Str1, dict:from_list(Context));
a331d75
-        {_, {module, rebar_mustache}} ->
a331d75
-            rebar_mustache:render(Str1, dict:from_list(Context));
a331d75
-        _ ->
a331d75
-            io:format("mustache and/or rebar_mustache module not loaded. "
a331d75
-                      "This test can only be run in a rebar context.~n")
a331d75
-    end.
a331d75
+    mustache:render(Str1, dict:from_list(Context)).
a331d75
 
a331d75
 -spec generate_config(atom(), [string()]|string(), list()) -> list().
a331d75
 generate_config(strings, SchemaStrings, Conf) ->