[Ruby] Launching script/runner from within Rails

Eric Hodel drbrain at segment7.net
Fri Feb 9 14:52:31 PST 2007


On Feb 9, 2007, at 13:58, Mike Mondragon wrote:
> I couldn't get rmagick to install onto a FreeBSD box so I just use the
> real Image Magic composite program to process an image.  Page 141 of
> the PickAxe book shows an exec/wait example for long running processes
> and that's what I use.  The output still goes to standard out.  How
> would I control output of the long running process in such a way as
> the back tick style?  Or is there a way to wait on a subprocess spun
> from the back tick?
>
> wm="/usr/bin/composite -gravity southeast -watermark 25 #{wmimg}
> #{inimg} #{outimg}"
> exec(wm) if fork.nil?
`#{wm}`
> Process.wait

See also the ri for Process.wait, popen and open3


More information about the Ruby mailing list