Skip to content

Commit

Permalink
reload_modules/1
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed May 10, 2010
1 parent 48c9c1d commit c1a1842
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/reloader.erl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-export([all_changed/0]).
-export([is_changed/1]).
-export([reload_modules/1]).
-record(state, {last, tref}).

%% External API
Expand Down Expand Up @@ -75,6 +76,12 @@ terminate(_Reason, State) ->
code_change(_Vsn, State, _Extra) ->
{ok, State}.

%% @spec reload_modules([atom()]) -> [{module, atom()} | {error, term()}]
%% @doc code:purge/1 and code:load_file/1 the given list of modules in order,
%% return the results of code:load_file/1.
reload_modules(Modules) ->
[begin code:purge(M), code:load_file(M) end || M <- Modules].

%% @spec all_changed() -> [atom()]
%% @doc Return a list of beam modules that have changed.
all_changed() ->
Expand Down

0 comments on commit c1a1842

Please sign in to comment.