Skip to content

Commit

Permalink
Merge pull request #39 from novaframework/fix-hrl-file
Browse files Browse the repository at this point in the history
try new hrl file
  • Loading branch information
Taure authored Sep 27, 2024
2 parents d4a403a + 624c858 commit 11f2ca6
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 7 deletions.
4 changes: 2 additions & 2 deletions priv/templates/nova/.tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
erlang 26.2.2
rebar 3.22.1
erlang 27.0.1
rebar 3.24.0
18 changes: 18 additions & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,22 @@
{deps, [
nova,
enotify
]}.

{xref_checks,[
undefined_function_calls,
undefined_functions,
locals_not_used,
deprecated_function_calls,
deprecated_functions
]}.

{dialyzer, [
{warnings, [
unknown
]},
{plt_apps, all_deps},
{plt_extra_apps, [
nova,
routing_tree]}
]}.
6 changes: 3 additions & 3 deletions rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{<<"quickrand">>,{pkg,<<"quickrand">>,<<"2.0.7">>},2},
{<<"ranch">>,{pkg,<<"ranch">>,<<"1.8.0">>},2},
{<<"routing_tree">>,{pkg,<<"routing_tree">>,<<"1.0.9">>},1},
{<<"thoas">>,{pkg,<<"thoas">>,<<"0.2.0">>},0},
{<<"thoas">>,{pkg,<<"thoas">>,<<"1.2.0">>},1},
{<<"uuid">>,{pkg,<<"uuid_erl">>,<<"2.0.7">>},1}]}.
[
{pkg_hash,[
Expand All @@ -23,7 +23,7 @@
{<<"quickrand">>, <<"D2BD76676A446E6A058D678444B7FDA1387B813710D1AF6D6E29BB92186C8820">>},
{<<"ranch">>, <<"8C7A100A139FD57F17327B6413E4167AC559FBC04CA7448E9BE9057311597A1D">>},
{<<"routing_tree">>, <<"F7B95CF21CAEF1F184948C547780BAB4EC2B2CB0CD75B8CB2BE49F86F0DFD523">>},
{<<"thoas">>, <<"4D25BA900A1AAAEE758244C9B69CE0BC44E869ECBAA0817C2E783EE223C02F91">>},
{<<"thoas">>, <<"73B0546BAFF5008E6ED209558FD7B0606B035D96F9F3DE24EF42879100E094D4">>},
{<<"uuid">>, <<"B2078D2CC814F53AFA52D36C91E08962C7E7373585C623F4C0EA6DFB04B2AF94">>}]},
{pkg_hash_ext,[
{<<"cowboy">>, <<"8A7ABE6D183372CEB21CAA2709BEC928AB2B72E18A3911AA1771639BEF82651E">>},
Expand All @@ -36,6 +36,6 @@
{<<"quickrand">>, <<"B8ACBF89A224BC217C3070CA8BEBC6EB236DBE7F9767993B274084EA044D35F0">>},
{<<"ranch">>, <<"49FBCFD3682FAB1F5D109351B61257676DA1A2FDBE295904176D5E521A2DDFE5">>},
{<<"routing_tree">>, <<"FB9A05EA0F3A8B77CC39CED3952B98391C617BA448AF63DDD5908F8557D8C029">>},
{<<"thoas">>, <<"630AAEE57FB3FDE201578E787259E15E788A27733D49DE8DCCE1354DB1885B8D">>},
{<<"thoas">>, <<"540C8CB7D9257F2AD0A14145DC23560F91ACDCA995F0CCBA779EB33AF5D859D1">>},
{<<"uuid">>, <<"4E4C5CA3461DC47C5E157ED42AA3981A053B7A186792AF972A27B14A9489324E">>}]}
].
18 changes: 18 additions & 0 deletions src/nova_router.hrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
%% Nova Routing value
-record(nova_handler_value, {
app :: atom(),
module :: atom(),
function :: atom(),
callback :: function() | undefined,
plugins = [] :: list(),
secure = false :: false | {Mod :: atom(), Fun :: atom()},
extra_state :: any()
}).

-record(cowboy_handler_value, {
app :: atom(),
handler :: atom(),
arguments :: any(),
plugins = [] :: list(),
secure = false :: false | {Mod :: atom(), Fun :: atom()}
}).
4 changes: 2 additions & 2 deletions src/rebar3_nova_routes.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

-export([init/1, do/1, format_error/1]).

-include_lib("nova/include/nova_router.hrl").
-include("nova_router.hrl").
-include_lib("routing_tree/include/routing_tree.hrl").

-define(PROVIDER, routes).
Expand Down Expand Up @@ -91,7 +91,7 @@ format_tree([#node{segment = Segment, value = Value, children = Children}|Tl], D

lists:foreach(fun(#node_comp{comparator = Method, value = Value0}) ->
{App, Mod, Func} = case Value0 of
#nova_handler_value{app=App0, module=undefined, function = undefined, callback = Callback0} ->
#nova_handler_value{app=App0, module=undefined, function = undefined, callback = Callback0} ->
{module, Module} = lists:keyfind(module, 1, erlang:fun_info(Callback0)),
{name, Function} = lists:keyfind(name, 1, erlang:fun_info(Callback0)),
{App0, Module, Function};
Expand Down

0 comments on commit 11f2ca6

Please sign in to comment.