Permalink
Browse files

Integrated erldocs

  • Loading branch information...
1 parent e2d6d13 commit c285b2e1481a78d7aa42f99ab62d8de710897518 @amilkr amilkr committed Nov 23, 2011
Showing with 26 additions and 15 deletions.
  1. +11 −1 Makefile
  2. +2 −1 rebar.config
  3. +1 −1 src/edis_db.erl
  4. +1 −1 src/edis_listener.erl
  5. +2 −2 src/edis_lists.erl
  6. +5 −5 src/zsets.erl
  7. +4 −4 test/edis_bench.erl
View
@@ -28,4 +28,14 @@ test: all
kill `ps aux | grep beam | grep edis_[t]est_server | awk '{print $$2}'`
shell: all
- ${ERL}
+ ${ERL}
+
+doc: all
+ cd deps/erldocs
+ make
+ cd ../..
+ ./deps/erldocs/erldocs doc
+ cat doc/erldocs_index.js | tr -d '\n' > doc/erldocs_index2.js
+ mv ./doc/erldocs_index2.js ./doc/erldocs_index.js
+
+
View
@@ -1,6 +1,7 @@
{deps, [{elog, "\.*", {git, "git://github.com/inaka/elog.git", "master"}},
{erldis, "\.*", {git, "git://github.com/inaka/erldis.git", "master"}},
- {eleveldb, "\.*", {git, "git@github.com:inaka/eleveldb.git", "master"}}]}.
+ {eleveldb, "\.*", {git, "git@github.com:inaka/eleveldb.git", "master"}},
+ {erldocs, "\.*", {git, "git://github.com/daleharvey/erldocs.git", "master"}}]}.
{require_otp_vsn, "R14"}.
{erl_first_files, ["src/edis_backend.erl", "test/edis_bench.erl"]}.
{erl_opts, [{src_dirs, ["src", "src/backends", "tests", "test/benchmarks"]},
View
@@ -54,7 +54,7 @@ process(Index) ->
%% =================================================================================================
%% Commands
%% =================================================================================================
-%% @equiv run(Db, Command, ?DEFAULT_TIMEOUT)
+%% @equiv run(Db, Command, 5000)
-spec run(atom(), edis:command()) -> term().
run(Db, Command) ->
run(Db, Command, ?DEFAULT_TIMEOUT).
View
@@ -3,7 +3,7 @@
%%% @author Chad DePue <chad@inakanetworks.com>
%%% @copyright (C) 2011 InakaLabs SRL
%%% @doc Listener process for clients
-%%% @reference See <a href="http://www.trapexit.org/index.php/Building_a_Non-blocking_TCP_server_using_OTP_principles">this article</a> for more information, and liberally borrowed from Fernando Benavides' code - <fernando@inakanetworks.com>
+%%% @reference See <a href="http://www.trapexit.org/index.php/Building_a_Non-blocking_TCP_server_using_OTP_principles">this article</a> for more information, and liberally borrowed from Fernando Benavides' code - fernando@inakanetworks.com
%%% @end
%%%-------------------------------------------------------------------
-module(edis_listener).
View
@@ -31,12 +31,12 @@ from_list(L) -> #edis_list{size = erlang:length(L), list = L}.
-spec to_list(edis_list(T)) -> [T].
to_list(#edis_list{list = L}) -> L.
-%% @doc returns the N`th element of the list L
+%% @doc returns the Nth element of the list L
-spec nth(pos_integer(), edis_list(T)) -> T | undefined.
nth(N, #edis_list{size = S}) when S < N -> undefined;
nth(N, #edis_list{list = L}) -> lists:nth(N, L).
-%% @doc returns the N`th tail of the list L
+%% @doc returns the Nth tail of the list L
-spec nthtail(non_neg_integer(), edis_list(T)) -> edis_list(T).
nthtail(N, #edis_list{size = S}) when S < N -> [];
nthtail(N, #edis_list{list = L}) -> lists:nthtail(N, L).
View
@@ -29,7 +29,7 @@
-export([intersection/2, intersection/3, union/2, union/3]).
-export([count/3, count/4, range/3, range/4, list/3, list/4]).
-%% @doc Creates an empty {@link zset(any(), any())}
+%% @doc Creates an empty {@link zset/2}
-spec new() -> zset(any(), any()).
new() ->
#zset{dict = dict:new(), tree = edis_gb_trees:empty()}.
@@ -70,7 +70,7 @@ delete_any(Member, ZSet) ->
size(ZSet) ->
dict:size(ZSet#zset.dict).
-%% @equiv iterator(ZSet, forward).
+%% @equiv iterator(ZSet, forward)
-spec iterator(zset(Scores, Members)) -> iterator(Scores, Members).
iterator(ZSet) ->
iterator(ZSet, forward).
@@ -117,7 +117,7 @@ intersection(Aggregate, ZSet1, ZSet2) ->
%% @doc Returns the intersection of the non-empty list of ZSets generating the resulting scores using Aggregate in order.
%% The last argument will be the accumulated result
--spec intersection(fun((Scores, Scores) -> Scores), [zset(Scores, Members),...]) -> zset(Scores, Members).
+-spec intersection(fun((Scores, Scores) -> Scores), [zset(Scores, Members)]) -> zset(Scores, Members).
intersection(Aggregate, [ZSet1 | ZSets]) ->
lists:foldl(
fun(ZSet, AccZSet) ->
@@ -131,7 +131,7 @@ union(Aggregate, ZSet1, ZSet2) ->
%% @doc Returns the union of the non-empty list of ZSets generating the resulting scores using Aggregate in order.
%% The last argument will be the accumulated result
--spec union(fun((undefined|Scores, undefined|Scores) -> Scores), [zset(Scores, Members),...]) -> zset(Scores, Members).
+-spec union(fun((undefined|Scores, undefined|Scores) -> Scores), [zset(Scores, Members)]) -> zset(Scores, Members).
union(Aggregate, [ZSet1 | ZSets]) ->
lists:foldl(
fun(ZSet, AccZSet) ->
@@ -163,7 +163,7 @@ count(Min, Max, ZSet, Direction) ->
range(Start, Stop, ZSet) ->
range(Start, Stop, ZSet, forward).
-%% @doc Returns the list of elements between the Start'th one and the Stop'th one inclusive
+%% @doc Returns the list of elements between the Start one and the Stop one inclusive
-spec range(non_neg_integer(), non_neg_integer(), zset(Scores, Members), direction()) -> [{Scores, Members}].
range(Start, Stop, ZSet, Direction) ->
lists:reverse(range(Start, Stop, next(iterator(ZSet, Direction)), 1, [])).
View
@@ -48,7 +48,7 @@ run(Module) ->
end.
%% @doc Runs the benchmarking function Module:Function/1.
-%% @equiv run(Module, Function, []).
+%% @equiv run(Module, Function, [])
-spec run(atom(), atom()) -> [{pos_integer(), error | pos_integer()}].
run(Module, Function) ->
run(Module, Function, []).
@@ -94,19 +94,19 @@ compare(Module, Function, MathFunction, Options) ->
%% math:sqrt([(Distance - Avg) * (Distance - Avg) / Avg || Distance <- Distances])).
%% @doc Compares the different runs of Module:Function/1 to a given function.
-%% @equiv compare(Module, Function, []).
+%% @equiv compare(Module, Function, [])
-spec compare(atom(), atom(), atom() | fun((pos_integer()) -> number())) -> float().
compare(Module, Function, MathFunction) ->
compare(Module, Function, MathFunction, []).
%% @doc Graphs the results of running Module:Function/1 using ASCII Art
-%% @equiv graph(Module, Function, []).
+%% @equiv graph(Module, Function, [])
-spec graph(atom(), atom()) -> ok.
graph(Module, Function) ->
graph(Module, Function, []).
%% @doc Graphs the results of running Module:Function using ASCII Art
-%% @equiv graph(Module, Function, zero, Options).
+%% @equiv graph(Module, Function, zero, Options)
-spec graph(atom(), atom(), [option()]) -> ok.
graph(Module, Function, Options) ->
graph(Module, Function, zero, Options).

0 comments on commit c285b2e

Please sign in to comment.