Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
cmd = ~S"""
ruby -e '
STDOUT.sync = true
context = binding
while (cmd = gets) do
eval(cmd, context)
port ={:spawn, cmd}, [:binary])
Port.command(port, "a = 1\n")
Port.command(port, "a += 2\n")
Port.command(port, "puts a\n")
receive do
{^port, {:data, result}} ->
IO.puts("Elixir got: #{inspect result}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment