Pipes do work well on MacOS, but not well on Windows platform because of the way that SketchUp “steals” standard IO for it’s own Ruby Console.
If you are only going to run your extension and app on Mac, then look at:
-
IO::popen
core Ruby method -
Open3
standard library with class methods:-
Open3::popen2
- pipes for stdin, stdout -
Open3::popen2e
- pipes for stdin, merged stdout and stderr -
Open3::popen3
- pipes for stdin, stdout, stderr
-
If you also need to run on Windows platform you will need an alternative. Sockets, a local server, or write output to a file and have SketchUp Ruby read the file.
See previous discussion on pipes and IO from external processes: