Skip to content

Commit

Permalink
ry exec: default to all installed rubies when "all" is given
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Jul 17, 2012
1 parent ef82caf commit 47058e3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bin/ry
Expand Up @@ -258,10 +258,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")" "$@"
Expand Down Expand Up @@ -316,7 +321,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
Expand Down

0 comments on commit 47058e3

Please sign in to comment.