Created
August 25, 2011 02:24
-
-
Save baburdick/1169819 to your computer and use it in GitHub Desktop.
A workable rvm_each
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
USAGE="Usage: $0 [gemset] command [args]" | |
# No args?: | |
if [ "$#" == "0" ]; then | |
echo "$USAGE" | |
exit 1 | |
fi | |
# gemset passed?: | |
gemset=`echo "$1" | grep -E '^@'` | |
if [ $? == 0 ]; then | |
shift | |
fi | |
rubies=$(rvm list strings) | |
for r in $rubies; do | |
command="rvm $r$gemset exec $@" | |
echo "\n\n$command:"; eval $command; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment