Let's start off with this - I'm guessing. I haven't done this before, but I am intrigued.
Have you looked in the Macro board? There are a ton of user-written macros in there.
That said, I recorded a macro to run dir and get this:
_command OS_Command() name_info(','VSARG2_MACRO|VSARG2_MARK|VSARG2_REQUIRES_MDI_EDITORCTL)
{
_macro('R',1);
_deselect();
save();
execute('dir c:\fred','a');
}
Which you could probably modify to do what you need. "dir c:\fred" is pretty self-explanatory. the 'a' argument is, I believe, the arguments to pass to the program. There is an environment variable that points to the current buffer, which you would need to pass to your Ruby script. (I'm also not a Ruby guy.)
Hope that gets you started, at least.
Jim