Ok, the title doesn't really say very much, but I couldn't think of anything better.
I'm looking for (J)Ruby library that provides a headless REPL, so to speak. Basically, I want it to take a String, and then tell me if it expects more input, otherwise eval the input so far and give me either the result or an error message.
This is for running a Ruby REPL inside a game, so I'm specifically not looking for irb.