Rubyではパイプラインで、サブプロセスを実行し、結果を受け取れる。
例えば下は、メモ帳の実行ファイルの場所を探す

resText = ""
IO.popen("where notepad") { |io| resText = io.read }
puts resText

出力結果
C:\Windows\System32\notepad.exe
C:\Windows\notepad.exe