From 47058e3d5bac2d723232d30c95c2d1d4a1a4be65 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Fri, 1 Jun 2012 22:49:02 +0200 Subject: [PATCH] ry exec: default to all installed rubies when "all" is given --- bin/ry | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/ry b/bin/ry index 43ccd27..1cdabd5 100755 --- a/bin/ry +++ b/bin/ry @@ -258,10 +258,15 @@ ry::fullpath() { # # ry exec [,[,...]] # execute the given command in the context of the given rub{y,ies} +# use all installed rubies if 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 [,[,...]] Execute in the context of each - comma-separated ruby. + comma-separated ruby (or all installed rubies with "all"). ry binpath Print the bin directory for the given ruby