subexec
subexec copied to clipboard
Deprecate this gem
This gem doesn't have a good implementation:
- It uses
sleep 0.01for waiting for the command to finish, which is very CPU heavy and definitively not the right way (you can do the waiting withIO.pipe, as shown in this blog post) - It captures stdout and stderr both in the same string, which is unusable when we actually care which is which
Most-importantly, there is already an implementation of this gem in the Ruby standard library, called open3. The Open3.catpure3 does everything that this gem does, but better and with automatic Windows support and similar. It doesn't however work on JRuby, because they didn't implement it, but they're fixing it.