Permalink
Browse files

add poke_twice, appup, bump version to 2

  • Loading branch information...
1 parent 24d4af9 commit 8e859ba91fd0fa1b0b278e4e19743a9c2faf5832 @RJ committed Mar 16, 2011
View
@@ -1,3 +1,2 @@
-ebin
*.beam
*~
@@ -0,0 +1,10 @@
+{"2",
+ %% Upgrade instructions from 1 to 2
+ [{"1", [
+ {load_module, dummy_app_server}
+ ]}],
+ %% Downgrade instructions from 2 to 1
+ [{"1",[
+ {load_module, dummy_app_server}
+ ]}]
+}.
@@ -1,7 +1,7 @@
{application, dummy_app,
[
{description, "Dummy project to test release process"},
- {vsn, "1"},
+ {vsn, "2"},
{registered, []},
{applications, [
kernel,
@@ -3,7 +3,7 @@
-behaviour(gen_server).
%% API
--export([start_link/0, poke/0, num_pokes/0]).
+-export([start_link/0, poke/0, num_pokes/0, poke_twice/0]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
@@ -18,6 +18,9 @@ start_link() ->
poke() ->
gen_server:call(?MODULE, poke).
+poke_twice() ->
+ gen_server:call(?MODULE, poke_twice).
+
num_pokes() ->
gen_server:call(?MODULE, num_pokes).
@@ -29,6 +32,12 @@ init([]) ->
handle_call(num_pokes, _From, State = #state{ num_pokes = PokeCount }) ->
{reply, PokeCount, State};
+handle_call(poke_twice, _From, State) ->
+ NewPokeCount = State#state.num_pokes + 2,
+ NewState = State#state{num_pokes = NewPokeCount},
+ Reply = {ok, NewPokeCount},
+ {reply, Reply, NewState};
+
handle_call(poke, _From, State) ->
NewPokeCount = State#state.num_pokes + 1,
NewState = State#state{num_pokes = NewPokeCount},
@@ -44,7 +53,9 @@ handle_info(_Info, State) ->
terminate(_Reason, _State) ->
ok.
-code_change(_OldVsn, State, _Extra) ->
+code_change(OldVsn, State, Extra) ->
+ error_logger:info_msg("code_change, oldvsn:~p state:~p extra:~p~n",
+ [OldVsn, State, Extra]),
{ok, State}.
%%% Internal functions
View
@@ -1,6 +1,6 @@
{sys, [
{lib_dirs, ["../apps"]},
- {rel, "dummy", "1",
+ {rel, "dummy", "2",
[
kernel,
stdlib,

0 comments on commit 8e859ba

Please sign in to comment.