You will need to write a C translator in Ruby, which is possible, but this may not be justified, or you can break the C code into smaller modules, which you can create Ruby wrappers as a first step. Once they are all wrapped in Ruby, and the main control flow is executed in Ruby, you can write a test harness (both to verify the replacement code and support reverse engineering) and start replacing C modules with Ruby modules.
The split and subjugation approach should work with regular Ruby if you use modules as your own extensions, but obviously this will cause additional problems if you configure something like JRuby as a runtime. If you want to do something similar in JRuby according to your comment, you are looking at packing the C modules in the JNI and calling from the JVM in this way. In any case, your C code will interact with Ruby code, but both approaches are not interchangeable.
None of the approaches will be quick, and both will work hard.
source share