The totally safe and sane approach is to write C code that gets passed data via the command line during execution, then vomits results to the command line or just into a memory page.
Then just execute the c program with your flags or data in the terminal using ruby and viola, ruby can run C code.
Then just execute the c program with your flags or data in the terminal using ruby and viola, ruby can run C code.