Running shell scripts in Ruby

In transitioning an application from java/jsp/oracle to ruby/postygresql, there are still some java processes I’d like to keep (or rather due to time constraints not re-write). So I needed a way to call the java processes from Ruby upon user-completion of a task. In this case, it was the upload of a file for processing. 

 

After poking around with system and the `cmd` methods, I decided that open3 was the best bet. It splits out std-out, std-err and if I wanted, i could do a std-in. 

 

Here’s an example of how it’s used:

 

https://gist.github.com/763584

Leave a Reply

Powered by WordPress.com.

Up ↑

%d bloggers like this: