Permalink
Browse files

don't fetch list of types and extensions from server

  • Loading branch information...
1 parent 915050d commit 2a430ec73aa4acce388fb827389f6f7abca6b247 Magnus Klaar committed Sep 9, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/mimetypes.erl
View
@@ -40,10 +40,10 @@ extensions(Type) when is_binary(Type) ->
types() ->
- gen_server:call(?SERVER, types).
+ ?MAPMOD:mimes().
extensions() ->
- gen_server:call(?SERVER, extensions).
+ ?MAPMOD:exts().
%%--------------------------------------------------------------------
@@ -241,7 +241,7 @@ map_to_abstract_(Module, Pairs) ->
erl_syntax:integer(0)),
%% mimes/0
erl_syntax:arity_qualifier(
- erl_syntax:atom(exts),
+ erl_syntax:atom(mimes),
erl_syntax:integer(0))])]),
%% ext_to_mimes(Extension) -> [MimeType].
erl_syntax:function(
@@ -321,6 +321,8 @@ codegen_test() ->
ok = load_mapping([{<<"b">>, <<"a">>}]),
?MAPMOD:module_info(),
?assertEqual([<<"a">>], ?MAPMOD:ext_to_mimes(<<"b">>)),
- ?assertEqual([<<"b">>], ?MAPMOD:mime_to_exts(<<"a">>)).
+ ?assertEqual([<<"b">>], ?MAPMOD:mime_to_exts(<<"a">>)),
+ ?assertEqual([<<"b">>], ?MAPMOD:exts()),
+ ?assertEqual([<<"a">>], ?MAPMOD:mimes()).
-endif.

0 comments on commit 2a430ec

Please sign in to comment.