Mock Terminal Console/Live Command Updates in Ruby on Rails
In my app, a user can run a script, and if it is run in the terminal, it shows a nice progress bar, how would I replicate thi开发者_JAVA技巧s in rails? I mean I could do like something between the two to communicate, but I would prefer if it would just show a "live" shell output.
Thanks :)
If your script is invoked with 2>&1 at the end, backticks invocation will return STDOUT & STDERR.
result = ‘ls 2>&1‘
精彩评论