Browse Source

Merge branch 'master' of github.com:synrc/mad

Maxim Sokhatsky 10 years ago
parent
commit
fa6e889713
4 changed files with 30 additions and 9 deletions
  1. 4 4
      doc/index.tex
  2. 1 0
      doc/web/index.tex
  3. 18 0
      priv/reltool.config
  4. 7 5
      src/mad_repl.erl

+ 4 - 4
doc/index.tex

@@ -12,15 +12,15 @@ common use-case in N2O is to recompile DTL templates
 and LESS/SCSS stylesheets. That is why we need to recompile
 the whole project. That's the story how \footahref{https://github.com/synrc/active}{active} emerged.
 Under the hood active is a client subscriber
-of fs library, native filesystem listener for Linux, Windows and Mac.
+of \footahref{https://github.com/synrc/fs}{fs} library, native filesystem listener for Linux, Windows and Mac.
 
 De-facto standard in Erlang world is rebar.
 We love rebar interface despite its implementation.
-First we plugged rebar into active and then decided to drop its support.
-Later switched to Makefile-based build tool otp.mk.
-And of course it was slow, especially in cold recompilation.
+First we plugged rebar into active and then decided to drop its support,
+it was slow, especially in cold recompilation.
 It was designed to be a stand-alone tool, so it has some
 glitches while using as embedded library.
+Later we switched to Makefile-based build tool \footahref{https://github.com/synrc/otp.mk}{otp.mk}.
 
 The idea to build rebar replacement was up in the air for a long time.
 The best minimal approach was picked up by \footahref{https://github.com/s1n4}{Sina~Samavati},

+ 1 - 0
doc/web/index.tex

@@ -9,6 +9,7 @@
 \input{toc}
 %HEVEA \begin{divstyle}{articlecol}
 \include{../index}
+%HEVEA \rawhtmlinput{templates/mad-comments.htx}
 %HEVEA \rawhtmlinput{templates/disqus.htx}
 %HEVEA \end{divstyle}
 %HEVEA \end{divstyle}

+ 18 - 0
priv/reltool.config

@@ -0,0 +1,18 @@
+{sys, [
+       {lib_dirs, ["apps","deps"]},
+       {erts, [{mod_cond, derived}, {app_file, strip}]},
+       {app_file, strip},
+       {rel, "node", "1", MAD_APPS },
+       {rel, "start_clean", "", [ kernel, stdlib ]},
+       {boot_rel, "node"},
+       {profile, embedded},
+       {incl_cond, derived},
+       {mod_cond, derived},
+       {excl_archive_filters, [".*"]},
+       {excl_sys_filters, ["^bin/.*", "^erts.*/bin/(dialyzer|typer)",
+                           "^erts.*/(doc|info|include|lib|man|src)"]},
+       {excl_app_filters, ["\.gitignore"]},
+       {app, hipe, [{mod_cond, app}, {incl_cond, exclude}]}
+      ]}.
+
+{target_dir, "node"}.

+ 7 - 5
src/mad_repl.erl

@@ -80,11 +80,7 @@ main(Params) ->
         _ ->  timer:sleep(infinity) end.
 
 load() ->
-
-    case ets:info(filesystem) of
-         undefined -> ets:new(filesystem,[set,named_table,{keypos,1},public]);
-         _ -> skip end,
-
+    ets_created(),
     {ok,Sections} = escript:extract(escript:script_name(),[]),
     [Bin] = [B||{archive,B}<-Sections],
     unfold_zips(Bin).
@@ -99,7 +95,13 @@ unfold_zips(Bin) ->
             _ -> skip end
       end || {U,FileBin} <- Unzip].
 
+ets_created() -> 
+    case ets:info(filesystem) of
+         undefined -> ets:new(filesystem,[set,named_table,{keypos,1},public]);
+         _ -> skip end.
+
 load_file(Name)  ->
+    ets_created(),
     case ets:lookup(filesystem,Name) of
         [{Name,Bin}] -> Bin;
         _ -> <<>> end.