Is there some way to run a (shell) command from Ruby displaying but also capturing the output? Maybe with the help of some gem?
What I mean by displaying is not prin
If you are willing to explore a solution outside the standard library, you may also use Mixlib::ShellOut to both stream output and capture it:
require 'mixlib/shellout' cmd = 'while true; do date; sleep 2; done' so = Mixlib::ShellOut.new(cmd) so.live_stream = $stdout so.run_command out = so.stdout