Refactor do-each to use Ruby

Writing long, inline shell commands for the more complicated aliases is
annoying. Let's use Ruby instead!