Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ry exec: default to all installed rubies when "all" is given

  • Loading branch information...
commit 47058e3d5bac2d723232d30c95c2d1d4a1a4be65 1 parent ef82caf
@eregon eregon authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 bin/ry
View
9 bin/ry
@@ -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")" "$@"
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.