Skip to content

Commit

Permalink
Modify erlang-rrdtool to be compatible with rebar
Browse files Browse the repository at this point in the history
  • Loading branch information
afternoon committed Feb 22, 2011
1 parent 04122ed commit 3786d7c
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
*.beam
*.sw[op]
8 changes: 8 additions & 0 deletions ebin/rrdtool.app
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{application,rrdtool,
[{description,"Erlang-rrdtool is a simple module to allow rrdtool to be treated like an erlang port via its 'remote control' mode (rrdtool -)."},
{vsn,"1"},
{registered,[]},
{applications,[kernel,stdlib]},
{mod,{rrdtool_app,[]}},
{env,[]},
{modules,[rrdtool,rrdtool_app,rrdtool_sup]}]}.
12 changes: 12 additions & 0 deletions src/rrdtool.app.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{application, rrdtool,
[
{description, "Erlang-rrdtool is a simple module to allow rrdtool to be treated like an erlang port via its 'remote control' mode (rrdtool -)."},
{vsn, "1"},
{registered, []},
{applications, [
kernel,
stdlib
]},
{mod, {rrdtool_app, []}},
{env, []}
]}.
16 changes: 16 additions & 0 deletions src/rrdtool_app.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-module(rrdtool_app).

-behaviour(application).

%% Application callbacks
-export([start/2, stop/1]).

%% ===================================================================
%% Application callbacks
%% ===================================================================

start(_StartType, _StartArgs) ->
rrdtool_sup:start_link().

stop(_State) ->
ok.
28 changes: 28 additions & 0 deletions src/rrdtool_sup.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

-module(rrdtool_sup).

-behaviour(supervisor).

%% API
-export([start_link/0]).

%% Supervisor callbacks
-export([init/1]).

%% Helper macro for declaring children of supervisor
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).

%% ===================================================================
%% API functions
%% ===================================================================

start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).

%% ===================================================================
%% Supervisor callbacks
%% ===================================================================

init([]) ->
{ok, { {one_for_one, 5, 10}, []} }.

0 comments on commit 3786d7c

Please sign in to comment.