Skip to content

Commit

Permalink
rename time_compat module to avoid conflicts. Use new compat module.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaos committed Oct 25, 2015
1 parent 5d0d8d7 commit b58b6f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/erlydtl_filters.erl
Expand Up @@ -48,7 +48,8 @@
-export([cast_to_float/1,cast_to_integer/1,stringformat_io/7,round/2,unjoin/2,addDefaultURI/1]).
-endif.


-import(erlydtl_time_compat, [phash2/1, monotonic_time/0, unique_integer/0]).

-export([add/2,
addslashes/1,
capfirst/1,
Expand Down Expand Up @@ -539,7 +540,9 @@ random(_) ->
"".

random_num(Value) ->
_ = random:seed(now()),
random:seed(phash2([node()]),
monotonic_time(),
unique_integer()),
random:uniform(Value).

%% random tags to be used when using erlydtl in testing
Expand Down
3 changes: 2 additions & 1 deletion src/time_compat.erl → src/erlydtl_time_compat.erl
Expand Up @@ -31,7 +31,8 @@
%% instead of calling the BIFs directly.
%%

-module(time_compat).
%% use own name to avoid conflicts..
-module(erlydtl_time_compat).

%% We don't want warnings about the use of erlang:now/0 in
%% this module.
Expand Down

0 comments on commit b58b6f4

Please sign in to comment.