Skip to content

Instantly share code, notes, and snippets.

@baburdick
Created August 25, 2011 02:24
Show Gist options
  • Save baburdick/1169819 to your computer and use it in GitHub Desktop.
Save baburdick/1169819 to your computer and use it in GitHub Desktop.
A workable rvm_each
#!/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