Skip to content

Commit

Permalink
Giving the project the Brujo's touch :P
Browse files Browse the repository at this point in the history
Project modules were restructured according to Inaka's "Best Practices".
Now it's PING-PONG'ing, too.
  • Loading branch information
Fernando 'Brujo' Benavides committed Sep 28, 2011
1 parent 4dbd3a8 commit 78f9451
Show file tree
Hide file tree
Showing 22 changed files with 370 additions and 319 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,4 @@
deps
log/*.log log/*.log
tmp tmp
tmp/**/* tmp/**/*
Expand Down
2 changes: 2 additions & 0 deletions Emakefile
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
{"src/*", [warn_unused_vars, warn_export_all, warn_shadow_vars, warn_unused_import, warn_unused_function, warn_bif_clash, warn_unused_record, warn_deprecated_function, warn_obsolete_guard, strict_validation, report, warn_export_vars, warn_exported_vars, warn_missing_spec, warn_untyped_record, debug_info, {outdir, "ebin"}, {i, "include"}, {i, "deps/elog/include"}]}.
{"tests/*", [warn_unused_vars, warn_export_all, warn_shadow_vars, warn_unused_import, warn_unused_function, warn_bif_clash, warn_unused_record, warn_deprecated_function, warn_obsolete_guard, strict_validation, report, warn_export_vars, warn_exported_vars, warn_missing_spec, warn_untyped_record, debug_info, {outdir, "ebin"}, {i, "include"}, {i, "deps/elog/include"}]}.
28 changes: 28 additions & 0 deletions Makefile
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,28 @@
ERL := erl -pa deps/*/ebin -pa ebin -pa src -s crypto -boot start_sasl +Bc +K true -smp enable -s inets -s ssl -s elog ${ERL_ARGS}

all:
rebar get-deps && rebar compile

clean:
rebar clean

build_plt: all
dialyzer --build_plt --apps ssl public_key kernel stdlib inets crypto --output_plt ~/.edis_plt -pa deps/*/ebin ebin

analyze: all
dialyzer -pa deps/*/ebin --plt ~/.itweet_dialyzer_plt -Wunmatched_returns -Werror_handling -Wbehaviours ebin

doc: all
rebar skip_deps=true doc

xref: all
rebar skip_deps=true xref

run: all
${ERL} -s edis

test: all
${ERL} -run edis test

shell: all
${ERL}
1 change: 1 addition & 0 deletions README.md
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
An *Erlang* version of [Redis](http://redis.io). Still in its very early stages.
18 changes: 0 additions & 18 deletions Rakefile

This file was deleted.

16 changes: 9 additions & 7 deletions ebin/edis.app
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,11 @@
{application,edis, {application,edis,
[{description,[]}, [{description,"Redis KV Store - The Erlang Way :)"},
{vsn,"1"}, {vsn,"0.1"},
{registered,[]}, {registered,[]},
{applications,[kernel,stdlib]}, {applications,[kernel,stdlib,crypto]},
{mod,{edis_app,[]}}, {mod,{edis,[]}},
{env,[]}, {env,[{listener_port_range,{6379,6379}},{client_timeout,32000}]},
{modules,[client_handler,client_manager,config,edis_app, {modules,[client_handler,client_manager,config,edis,edis_app,
edis_sup,server,tcp_listener]}]}. edis_client,edis_client_mgr,edis_client_sup,
edis_config,edis_listener,edis_listener_sup,edis_sup,
server,tcp_listener]}]}.
2 changes: 2 additions & 0 deletions include/edis.hrl
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
-include("elog.hrl").

63 changes: 0 additions & 63 deletions include/log.hrl

This file was deleted.

19 changes: 19 additions & 0 deletions rebar.config
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,19 @@
{deps, [{elog, "\.*", {git, "git://github.com/inaka/elog.git", "master"}}]}.
{require_otp_vsn, "R14"}.
{erl_opts, [{src_dirs, ["src", "tests"]},
{i, "deps/elog/include"},
warn_unused_vars,
warn_export_all,
warn_shadow_vars,
warn_unused_import,
warn_unused_function,
warn_bif_clash,
warn_unused_record,
warn_deprecated_function,
warn_obsolete_guard,
strict_validation,
warn_export_vars,
warn_exported_vars,
warn_missing_spec,
warn_untyped_record, debug_info]}.
{xref_checks, [undefined_function_calls]}.
50 changes: 0 additions & 50 deletions src/client_manager.erl

This file was deleted.

16 changes: 0 additions & 16 deletions src/config.erl

This file was deleted.

12 changes: 7 additions & 5 deletions src/edis.app.src
Original file line number Original file line Diff line number Diff line change
@@ -1,12 +1,14 @@
{application, edis, {application, edis,
[ [
{description, ""}, {description, "Redis KV Store - The Erlang Way :)"},
{vsn, "1"}, {vsn, "0.1"},
{registered, []}, {registered, []},
{applications, [ {applications, [
kernel, kernel,
stdlib stdlib,
crypto
]}, ]},
{mod, { edis_app, []}}, {mod, {edis, []}},
{env, []} {env, [{listener_port_range, {6379,6379}},
{client_timeout, 32000}]}
]}. ]}.
40 changes: 40 additions & 0 deletions src/edis.erl
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,40 @@
%%%-------------------------------------------------------------------
%%% @author Fernando Benavides <fernando.benavides@inakanetworks.com>
%%% @author Chad DePue <chad@inakanetworks.com>
%%% @copyright (C) 2011 InakaLabs SRL
%%% @doc Redis (http://redis.io), but in Erlang
%%% @end
%%%-------------------------------------------------------------------
-module(edis).
-author('Fernando Benavides <fernando.benavides@inakanetworks.com>').
-author('Chad DePue <chad@inakanetworks.com>').
-vsn('0.1').

-behaviour(application).

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

%%-------------------------------------------------------------------
%% ADMIN API
%%-------------------------------------------------------------------
%% @doc Starts the application
-spec start() -> ok | {error, {already_started, ?MODULE}}.
start() -> application:start(?MODULE).

%% @doc Stops the application
-spec stop() -> ok.
stop() -> application:stop(?MODULE).

%%-------------------------------------------------------------------
%% BEHAVIOUR CALLBACKS
%%-------------------------------------------------------------------
%% @private
-spec start(any(), any()) -> {ok, pid()}.
start(_StartType, _StartArgs) ->
edis_sup:start_link().

%% @private
-spec stop(any()) -> ok.
stop(_State) -> ok.
19 changes: 0 additions & 19 deletions src/edis_app.erl

This file was deleted.

Loading

0 comments on commit 78f9451

Please sign in to comment.