tags:

views:

226

answers:

2

Is it possible to run Ruby IRB ver a named pipe, so I can send commands and get results remotely?

Generally I would like to utilize the IRB engine, while have a different UI (probably written with .Net).

+2  A: 

I believe so - this worked for me (mac os x):

in terminal 1:

mkfifo rpipe

in terminal 2:

tail -f rpipe | irb

in terminal 1:

echo "puts 'hi'" > rpipe

in terminal 2 (output):

puts 'hi'
hi
nil

Kinda annoying that the original command is output as well, but close...

dbarker
+1  A: 

It seems to be (I just tried it); just pipe the I/O through your named ppipe and you're good.

But I gotta ask, why?

Specifically, why don't you just run it as a subprocess?

MarkusQ
Indeed. I guess I'll follow this path and pass stdin/stdout handles, thank you, Markus!
alex2k8