Browse Source

n2o to n4u - include_lib - compile with Emakefile

221V 3 years ago
parent
commit
a1c0a79ff8

+ 2 - 2
.gitignore

@@ -1,7 +1,7 @@
 .DS_Store
 .eunit
 logs
-/ebin/*
+/ebin/*.beam
 *~
 .#*
 *.beam
@@ -15,4 +15,4 @@ samples/deps
 **/ebin/**
 **/Mnesia*/**
 test/bert.data
-.idea/
+.idea/

+ 1 - 1
README.md

@@ -62,7 +62,7 @@ All Features in One snippet
 -module(index).
 -compile(export_all).
 -include_lib("nitro/include/nitro.hrl").
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 
 peer()    -> io_lib:format("~p",[wf:peer(?REQ)]).
 message() -> wf:js_escape(wf:html_encode(wf:q(message))).

+ 9 - 0
ebin/n4u.app

@@ -0,0 +1,9 @@
+{application, n2o, [
+  {description, "N2O WebSocket Application Server"},
+  {vsn, "4.4.20"},
+  {applications, [kernel, stdlib, asn1, public_key, ssl, crypto, ranch, cowboy, fs, active, sh, gproc, nitro]},
+  {modules, [n2o, n2o_async, n2o_xhr, n2o_cx, n2o_cowboy, n2o_multipart, n2o_static, n2o_stream, n2o_document, n2o_proto, n2o_relay, n2o_error, n2o_io, n2o_log, n2o_mq, n2o_pickle, n2o_query, n2o_secret, n2o_session, n2o_syn, n2o_client, n2o_file, n2o_heart, n2o_http, n2o_nitrogen, n2o_text, wf, wf_convert, wf_utils]},
+  {registered, [n2o]},
+  {mod, {n2o, []}},
+  {env, []}
+]}.

+ 1 - 1
samples/apps/review/src/doc.erl

@@ -2,7 +2,7 @@
 -compile(export_all).
 -include_lib("kvs/include/feed.hrl").
 -include_lib("nitro/include/nitro.hrl").
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 
 main() -> #dtl{file="doc",app=review,bindings=[{body,body()}]}.
 

+ 1 - 1
samples/apps/review/src/index.erl

@@ -2,7 +2,7 @@
 -compile(export_all).
 -include_lib("kvs/include/entry.hrl").
 -include_lib("nitro/include/nitro.hrl").
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 
 main() ->
     case wf:user() of

+ 1 - 1
samples/apps/review/src/interlogin.erl

@@ -1,7 +1,7 @@
 -module(interlogin).
 -compile(export_all).
 -include_lib("nitro/include/nitro.hrl").
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -include_lib("kvs/include/user.hrl").
 -include_lib("avz/include/avz.hrl").
 -include_lib("kvs/include/user.hrl").

+ 1 - 1
samples/apps/review/src/login.erl

@@ -2,7 +2,7 @@
 -compile(export_all).
 -include_lib("kvs/include/feed.hrl").
 -include_lib("nitro/include/nitro.hrl").
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 
 main() -> #dtl{file="login",app=review,bindings=[{body,body()},{folders,folders()}]}.
 folders() -> string:join([filename:basename(F)||F<-filelib:wildcard(code:priv_dir(review)++"/snippets/*/")],",").

+ 1 - 1
samples/apps/review/src/routes.erl

@@ -1,6 +1,6 @@
 -module(routes).
 -author('Maxim Sokhatsky').
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -export([init/2, finish/2]).
 
 %% U can use default dynamic routes or define custom static as this

+ 1 - 1
src/endpoints/cowboy/n2o_cowboy.erl

@@ -2,7 +2,7 @@
 -description('N2O Cowboy Server Bridge to HTTP Server Pages').
 -author('Roman Shestakov').
 -behaviour(cowboy_http_handler).
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -export([init/3, handle/2, terminate/3]).
 -compile([export_all, nowarn_export_all]).
 -record(state, {headers, body}).

+ 1 - 1
src/endpoints/n2o_document.erl

@@ -1,7 +1,7 @@
 -module(n2o_document).
 -description('N2O Server Pages HTTP endpoint handler').
 -author('Maxim Sokhatsky').
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -compile([export_all, nowarn_export_all]).
 
 transition(Actions) ->

+ 1 - 1
src/endpoints/n2o_proto.erl

@@ -1,7 +1,7 @@
 -module(n2o_proto).
 -description('N2O Protocol WebSocket endpoint handler').
 -author('Maxim Sokhatsky').
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -compile([export_all, nowarn_export_all]).
 
 formatter(O)-> case lists:keyfind(formatter,1,O) of {formatter,F} -> F; X -> X end.

+ 1 - 1
src/formatters/wf_convert.erl

@@ -1,7 +1,7 @@
 -module (wf_convert).
 -author('Maxim Sokhatsky').
 -compile([export_all, nowarn_export_all]).
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 
 % WF to_atom to_list to_binary
 

+ 1 - 1
src/formatters/wf_utils.erl

@@ -1,6 +1,6 @@
 -module(wf_utils).
 -author('Rusty Klophaus').
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -compile([export_all, nowarn_export_all]).
 
 f(S) -> f(S, []).

+ 1 - 1
src/handlers/n2o_async.erl

@@ -1,6 +1,6 @@
 -module(n2o_async).
 -author('Maxim Sokhatsky').
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -behaviour(gen_server).
 -export([start_link/1]).
 -export([init/1,handle_call/3,handle_cast/2,handle_info/2,terminate/2,code_change/3]).

+ 1 - 1
src/handlers/n2o_error.erl

@@ -1,5 +1,5 @@
 -module(n2o_error).
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -compile([export_all, nowarn_export_all]).
 -export(?FAULTER_API).
 

+ 1 - 1
src/handlers/n2o_mq.erl

@@ -1,5 +1,5 @@
 -module(n2o_mq).
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -export(?MESSAGE_API).
 
 send(Pool, Message) -> gproc:send({p,l,Pool},Message).

+ 1 - 1
src/handlers/n2o_pickle.erl

@@ -1,5 +1,5 @@
 -module(n2o_pickle).
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -export(?PICKLES_API).
 
 pickle(Data) -> base64:encode(term_to_binary({Data, os:timestamp()}, [compressed])).

+ 1 - 1
src/handlers/n2o_query.erl

@@ -1,6 +1,6 @@
 -module(n2o_query).
 -author('Maxim Sokhatsky').
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -export(?QUERING_API).
 
 init(_State, Ctx) ->

+ 1 - 1
src/handlers/n2o_secret.erl

@@ -1,6 +1,6 @@
 -module(n2o_secret).
 -author('Oleksandr Nikitin').
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -compile([export_all, nowarn_export_all]).
 -export(?PICKLES_API).
 

+ 1 - 1
src/handlers/n2o_session.erl

@@ -1,6 +1,6 @@
 -module(n2o_session).
 -author('Dmitry Krapivnoy').
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -include_lib("stdlib/include/ms_transform.hrl").
 -compile([export_all, nowarn_export_all]).
 

+ 1 - 1
src/handlers/n2o_syn.erl

@@ -1,5 +1,5 @@
 -module(n2o_syn).
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -export(?MESSAGE_API).
 
 send(Pool, Message) -> syn:publish(term_to_binary(Pool),Message).

+ 1 - 1
src/n2o.app.src

@@ -3,7 +3,7 @@
     {vsn,          "4.4.20"},
     {applications, [kernel, stdlib, cowboy]},
     {modules, []},
-    {registered,   []},
+    {registered,   [n2o]},
     {mod, { n2o,   []}},
     {env, []}
 ]}.

+ 1 - 1
src/n2o.erl

@@ -1,7 +1,7 @@
 -module(n2o).
 -description('N2O OTP Application Server').
 -behaviour(supervisor).
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -behaviour(application).
 -export([start/2, stop/1, init/1, proc/2]).
 

+ 1 - 1
src/n2o_cx.erl

@@ -1,7 +1,7 @@
 -module(n2o_cx).
 -description('N2O Process Context').
 -author('Rusty Klophaus').
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -compile([export_all, nowarn_export_all]).
 
 actions() -> get(actions).

+ 1 - 1
src/protocols/n2o_client.erl

@@ -1,6 +1,6 @@
 -module(n2o_client).
 -author('Maxim Sokhatsky').
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -compile([export_all, nowarn_export_all]).
 
 info({client,Message}, Req, State) ->

+ 1 - 1
src/protocols/n2o_file.erl

@@ -1,6 +1,6 @@
 -module(n2o_file).
 -author('Andrii Zadorozhnii').
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -include_lib("kernel/include/file.hrl").
 -compile([export_all, nowarn_export_all]).
 

+ 1 - 1
src/protocols/n2o_heart.erl

@@ -1,6 +1,6 @@
 -module(n2o_heart).
 -author('Maxim Sokhatsky').
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -compile([export_all, nowarn_export_all]).
 
 info({text,<<"PING">> = _Ping}=Message, Req, State) ->

+ 1 - 1
src/protocols/n2o_http.erl

@@ -1,5 +1,5 @@
 -module(n2o_http).
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -compile([export_all, nowarn_export_all]).
 
 %% ws.send(enc(tuple(atom('http'), bin(url), bin(method), bin(body), [])));

+ 1 - 1
src/protocols/n2o_nitrogen.erl

@@ -1,6 +1,6 @@
 -module(n2o_nitrogen).
 -author('Maxim Sokhatsky').
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -compile([export_all, nowarn_export_all]).
 
 % Nitrogen pickle handler

+ 1 - 1
src/protocols/n2o_text.erl

@@ -1,6 +1,6 @@
 -module(n2o_text).
 -author('Alexander Salnikov').
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -compile([export_all, nowarn_export_all]).
 
 info({text,Text}=Message, Req, State) when is_binary(Text) ->

+ 2 - 2
src/wf.erl

@@ -1,8 +1,8 @@
 -module(wf).
 -author('Rusty Klophaus').
 -author('Maxim Sokhatsky').
--include_lib("n2o/include/wf.hrl").
--include_lib("n2o/include/api.hrl").
+-include_lib("n4u/include/wf.hrl").
+-include_lib("n4u/include/api.hrl").
 -compile([export_all, nowarn_export_all]).
 
 -define(ACTION_BASE(Module), ancestor=action, trigger, target, module=Module, actions, source=[]).

+ 1 - 1
test/elements.erl

@@ -1,5 +1,5 @@
 -module(elements).
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -include_lib("common_test/include/ct.hrl").
 -compile(export_all).
 

+ 1 - 1
test/n2o_SUITE.erl

@@ -1,7 +1,7 @@
 -module(n2o_SUITE).
 -behaviour(cowboy_http_handler).
 -include_lib("common_test/include/ct.hrl").
--include_lib("n2o/include/wf.hrl").
+-include_lib("n4u/include/wf.hrl").
 -compile(export_all).
 
 suite() -> [{timetrap,{seconds,30}}].