]> granicus.if.org Git - ejabberd/commitdiff
Convert code to use Fast YAML
authorMickael Remond <mremond@process-one.net>
Wed, 3 Feb 2016 10:30:48 +0000 (11:30 +0100)
committerMickael Remond <mremond@process-one.net>
Wed, 3 Feb 2016 10:30:48 +0000 (11:30 +0100)
src/ejabberd_app.erl
src/ejabberd_config.erl
src/ext_mod.erl

index ae74b5963d10785708770e518f67e151b15d11cf..5589c31b9b0e63b37822954d292fceb4b6c86119 100644 (file)
@@ -252,7 +252,7 @@ start_apps() ->
     crypto:start(),
     ejabberd:start_app(sasl),
     ejabberd:start_app(ssl),
-    ejabberd:start_app(p1_yaml),
+    ejabberd:start_app(fast_yaml),
     ejabberd:start_app(p1_tls),
     ejabberd:start_app(p1_xml),
     ejabberd:start_app(stringprep),
index 8d2d19975b327e445604af5d0c4b3dca4024ec29..1f2eaa142c61e1e7cf39adf27b4ba6d48efd40fb 100644 (file)
@@ -162,7 +162,7 @@ convert_to_yaml(File, Output) ->
                          fun({Host, Opts1}) ->
                                  {host_config, [{Host, Opts1}]}
                          end, HOpts),
-    Data = p1_yaml:encode(lists:reverse(NewOpts)),
+    Data = fast_yaml:encode(lists:reverse(NewOpts)),
     case Output of
         stdout ->
             io:format("~s~n", [Data]);
@@ -226,14 +226,14 @@ get_plain_terms_file(File1, Opts) ->
 consult(File) ->
     case filename:extension(File) of
         Ex when (Ex == ".yml") or (Ex == ".yaml") ->
-            case p1_yaml:decode_from_file(File, [plain_as_atom]) of
+            case fast_yaml:decode_from_file(File, [plain_as_atom]) of
                 {ok, []} ->
                     {ok, []};
                 {ok, [Document|_]} ->
                     {ok, parserl(Document)};
                 {error, Err} ->
                     Msg1 = "Cannot load " ++ File ++ ": ",
-                    Msg2 = p1_yaml:format_error(Err),
+                    Msg2 = fast_yaml:format_error(Err),
                     {error, Msg1 ++ Msg2}
             end;
         _ ->
index 46ece873c5467d85bdc10a0fd3ca79a52a8e471e..14ac21316e5d7ae5fa98d78a830955da8038c3fa 100644 (file)
@@ -589,10 +589,10 @@ rebar_dep({App, _, {git, Url, Ref}}) ->
 %% -- YAML spec parser
 
 consult(File) ->
-    case p1_yaml:decode_from_file(File, [plain_as_atom]) of
+    case fast_yaml:decode_from_file(File, [plain_as_atom]) of
         {ok, []} -> {ok, []};
         {ok, [Doc|_]} -> {ok, [format(Spec) || Spec <- Doc]};
-        {error, Err} -> {error, p1_yaml:format_error(Err)}
+        {error, Err} -> {error, fast_yaml:format_error(Err)}
     end.
 
 format({Key, Val}) when is_binary(Val) ->