Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions deps/menelaus/README.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Menelaus

This OTP application represents the RESTful web service interface and the
This OTP application represents the RESTful web service interface and the
management console to the world of ns_server and emoxi.

## Dependencies
Expand All @@ -14,8 +14,8 @@ Rubygem cucumber

## Starting

The primary way to start Menelaus is to start it's parent project, the
ns_server. This way Menelaus fits into the supervisor hierarchy and
The primary way to start Menelaus is to start it's parent project, the
ns_server. This way Menelaus fits into the supervisor hierarchy and
can make calls to ns_config as needed.


Expand Down
4 changes: 2 additions & 2 deletions deps/menelaus/deps/erlwsh/README
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Install:
Then,compile all sources:
make
At last,you can start erlwsh by start.sh
./start.sh
./start.sh

Erlwsh is online: http://localhost:8000/shell


Expand Down
2 changes: 1 addition & 1 deletion deps/menelaus/deps/erlwsh/scripts/install_mochiweb.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/bash
# author: litaocheng@gmail.com
# date: 2009.10.16
# desc: get the mochiweb from the google code svn, and install
# desc: get the mochiweb from the google code svn, and install
# it to the erlang otp lib directory(makesure you have install
# the erlang otp).
# 1, get the erlang otp lib dir
Expand Down
2 changes: 1 addition & 1 deletion deps/menelaus/deps/erlwsh/src/erlwsh.erl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ensure_started(App) ->
{error, {already_started, App}} ->
ok
end.

%% @spec start() -> ok
%% @doc Start the erlwsh server.
start() ->
Expand Down
6 changes: 3 additions & 3 deletions deps/menelaus/deps/erlwsh/src/erlwsh_deps.erl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ deps_on_path() ->
end
end,
ordsets:from_list(lists:foldl(F, [], code:get_path())).

%% @spec new_siblings(Module) -> [Dir]
%% @doc Find new siblings paths relative to Module that aren't already on the
%% code path.
Expand All @@ -38,11 +38,11 @@ new_siblings(Module) ->
ordsets:is_element(
filename:basename(filename:dirname(X)),
Existing) =:= false],
lists:filter(fun filelib:is_dir/1,
lists:filter(fun filelib:is_dir/1,
lists:append([[filename:join([X, "ebin"]),
filename:join([X, "include"])] ||
X <- Siblings])).


%% @spec ensure(Module) -> ok
%% @doc Ensure that all ebin and include paths for dependencies
Expand Down
2 changes: 1 addition & 1 deletion deps/menelaus/deps/erlwsh/src/erlwsh_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ upgrade() ->
%% @spec init([]) -> SupervisorTree
%% @doc supervisor callback.
init([]) ->
Ip = case os:getenv("MOCHIWEB_IP") of false -> "0.0.0.0"; Any -> Any end,
Ip = case os:getenv("MOCHIWEB_IP") of false -> "0.0.0.0"; Any -> Any end,
WebConfig = [
{ip, Ip},
{port, 8000},
Expand Down
2 changes: 1 addition & 1 deletion deps/menelaus/deps/mochiweb/priv/skel/src/skel.erl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ensure_started(App) ->
{error, {already_started, App}} ->
ok
end.

%% @spec start() -> ok
%% @doc Start the skel server.
start() ->
Expand Down
6 changes: 3 additions & 3 deletions deps/menelaus/deps/mochiweb/priv/skel/src/skel_deps.erl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ deps_on_path() ->
end
end,
ordsets:from_list(lists:foldl(F, [], code:get_path())).

%% @spec new_siblings(Module) -> [Dir]
%% @doc Find new siblings paths relative to Module that aren't already on the
%% code path.
Expand All @@ -38,11 +38,11 @@ new_siblings(Module) ->
ordsets:is_element(
filename:basename(filename:dirname(X)),
Existing) =:= false],
lists:filter(fun filelib:is_dir/1,
lists:filter(fun filelib:is_dir/1,
lists:append([[filename:join([X, "ebin"]),
filename:join([X, "include"])] ||
X <- Siblings])).


%% @spec ensure(Module) -> ok
%% @doc Ensure that all ebin and include paths for dependencies
Expand Down
2 changes: 1 addition & 1 deletion deps/menelaus/deps/mochiweb/priv/skel/src/skel_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ upgrade() ->
%% @spec init([]) -> SupervisorTree
%% @doc supervisor callback.
init([]) ->
Ip = case os:getenv("MOCHIWEB_IP") of false -> "0.0.0.0"; Any -> Any end,
Ip = case os:getenv("MOCHIWEB_IP") of false -> "0.0.0.0"; Any -> Any end,
WebConfig = [
{ip, Ip},
{port, 8000},
Expand Down
8 changes: 4 additions & 4 deletions deps/menelaus/deps/mochiweb/src/mochijson.erl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ json_encode_proplist([], _State) ->
"{}";
json_encode_proplist(Props, State) ->
F = fun ({K, V}, Acc) ->
KS = case K of
KS = case K of
K when is_atom(K) ->
json_encode_string_utf8(atom_to_list(K));
K when is_integer(K) ->
Expand Down Expand Up @@ -321,12 +321,12 @@ tokenize_string([$\\, $u, C3, C2, C1, C0 | Rest], S, Acc) ->
% coalesce UTF-16 surrogate pair?
C = dehex(C0) bor
(dehex(C1) bsl 4) bor
(dehex(C2) bsl 8) bor
(dehex(C2) bsl 8) bor
(dehex(C3) bsl 12),
tokenize_string(Rest, ?ADV_COL(S, 6), [C | Acc]);
tokenize_string([C | Rest], S, Acc) when C >= $\s; C < 16#10FFFF ->
tokenize_string(Rest, ?ADV_COL(S, 1), [C | Acc]).

tokenize_number(IoList=[C | _], Mode, S=#decoder{input_encoding=utf8}, Acc)
when is_list(C); is_binary(C); C >= 16#7f ->
List = xmerl_ucs:from_utf8(iolist_to_binary(IoList)),
Expand Down Expand Up @@ -419,7 +419,7 @@ is_obj({struct, Props}) ->
true;
(_) ->
false
end,
end,
lists:all(F, Props).

obj_from_list(Props) ->
Expand Down
14 changes: 7 additions & 7 deletions deps/menelaus/deps/mochiweb/src/mochijson2.erl
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ is_obj({struct, Props}) ->
true;
(_) ->
false
end,
end,
lists:all(F, Props).

obj_from_list(Props) ->
Expand Down Expand Up @@ -606,21 +606,21 @@ e2j_test_vec(utf8) ->
{[], "[]"},
{[[]], "[[]]"},
{[1, <<"foo">>], "[1,\"foo\"]"},

%% json array in a json object
{obj_from_list([{<<"foo">>, [123]}]),
"{\"foo\":[123]}"},

%% json object in a json object
{obj_from_list([{<<"foo">>, obj_from_list([{<<"bar">>, true}])}]),
"{\"foo\":{\"bar\":true}}"},

%% fold evaluation order
{obj_from_list([{<<"foo">>, []},
{<<"bar">>, obj_from_list([{<<"baz">>, true}])},
{<<"alice">>, <<"bob">>}]),
"{\"foo\":[],\"bar\":{\"baz\":true},\"alice\":\"bob\"}"},

%% json object in a json array
{[-123, <<"foo">>, obj_from_list([{<<"bar">>, []}]), null],
"[-123,\"foo\",{\"bar\":[]},null]"}
Expand All @@ -629,7 +629,7 @@ e2j_test_vec(utf8) ->
%% test utf8 encoding
test_encoder_utf8() ->
%% safe conversion case (default)
[34,"\\u0001","\\u0442","\\u0435","\\u0441","\\u0442",34] =
[34,"\\u0001","\\u0442","\\u0435","\\u0441","\\u0442",34] =
encode(<<1,"\321\202\320\265\321\201\321\202">>),

%% raw utf8 output (optional)
Expand All @@ -647,7 +647,7 @@ test_input_validation() ->
Expect = list_to_binary(xmerl_ucs:to_utf8(CodePoint)),
Expect = decode(UTF8)
end, Good),

Bad = [
% 2nd, 3rd, or 4th byte of a multi-byte sequence w/o leading byte
<<?Q, 16#80, ?Q>>,
Expand Down
8 changes: 4 additions & 4 deletions deps/menelaus/deps/mochiweb/src/mochinum.erl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ digits(Float) ->
_ ->
R
end.

%% @spec frexp(F::float()) -> {Frac::float(), Exp::float()}
%% @doc Return the fractional and exponent part of an IEEE 754 double,
%% equivalent to the libc function of the same name.
Expand Down Expand Up @@ -205,7 +205,7 @@ generate(R0, S, MPlus, MMinus, LowOk, HighOk) ->
end
end.

unpack(Float) ->
unpack(Float) ->
<<Sign:1, Exp:11, Frac:52>> = <<Float:64/float>>,
{Sign, Exp, Frac}.

Expand Down Expand Up @@ -243,7 +243,7 @@ test_int_ceil() ->
-1 = int_ceil(-1.5),
-2 = int_ceil(-2.0),
ok.

test_int_pow() ->
1 = int_pow(1, 1),
1 = int_pow(1, 0),
Expand All @@ -252,7 +252,7 @@ test_int_pow() ->
100 = int_pow(10, 2),
1000 = int_pow(10, 3),
ok.

test_digits() ->
"0" = digits(0),
"0.0" = digits(0.0),
Expand Down
2 changes: 1 addition & 1 deletion deps/menelaus/deps/mochiweb/src/mochiweb_charref.erl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ charref([$# | L]) ->
end;
charref(L) ->
entity(L).

%% @spec test() -> ok
%% @doc Run tests for mochiweb_charref.
test() ->
Expand Down
22 changes: 11 additions & 11 deletions deps/menelaus/deps/mochiweb/src/mochiweb_cookies.erl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
cookie(Key, Value) ->
cookie(Key, Value, []).

%% @spec cookie(Key::string(), Value::string(), Options::[Option]) -> header()
%% where Option = {max_age, integer()} | {local_time, {date(), time()}}
%% @spec cookie(Key::string(), Value::string(), Options::[Option]) -> header()
%% where Option = {max_age, integer()} | {local_time, {date(), time()}}
%% | {domain, string()} | {path, string()}
%% | {secure, true | false} | {http_only, true | false}
%%
Expand Down Expand Up @@ -125,9 +125,9 @@ age_to_cookie_date(Age, LocalTime) ->
%% @spec parse_cookie(string()) -> [{K::string(), V::string()}]
%% @doc Parse the contents of a Cookie header field, ignoring cookie
%% attributes, and return a simple property list.
parse_cookie("") ->
parse_cookie("") ->
[];
parse_cookie(Cookie) ->
parse_cookie(Cookie) ->
parse_cookie(Cookie, []).

%% @spec test() -> ok
Expand All @@ -140,8 +140,8 @@ test() ->
%% Internal API

parse_cookie([], Acc) ->
lists:reverse(Acc);
parse_cookie(String, Acc) ->
lists:reverse(Acc);
parse_cookie(String, Acc) ->
{{Token, Value}, Rest} = read_pair(String),
Acc1 = case Token of
"" ->
Expand Down Expand Up @@ -180,7 +180,7 @@ read_quoted([$\\, Any | Rest], Acc) ->
read_quoted(Rest, [Any | Acc]);
read_quoted([C | Rest], Acc) ->
read_quoted(Rest, [C | Acc]).

skip_whitespace(String) ->
F = fun (C) -> ?IS_WHITESPACE(C) end,
lists:dropwhile(F, String).
Expand All @@ -189,7 +189,7 @@ read_token(String) ->
F = fun (C) -> not ?IS_SEPARATOR(C) end,
lists:splitwith(F, String).

skip_past_separator([]) ->
skip_past_separator([]) ->
[];
skip_past_separator([$; | Rest]) ->
Rest;
Expand All @@ -200,7 +200,7 @@ skip_past_separator([_ | Rest]) ->

parse_cookie_test() ->
%% RFC example
C1 = "$Version=\"1\"; Customer=\"WILE_E_COYOTE\"; $Path=\"/acme\";
C1 = "$Version=\"1\"; Customer=\"WILE_E_COYOTE\"; $Path=\"/acme\";
Part_Number=\"Rocket_Launcher_0001\"; $Path=\"/acme\";
Shipping=\"FedEx\"; $Path=\"/acme\"",
[
Expand Down Expand Up @@ -238,8 +238,8 @@ cookie_test() ->
C1 = cookie(<<"Customer">>, <<"WILE_E_COYOTE">>, [{path, <<"/acme">>}]),

{"Set-Cookie","=NoKey; Version=1"} = cookie("", "NoKey", []),
LocalTime = calendar:universal_time_to_local_time({{2007, 5, 15}, {13, 45, 33}}),

LocalTime = calendar:universal_time_to_local_time({{2007, 5, 15}, {13, 45, 33}}),
C2 = {"Set-Cookie",
"Customer=WILE_E_COYOTE; "
"Version=1; "
Expand Down
2 changes: 1 addition & 1 deletion deps/menelaus/deps/mochiweb/src/mochiweb_echo.erl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

stop() ->
mochiweb_socket_server:stop(?MODULE).

start() ->
mochiweb_socket_server:start([{name, ?MODULE},
{port, 6789},
Expand Down
4 changes: 2 additions & 2 deletions deps/menelaus/deps/mochiweb/src/mochiweb_headers.erl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%% @doc Run tests for this module.
test() ->
H = ?MODULE:make([{hdr, foo}, {"Hdr", "bar"}, {'Hdr', 2}]),
[{hdr, "foo, bar, 2"}] = ?MODULE:to_list(H),
[{hdr, "foo, bar, 2"}] = ?MODULE:to_list(H),
H1 = ?MODULE:insert(taco, grande, H),
[{hdr, "foo, bar, 2"}, {taco, "grande"}] = ?MODULE:to_list(H1),
H2 = ?MODULE:make([{"Set-Cookie", "foo"}]),
Expand Down Expand Up @@ -69,7 +69,7 @@ default_from_list(List, T) ->

%% @spec to_list(headers()) -> [{key(), string()}]
%% @doc Return the contents of the headers. The keys will be the exact key
%% that was first inserted (e.g. may be an atom or binary, case is
%% that was first inserted (e.g. may be an atom or binary, case is
%% preserved).
to_list(T) ->
F = fun ({K, {array, L}}, Acc) ->
Expand Down
2 changes: 1 addition & 1 deletion deps/menelaus/deps/mochiweb/src/mochiweb_html.erl
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ tree([T={comment, _Comment} | Rest], S) ->
tree(Rest, append_stack_child(T, S));
tree(L=[{data, _Data, _Whitespace} | _], S) ->
case tree_data(L, true, []) of
{_, true, Rest} ->
{_, true, Rest} ->
tree(Rest, S);
{Data, false, Rest} ->
tree(Rest, append_stack_child(Data, S))
Expand Down
6 changes: 3 additions & 3 deletions deps/menelaus/deps/mochiweb/src/mochiweb_skel.erl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

skelcopy(DestDir, Name) ->
ok = ensuredir(DestDir),
LDst = case length(filename:dirname(DestDir)) of
LDst = case length(filename:dirname(DestDir)) of
1 -> %% handle case when dirname returns "/"
0;
N ->
Expand All @@ -17,7 +17,7 @@ skelcopy(DestDir, Name) ->
ok = file:make_symlink(
filename:join(filename:dirname(code:which(?MODULE)), ".."),
filename:join([DestDir, Name, "deps", "mochiweb"])).


%% Internal API

Expand All @@ -41,7 +41,7 @@ skelcopy(Src, DestDir, Name, LDst) ->
io:format("~s/~n", [EDst]),
lists:foreach(fun ("." ++ _) -> ok;
(F) ->
skelcopy(filename:join(Src, F),
skelcopy(filename:join(Src, F),
Dir,
Name,
LDst)
Expand Down
2 changes: 1 addition & 1 deletion deps/menelaus/deps/mochiweb/src/mochiweb_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ record_to_proplist(Record, Fields) ->
record_to_proplist(Record, Fields, '__record').

%% @spec record_to_proplist(Record, Fields, TypeKey) -> proplist()
%% @doc Return a proplist of the given Record with each field in the
%% @doc Return a proplist of the given Record with each field in the
%% Fields list set as a key with the corresponding value in the Record.
%% TypeKey is the key that is used to store the record type
%% Fields should be obtained by calling record_info(fields, record_type)
Expand Down
Loading