As a heavy user of regex one liners, I agree in this case, but as a heavy user of vim, there are lots of times when a macro can be recorded and run over a file long before a proper regex can be constructed, particularly in multi line settings, or those things that would require heavily nested backrefs.
cat file | perl -p -e 's-\s(.)\.rb-// Run the $1 command\ndef $1()\nend\n-'