Permalink
Browse files

changed bool() to boolean() in specs

  • Loading branch information...
1 parent afc222f commit dbce0f74e68f3951658057358cf5995dc6b4df44 @goj goj committed Jun 16, 2010
@@ -93,7 +93,7 @@ cache(File, xmerl_xs) ->
end,
XML.
--spec(valid_cache/1 :: (string()) -> bool()).
+-spec(valid_cache/1 :: (string()) -> boolean()).
valid_cache(File) ->
Filename = [e_conf:cache_dir(), "/",
filename:rootname(File) ++ ".cxml"],
@@ -234,7 +234,7 @@ run_ecomponent(Name, Vsn, Conf, CallStack, State) ->
end
end.
--spec(check_dependency_loop/2 :: (atom(), list(atom())) -> bool()).
+-spec(check_dependency_loop/2 :: (atom(), list(atom())) -> boolean()).
check_dependency_loop(Name, CallStack) ->
case lists:member(Name, CallStack) of
true ->
@@ -248,7 +248,7 @@ check_dependency_loop(Name, CallStack) ->
end.
-type(version() :: number() | undefined).
--spec(check_running_version/2 :: (integer(), {version(), version()}) -> bool()).
+-spec(check_running_version/2 :: (integer(), {version(), version()}) -> boolean()).
check_running_version(_, {undefined, undefined}) ->
true;
check_running_version(Vsn, {LVsn, undefined}) ->
@@ -341,7 +341,7 @@ no_errors([ok | Rest], Errors) ->
no_errors([Error | Rest], Errors) ->
no_errors(Rest, [Error | Errors]).
--spec(required_apps_started/1 :: (list()) -> bool()).
+-spec(required_apps_started/1 :: (list()) -> boolean()).
required_apps_started(Apps) ->
lists:all(fun(App) ->
lists:keymember(App, 1, Apps)
@@ -215,7 +215,7 @@ fe_servers() ->
get_conf(fe_servers, []).
%%
-%% @spec debug_mode() -> IsDebugMode :: bool()
+%% @spec debug_mode() -> IsDebugMode :: boolean()
%% @doc Checks if the server is running in the debug mode.
%% If so, all the errors will be displayed in the browser
%% instead of the nice error 404/501 pages.
@@ -225,7 +225,7 @@ fe_servers() ->
%% The default value is <i>false</i>.
%% @end
%%
--spec(debug_mode/0 :: () -> bool()).
+-spec(debug_mode/0 :: () -> boolean()).
debug_mode() ->
get_conf(debug_mode, false).
@@ -385,7 +385,7 @@ get_id(Id) when is_integer(Id) ->
get_id(Id) when is_list(Id) ->
Id.
--spec(is_prefix/2 :: (string(), string()) -> bool()).
+-spec(is_prefix/2 :: (string(), string()) -> boolean()).
is_prefix([], _) ->
true;
is_prefix([P | PRest], [P | ERest]) ->
@@ -92,10 +92,10 @@ reinstall() ->
ets:insert(?MODULE, [{dynamic, Dynamic}, {static, Static}]),
load_errors().
%%
-%% @spec is_static(URL :: string()) -> bool()
+%% @spec is_static(URL :: string()) -> boolean()
%% @doc Checks if the URL should be served directly from the docroot.
%%
--spec(is_static/1 :: (string()) -> bool()).
+-spec(is_static/1 :: (string()) -> boolean()).
is_static(Path) ->
[{static, Static}] = ets:lookup(?MODULE, static),
case dispatch(Path, Static) of
@@ -261,13 +261,13 @@ filter(Fun, [First|Rest]) ->
filter(Fun, Rest)
end.
--spec(selector/2 :: (string(), tuple()) -> bool()).
+-spec(selector/2 :: (string(), tuple()) -> boolean()).
selector(Element, {_, Regexp, _, []}) ->
selector_exec(Element, Regexp);
selector(Element, {_, Regexp, _, Opts}) ->
selector_exec(Element, Regexp, Opts).
--spec(selector_exec/2 :: (string(), tuple()) -> bool()).
+-spec(selector_exec/2 :: (string(), tuple()) -> boolean()).
selector_exec(Element, Regexp) ->
case re:run(Element, Regexp, [{capture,first}]) of
{match, _} ->
@@ -278,7 +278,7 @@ selector_exec(Element, Regexp) ->
exit({?MODULE, Reason})
end.
--spec(selector_exec/3 :: (string(), tuple(), list(tuple())) -> bool()).
+-spec(selector_exec/3 :: (string(), tuple(), list(tuple())) -> boolean()).
selector_exec(Element, Regexp, Opts) ->
case lists:keysearch(named_subpatterns, 1, Opts) of
false ->
@@ -194,7 +194,7 @@ scan_string([34|T], Acc) ->
scan_string([H|T], Acc) ->
scan_string(T,[H|Acc]).
--spec(scan_number/3 :: (string(), string(), bool()) -> {integer() | float(), string()}).
+-spec(scan_number/3 :: (string(), string(), boolean()) -> {integer() | float(), string()}).
scan_number([$-|T], Acc, Float) ->
scan_number(T, [$-|Acc], Float);
scan_number([$.|T], Acc, _) ->
@@ -75,7 +75,7 @@ do(#mod{parsed_header = Headers} = A) ->
end
end.
--spec(is_cacheable/0 :: () -> bool()).
+-spec(is_cacheable/0 :: () -> boolean()).
is_cacheable() ->
case e_conf:get_conf(is_cacheable_mod) of
undefined ->
@@ -100,7 +100,7 @@ check_static(Arg = #arg{req = R}, URL) ->
Arg#arg{req = R#http_request{path = {abs_path, "/app" ++ URL}}}
end.
--spec(is_cacheable/0 :: () -> bool()).
+-spec(is_cacheable/0 :: () -> boolean()).
is_cacheable() ->
case e_conf:get_conf(is_cacheable_mod) of
undefined ->
@@ -592,24 +592,24 @@ until(P, String, Parsed) ->
end.
%%--------------------------------------------------------------------
-%% @spec is_equal(string()) -> bool()
+%% @spec is_equal(string()) -> boolean()
%%
%% @doc Match = character at the head of string.
%% @end
%%--------------------------------------------------------------------
--spec is_equal(string()) -> bool().
+-spec is_equal(string()) -> boolean().
is_equal([$=|Rest]) ->
{true, Rest};
is_equal(_) ->
false.
%%--------------------------------------------------------------------
-%% @spec is_amp(string()) -> bool()
+%% @spec is_amp(string()) -> boolean()
%%
%% @doc Match &amp; character or &amp;amp; entity at the beginning of string.
%% @end
%%--------------------------------------------------------------------
--spec is_amp(string()) -> bool().
+-spec is_amp(string()) -> boolean().
is_amp("&amp;"++Rest) ->
{true, Rest};
is_amp([$&|Rest]) ->
@@ -82,7 +82,7 @@ build_html(Tpl, Vals) ->
build_html(Tpl, Vals, [])
end.
--spec(filter_slots/1 :: (term()) -> bool()).
+-spec(filter_slots/1 :: (term()) -> boolean()).
filter_slots({slot, _}) ->
false;
filter_slots(_) ->
@@ -266,7 +266,7 @@ find_pk([{_, Options} = TypeDecl | Rest], Pos) ->
find_pk([], _) ->
no_pk.
--spec(check_for_pk/1 :: (list()) -> bool()).
+-spec(check_for_pk/1 :: (list()) -> boolean()).
check_for_pk([primary_key | _]) ->
true;
check_for_pk([{primary_key} | _]) ->
@@ -92,7 +92,7 @@ get_html_tag(Attrs0, DefaultList) ->
lists:foldl(Builder, "", Options)
end.
--spec(checked/3 :: (string(), list(string()), list(string())) -> bool()).
+-spec(checked/3 :: (string(), list(string()), list(string())) -> boolean()).
checked(Value, DefaultList, Preselected) ->
lists:member(Value, DefaultList) orelse
lists:member(Value, Preselected).

0 comments on commit dbce0f7

Please sign in to comment.