aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlx_topo.erl
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2014-06-15 19:18:14 -0500
committerTristan Sloughter <[email protected]>2014-10-11 11:13:04 -0500
commit0516b405ccb98febcf94a8e94000f4a633569f59 (patch)
tree08eb3c09943ac68a4493ff7e2fc5925842bc4627 /src/rlx_topo.erl
parent5096c28c17ea256f48ce049a43d11b172532e03e (diff)
downloadrelx-0516b405ccb98febcf94a8e94000f4a633569f59.tar.gz
relx-0516b405ccb98febcf94a8e94000f4a633569f59.tar.bz2
relx-0516b405ccb98febcf94a8e94000f4a633569f59.zip
provider task dependencies
Diffstat (limited to 'src/rlx_topo.erl')
-rw-r--r--src/rlx_topo.erl14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/rlx_topo.erl b/src/rlx_topo.erl
index b5585df..d24f227 100644
--- a/src/rlx_topo.erl
+++ b/src/rlx_topo.erl
@@ -32,7 +32,8 @@
%%%-------------------------------------------------------------------
-module(rlx_topo).
--export([sort_apps/1,
+-export([sort/1,
+ sort_apps/1,
format_error/1]).
-include("relx.hrl").
@@ -64,6 +65,12 @@ sort_apps(Apps) ->
E ->
E
end.
+
+%% @doc Do a topological sort on the list of pairs.
+-spec sort([pair()]) -> {ok, [atom()]} | relx:error().
+sort(Pairs) ->
+ iterate(Pairs, [], all(Pairs)).
+
%% @doc nicely format the error from the sort.
-spec format_error(Reason::term()) -> iolist().
format_error({cycle, Pairs}) ->
@@ -82,11 +89,6 @@ format_error({cycle, Pairs}) ->
%%====================================================================
%% Internal Functions
%%====================================================================
-%% @doc Do a topological sort on the list of pairs.
--spec sort([pair()]) -> {ok, [atom()]} | relx:error().
-sort(Pairs) ->
- iterate(Pairs, [], all(Pairs)).
-
-spec names_to_apps([atom()], [rlx_app_info:t()]) -> [rlx_app_info:t()].
names_to_apps(Names, Apps) ->
[find_app_by_name(Name, Apps) || Name <- Names].