added status
This commit is contained in:
commit
62c3c3f766
8 changed files with 24 additions and 8 deletions
18
HOWTO
Normal file
18
HOWTO
Normal file
|
@ -0,0 +1,18 @@
|
|||
INSTALL
|
||||
1. Cd into directory where you to have the project
|
||||
2. git-clone git@github.com:jeena/GGS.git (remember to have a local key)
|
||||
3. cd GGS/
|
||||
4. git submodule init
|
||||
5. git submodule update
|
||||
6. cd erlang_js
|
||||
7. make
|
||||
8. make test (If not all tests are passed then you are screwed!)
|
||||
10. cd ../
|
||||
11. ./build
|
||||
12.
|
||||
|
||||
USAGE
|
||||
1. start a second terminal
|
||||
2. telnet localhost 7000
|
||||
3. back to first terminal
|
||||
4. ./start
|
1
build
1
build
|
@ -4,4 +4,3 @@ for i in `find src -name "*.erl"`
|
|||
do
|
||||
erlc -o ebin $i
|
||||
done
|
||||
|
||||
|
|
|
@ -15,4 +15,4 @@ while true
|
|||
line = s.gets # Read lines from the socket
|
||||
puts "Got Echo: " + line.chop # And print with platform line terminator
|
||||
end
|
||||
s.close # Close the socket when done
|
||||
s.close # Close the socket when done
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -91,11 +91,7 @@ code_change(_OldVsn, State, _Extra) ->
|
|||
%%-----------------------------------------------------
|
||||
|
||||
do_JSCall(Socket, Data) ->
|
||||
io:format("Data: ~p", [Data]),
|
||||
Port = js_runner:boot(),
|
||||
Ret = js_runner:executeJS(Port, Data),
|
||||
gen_tcp:send(Socket, io_lib:fwrite("~p~n", [Ret])).
|
||||
|
||||
args_to_terms(RawArgs) ->
|
||||
{ok, Toks, _Line} = erl_scan:string("[" ++ RawArgs ++ "]. ", 1),
|
||||
{ok, Args} = erl_parse:parse_term(Toks),
|
||||
Args.
|
||||
|
|
|
@ -8,4 +8,4 @@ boot() ->
|
|||
|
||||
executeJS(Port, Data) ->
|
||||
ok = js:define(Port, <<"function helloworld(name){return 'Hello, ' + name}">>),
|
||||
js:call(Port, <<"helloworld">>, [Data]).
|
||||
js:call(Port, <<"helloworld">>, [list_to_binary(Data)]).
|
||||
|
|
3
start
Executable file
3
start
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
erl -boot start_sasl -pa ebin -pa erlang_js/ebin/ -pa src -eval 'ggs_server:start_link(7000)'
|
Reference in a new issue