How can I echo from Ruby shell scripts in chunks?

I set up the deployment mini-system using the Ruby and Sinatra and Shell scripts, and when I run the deployment script, I would like ruby ​​to continue echoing from the following:

post '/' do
  `/home/deploy/deploy.sh`
end

How can I guarantee that Ruby will echo and send back a response (so that the content can continue to load)?

Thank!

+3
source share
1 answer

Here you have two problems:

  • How to get the output of a command while running it?
  • Inside Sinatra, how do I pass the response to the user?
+1
source

All Articles