Skip to content

Commit

Permalink
initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
proger committed Aug 31, 2013
0 parents commit 6204d8c
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ebin/
*.dump
deps/
vmling
.applist
/log/
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ifeq ($(shell uname), Darwin)
sync:
fsevent_watch -F src/ | env PERLIO=:raw perl -ne 's#.*\t.*\t$$ENV{"PWD"}/src/.*erl$$#\2# && print "skip_deps=true\n"' | xargs -tn1 rebar compile
else
sync:
fanotify_watch -c | env PERLIO=:raw perl -ne 's#.*\t.*\t$$ENV{"PWD"}/src/.*erl$$#\2# && print "skip_deps=true\n"' | xargs -tn1 rebar compile
endif

run:
ERL_LIBS=deps erl -pa ebin -config run/sys.config \
-eval '[ok = application:ensure_started(A, permanent) || A <- [lager,asn1,crypto,public_key,ssl,mimetypes,hackney]]'

.PHONY: run
4 changes: 4 additions & 0 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{deps, [
{hackney, ".*", {git, "git@github.com:benoitc/hackney", {tag, "0.4.4"}}}
, {lager, ".*", {git, "git@github.com:basho/lager", {tag, "2.0.0"}}}
]}.
7 changes: 7 additions & 0 deletions run/sys.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{lager, [
{handlers, [{lager_console_backend, info}]},
{crash_log, undefined},
{colored, true}
]}
].
12 changes: 12 additions & 0 deletions src/erldocker.app.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{application, erldocker,
[
{description, ""},
{vsn, "1"},
{registered, []},
{applications, [
kernel,
stdlib
]},
{mod, { erldocker_app, []}},
{env, []}
]}.
16 changes: 16 additions & 0 deletions src/erldocker_app.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-module(erldocker_app).

-behaviour(application).

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

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

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

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

-module(erldocker_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 6204d8c

Please sign in to comment.