First of all, check this: [Unix pipeing] [1]
It works with windows or unix, but it is weaker than dufferent, first the program:
question.rb:
puts "This is the question"
answer.rb:
question = gets
Then at the command prompt:
On unix:
question.rb | answer.rb
In the windows:
ruby question.rb | ruby answer.rb
Output:
This is the question This is the answer
krusty.ar
source share