Skip to content

Commit

Permalink
Move from jiffy to jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Favatella committed Mar 13, 2017
1 parent d665f2b commit 8bc4f4f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
6 changes: 2 additions & 4 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
{deps,
[
{cowboy, "1.0.4"},
{jiffy, "0.14.7"},
{jsx, "2.8.2"},
{trails, "0.2.0"},
{cowboy_swagger, "1.1.0"},
{cowboy_swagger, "1.2.2"},
{mixer, "0.1.5", {pkg, inaka_mixer}},
{iso8601, "1.1.2", {pkg, inaka_iso8601}},
{sumo_db, "0.6.4"}
Expand Down Expand Up @@ -96,5 +96,3 @@
{plt_apps, top_level_deps},
{plt_location, local}
]}.

{overrides, [{override, jiffy, [{plugins, [pc]}, {artifacts, ["priv/jiffy.so"]}, {provider_hooks, [{post, [{compile, {pc, compile}}, {clean, {pc, clean}}]}]}]}]}.
8 changes: 4 additions & 4 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{"1.1.0",
[{<<"cowboy">>,{pkg,<<"cowboy">>,<<"1.0.4">>},0},
{<<"cowboy_swagger">>,{pkg,<<"cowboy_swagger">>,<<"1.1.0">>},0},
{<<"cowboy_swagger">>,{pkg,<<"cowboy_swagger">>,<<"1.2.2">>},0},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"1.0.2">>},1},
{<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.8">>},2},
{<<"iso8601">>,{pkg,<<"inaka_iso8601">>,<<"1.1.2">>},0},
{<<"jiffy">>,{pkg,<<"jiffy">>,<<"0.14.7">>},0},
{<<"jsx">>,{pkg,<<"jsx">>,<<"2.8.2">>},0},
{<<"lager">>,{pkg,<<"lager">>,<<"3.2.1">>},1},
{<<"mixer">>,{pkg,<<"inaka_mixer">>,<<"0.1.5">>},0},
{<<"quickrand">>,{pkg,<<"quickrand">>,<<"1.5.4">>},2},
Expand All @@ -16,11 +16,11 @@
[
{pkg_hash,[
{<<"cowboy">>, <<"A324A8DF9F2316C833A470D918AAF73AE894278B8AA6226CE7A9BF699388F878">>},
{<<"cowboy_swagger">>, <<"D1141F847B2313D9959383D241294FF786948C66E97086CBE9C0B877FB06A601">>},
{<<"cowboy_swagger">>, <<"758F550A5C7D781BA20A1A58B57595BD0A42742208357F31C902BF97D359DBE9">>},
{<<"cowlib">>, <<"9D769A1D062C9C3AC753096F868CA121E2730B9A377DE23DEC0F7E08B1DF84EE">>},
{<<"goldrush">>, <<"2024BA375CEEA47E27EA70E14D2C483B2D8610101B4E852EF7F89163CDB6E649">>},
{<<"iso8601">>, <<"6D84BBA9641FA39802E6B53C57E0B61B2F61BF8E81C112356B57BE8DA31DE771">>},
{<<"jiffy">>, <<"9F33B893EDD6041CEAE03BC1E50B412E858CC80B46F3D7535A7A9940A79A1C37">>},
{<<"jsx">>, <<"7ACC7D785B5ABE8A6E9ADBDE926A24E481F29956DD8B4DF49E3E4E7BCC92A018">>},
{<<"lager">>, <<"EEF4E18B39E4195D37606D9088EA05BF1B745986CF8EC84F01D332456FE88D17">>},
{<<"mixer">>, <<"754630C0E60221B23E4D83ADF6E789A8B283855E23F9391EEC40980E6E800486">>},
{<<"quickrand">>, <<"47ADD4755CC5F209CBEFFD6F47C84061196CD7FAD99FD8FD12418EB0D06B939D">>},
Expand Down
4 changes: 2 additions & 2 deletions src/sr_json.erl
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@

%% @doc Internal representation to string
-spec encode(json()) -> iodata().
encode(Json) -> jiffy:encode(Json, [uescape]).
encode(Json) -> jsx:encode(Json, [uescape]).

%% @doc String to internal representation
-spec decode(iodata()) -> json().
decode(Data) ->
try jiffy:decode(Data, [return_maps])
try jsx:decode(Data, [return_maps])
catch
_:_Error ->
throw(badjson)
Expand Down
2 changes: 1 addition & 1 deletion src/sumo_rest.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
, cowboy
, trails
, cowboy_swagger
, jiffy
, jsx
, sumo_db
, iso8601
]},
Expand Down
2 changes: 1 addition & 1 deletion test/sr_json_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jsons(_Config) ->
, <<"0.3">>
, <<"\"a string\"">>
, <<"[true,true,false]">>
, <<"{\"c\":[1,2,3],\"a\":\"b\"}">>
, <<"{\"a\":\"b\",\"c\":[1,2,3]}">>
],
lists:foreach(WorksWith, Jsons),

Expand Down
2 changes: 1 addition & 1 deletion test/sr_test.app
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
, sasl
, cowboy
, cowboy_swagger
, jiffy
, jsx
, sumo_db
, mnesia
]},
Expand Down

0 comments on commit 8bc4f4f

Please sign in to comment.