Permalink
Browse files

Merge pull request #17 from eregon/exec_default

ry exec: add an argument "all" to run with all installed rubies
  • Loading branch information...
2 parents 1e3ca40 + 47058e3 commit a429973847893a8d3acf265fc0381c66571f000a @eregon eregon committed Jul 20, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 bin/ry
View
9 bin/ry
@@ -279,10 +279,15 @@ ry::fullpath() {
#
# ry exec <name>[,<name2>[,...]] <command...>
# execute the given command in the context of the given rub{y,ies}
+# use all installed rubies if <name> is "all"
#
ry::exec() {
local names="$1"; shift
- names="$(tr , "\n" <<<"$names")"
+ if [[ "$names" == "all" ]]; then
+ names="$(ry ls)"
+ else
+ names="$(tr , "\n" <<<"$names")"
+ fi
for name in $names; do
PATH="$(ry fullpath "$name")" "$@"
@@ -337,7 +342,7 @@ ry::usage() {
ry exec <name>[,<name>[,...]] <command...>
Execute <command> in the context of each
- comma-separated ruby.
+ comma-separated ruby (or all installed rubies with "all").
ry binpath <name> Print the bin directory for the given ruby

0 comments on commit a429973

Please sign in to comment.