tags:

views:

244

answers:

4

What is the most awesome gem I should use to call Erlang functions from Ruby app? I wish to use rspec for testing some gen_server stuff.

Erlectricity looking solid, but there is no something like Node#rpc, just message passing. Any ideas?

A: 

Or do you mean "I have a running erl node that expose some functions from a module via tcp/ip or a stdin/stdout"

"send rpc calls to an erlang node from ruby program"

Sam
D'oh, it's not an answer, just comment.
Sam
I still don't get what you meanin pure erlang rpc:call(fooNode@localhost, modulename, functionname, [Parameter1,Parameter2]), you can do but if you are OutSide erlang you must expose and write some custom driver or as you suggested yourself use Erlectricity but then you must write something in ruby and erlang. Erlectricity is basically in erlang just a port driver Port = open_port({spawn, Cmd}, [{packet, 4}, nouse_stdio, exit_status, binary]),and even if its useful I would suggest you don't use it to rspec a gen_server
Jonke
gah, sorry for the yoda talk, I suffer from brain overload apparently
Jonke
A: 

I think (someone prove me wrong) that you shouldn't use rspec for a gen_server at all. Instead you could, depening on what your gen_server actually does, use eunit. http://salientblue.com/codenotes/?name=erl_start and no, its a long way from rspec.

Jonke
+1  A: 

For rpc calls, rinterface might be the right option. From the README:

r = Erlang::Node.rpc("math","math_server","add",[10,20])
if r[0] == :badrpc
   puts "Got and Error. Reason #{r[1]}"
else
   puts "Success: #{r[1]}"
end
Felix Lange
A: 

Well. I am using BERT-RPC and happy with it.

http://github.com/mojombo/bertrpc

Sam