Project

General

Profile

Bug #9480 » main.rb

joshc (Josh C), 02/04/2014 11:55 PM

 
require 'open3'

watcher = File.join(File.dirname(__FILE__), 'watcher.rb')
raise ArgumentError, "File not found #{watcher}" unless File.exists?(watcher)

cmdline = "ruby.exe '#{watcher}'"
stdin, wait_threads = Open3.pipeline_w(cmdline)
Process.detach(wait_threads[0].pid)

puts "Launched #{wait_threads[0].pid}"

stdin.puts(Process.pid)
stdin.puts(30)
stdin.puts ('this is a long command line argument containing spaces')
stdin.close

(1-1/2)