Should I create a separate issue for this?
Yes, please.
Originally posted by @dgutov in #121 (comment)
Such a function could return the command line without executing it. This will help to use the console command in ob-ruby.el.
A prototype patch also wouldn't hurt.
Sorry, I have no idea how to refactor the existing functions.