aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric <[email protected]>2012-09-14 09:24:48 -0500
committerEric <[email protected]>2012-09-18 10:04:27 -0700
commite15d768062834181bb36b73fe607208ef4c6cd8c (patch)
tree706eb2ae5c544fa66da0028dc105b187df8ce559
parent9ed1132fb5a6150a051431fb14b42b800bdd323a (diff)
downloadrelx-e15d768062834181bb36b73fe607208ef4c6cd8c.tar.gz
relx-e15d768062834181bb36b73fe607208ef4c6cd8c.tar.bz2
relx-e15d768062834181bb36b73fe607208ef4c6cd8c.zip
make sure that app_info can print a representation of itself
-rw-r--r--src/rcl_app_info.erl12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/rcl_app_info.erl b/src/rcl_app_info.erl
index eaf3302..d53c1aa 100644
--- a/src/rcl_app_info.erl
+++ b/src/rcl_app_info.erl
@@ -47,7 +47,8 @@
active_deps/1,
active_deps/2,
library_deps/1,
- library_deps/2]).
+ library_deps/2,
+ format/1]).
-export_type([t/0]).
@@ -125,7 +126,14 @@ library_deps(AppInfo=#app_info_t{}, LibraryDeps)
when erlang:is_list(LibraryDeps) ->
AppInfo#app_info_t{library_deps=LibraryDeps}.
-
+-spec format(t()) -> iolist().
+format(#app_info_t{name=Name, vsn=Vsn, dir=Dir,
+ active_deps=Deps, library_deps=LibDeps}) ->
+ [erlang:atom_to_list(Name), "-", Vsn, ": ", Dir, "\n",
+ rcl_util:indent(1), "Active Dependencies:\n",
+ [[rcl_util:indent(2), erlang:atom_to_list(Dep), ",\n"] || Dep <- Deps],
+ rcl_util:indent(1), "Library Dependencies:\n",
+ [[rcl_util:indent(2), erlang:atom_to_list(LibDep), ",\n"] || LibDep <- LibDeps]].