Call Erlang from Ruby
What is the most awesom开发者_Go百科e 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?
Well. I am using BERT-RPC and happy with it.
http://github.com/mojombo/bertrpc
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
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.
精彩评论