Namdak Tonpa 5 лет назад
Родитель
Сommit
f28ec1d0c6
6 измененных файлов с 7 добавлено и 18 удалено
  1. 3 1
      .travis.yml
  2. 1 1
      mix.exs
  3. 1 1
      src/nitro.app.src
  4. 1 0
      src/nitro.erl
  5. 0 14
      src/nitro_conv.erl
  6. 1 1
      src/nitro_static.erl

+ 3 - 1
.travis.yml

@@ -1,4 +1,6 @@
 language: erlang
 otp_release:
   - 19.3
-script: "curl -fsSL https://raw.github.com/synrc/mad/master/mad > mad && chmod +x mad && ./mad dep com"
+script:
+  - "curl -fsSL https://raw.github.com/synrc/mad/master/mad > mad && chmod +x mad && ./mad dep com"
+  - "rebar3 dialyzer"

+ 1 - 1
mix.exs

@@ -4,7 +4,7 @@ defmodule NITRO.Mixfile do
   def project do
     [
       app: :nitro,
-      version: "4.10.7",
+      version: "4.10.8",
       description: "NITRO Nitrogen Web Framework",
       package: package(),
       deps: deps()

+ 1 - 1
src/nitro.app.src

@@ -1,6 +1,6 @@
 {application, nitro, [
     {description,  "NITRO Nitrogen Web Framework"},
-    {vsn,          "4.10.7"},
+    {vsn,          "4.10.8"},
     {applications, [kernel, stdlib]},
     {modules, []},
     {registered,   []},

+ 1 - 0
src/nitro.erl

@@ -193,6 +193,7 @@ hide(Element) -> display(Element,none).
 compact([]) -> "[]";
 compact("\n") -> "[]";
 compact([X|_]=Y) when is_tuple(X) -> [ compact(F) || F <- Y ];
+compact(Tuple) when is_binary(Tuple) -> unicode:characters_to_binary(Tuple);
 compact(Tuple) when is_tuple(Tuple) ->
      Min = erlang:min(9,size(Tuple)),
      Fields = lists:zip(lists:seq(1,Min),lists:sublist(tuple_to_list(Tuple),1,Min)),

+ 0 - 14
src/nitro_conv.erl

@@ -197,17 +197,3 @@ config(App, Key, Default) -> application:get_env(App,Key,Default).
 os_env(Key) -> os_env(Key, "").
 os_env(Key, Default) -> case os:getenv(Key) of false -> Default; V -> V end.
 
-stack(Error, Reason) ->
-    Stacktrace = [case A of
-         { Module,Function,Arity,Location} ->
-             { Module,Function,Arity,proplists:get_value(line, Location) };
-         Else -> Else end
-    || A <- erlang:get_stacktrace()],
-    [Error, Reason, Stacktrace].
-
-error_page(Class,Error) ->
-    io_lib:format("ERROR:  ~w:~w~n~n",[Class,Error]) ++
-    "STACK: " ++
-    [ wf_render:render([io_lib:format("\t~w:~w/~w:~w",
-        [ Module,Function,Arity,proplists:get_value(line, Location) ]),"\n"])
-    ||  { Module,Function,Arity,Location} <- erlang:get_stacktrace() ].

+ 1 - 1
src/nitro_static.erl

@@ -61,7 +61,7 @@ get_file(Req, State={P, {ok, #file_info{size=_Size}}, _}) ->
               case mad_repl:load_file(StringPath) of
                    {ok,ETSFile} -> ETSFile;
                    {error,_} ->
-                        case file:read_file(filename:join([code:lib_dir(Name)|RestPath])) of
+                        case file:read_file(filename:join([ code:lib_dir(list_to_atom(Name))|RestPath])) of
                              {ok,ReleaseFile} -> ReleaseFile;
                              {error,_} -> <<>> end end end,
     Sendfile = fun (Socket, Transport) -> Transport:send(Socket, Raw) end,