This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Run the following if you haven't already:
gem sources -a http://gems.github.com
Install the gem(s):
sudo gem install mojombo-erlectricity
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Wed Jun 04 23:24:43 -0700 2008 | [mojombo] |
| |
CONTRIBUTORS | Fri Mar 07 15:16:07 -0800 2008 | [mojombo] |
| |
History.txt | Fri Mar 07 15:16:07 -0800 2008 | [mojombo] |
| |
Manifest.txt | Fri Mar 07 15:40:39 -0800 2008 | [mojombo] |
| |
README.txt | Thu Jun 05 00:05:40 -0700 2008 | [mojombo] |
| |
Rakefile | Fri Mar 07 15:18:47 -0800 2008 | [mojombo] |
| |
erlectricity.gemspec | Wed Jun 04 23:51:27 -0700 2008 | [mojombo] |
| |
examples/ | Wed Jun 04 23:23:08 -0700 2008 | [mojombo] |
| |
ext/ | Fri Mar 07 17:30:29 -0800 2008 | [mojombo] |
| |
lib/ | Fri Mar 07 17:30:29 -0800 2008 | [mojombo] |
| |
setup.rb | Fri Mar 07 15:16:07 -0800 2008 | [mojombo] |
| |
test/ | Fri Mar 07 17:30:29 -0800 2008 | [mojombo] |
README.txt
erlectricity
by Scott Fleckenstein
Tom Preston-Werner
http://github.com/mojombo/erlectricity
== DESCRIPTION:
Erlectricity allows a Ruby program to receive and respond to Erlang messages
sent over the Erlang binary protocol.
== INSTALL:
$ gem install erlectricity
-or-
$ gem install mojombo-erlectricity -s http://gems.github.com
== CONTRIBUTE:
Contributions are welcome via GitHub! Fork the code from
http://github.com/mojombo/erlectricity and send a pull request to mojombo.
== USAGE (Ruby side):
require 'rubygems'
require 'erlectricity'
require 'stringio'
receive do |f|
f.when(:echo, String) do |text|
f.send!(:result, "You said: #{text}")
f.receive_loop
end
end
== USAGE (Erlang side):
-module(echo).
-export([test/0]).
test() ->
Cmd = "ruby echo.rb",
Port = open_port({spawn, Cmd}, [{packet, 4}, use_stdio, exit_status, binary]),
Payload = term_to_binary({echo, <<"hello world!">>}),
port_command(Port, Payload),
receive
{Port, {data, Data}} ->
{result, Text} = binary_to_term(Data),
io:format("~p~n", [Text])
end.



