-
-
Save miroswan/8c995bc761c89af9bf86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def shell_out(cmd) | |
Open3.popen2e(cmd) do |stdin, stdoe, thread| | |
stdoe.sync = true | |
puts thread.pid | |
until stdoe.eof? | |
puts stdoe.gets | |
end | |
thread.value | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment