This repository has been archived by the owner on Jul 1, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix system call parameter for STDOUT to use :out (#124)
:out is the preferred way to redirect child process output. The current code is passing STDOUT which is actually passing the file descriptor, and works most of the time, but it will not work if the parent process has changed STDOUT to a file descriptor that the child cannot use. ``` [1] pry(main)> STDOUT = $stdout = StringIO.new (pry):1: warning: already initialized constant STDOUT => #<StringIO:0x007fe119768610> [2] pry(main)> system("echo 'hi'", STDOUT => "/dev/null") ArgumentError: wrong exec option from (pry):2:in `system' (pry):2:in `<main>' [3] pry(main)> system("echo 'hi'", :out => "/dev/null") => true ```
- Loading branch information