scripts/set in rvm-1.0.21 vs scripts/set in rvm-1.0.22

- old
+ new

@@ -21,11 +21,11 @@ # Return on invalid rubies. __rvm_become "$current_set_ruby" || return 1 if [[ "$action" = "exec" ]]; then # Exec is a special case. - rvm_command="${args[@]}" + command="${args[@]}" else binary="$(echo $action | sed 's#do$##')" @@ -68,26 +68,25 @@ load_path="$(dirname $(command -v $binary) 2>/dev/null):$rvm_ruby_load_path" # TODO: the else case below should be run if $args =~ /\.rb$/ if [[ "ruby" = "$(basename $binary)" && "$rvm_benchmark_flag" -ne 1 ]] ; then - if "$rvm_path/scripts/match" "${args[@]}" "\.rb$" ; then + case "${args[@]}" in - if [[ -z "$prefix" ]] ; then prefix="-S" ; fi + *[:space:]-S[:space:]*) + command="$binary $rvm_ruby_mode $rvm_ruby_require -I$load_path ${args[@]}" + ;; - if ! "$rvm_path/scripts/match" "${args[@]}" "$prefix" ; then + *) + command="$binary $rvm_ruby_mode $rvm_ruby_require -I$load_path -S ${args[@]}" + ;; - args=($prefix ${args[@]}) + esac - fi - fi - - rvm_command="$binary $rvm_ruby_mode $rvm_ruby_require -I$load_path ${args[@]}" - else - rvm_command="$binary $rvm_ruby_mode ${args[@]}" + command="$binary $rvm_ruby_mode ${args[@]}" fi fi @@ -97,11 +96,11 @@ mkdir -p "./log/$rvm_ruby_string/" fi touch ./log/$rvm_ruby_string/$action.log ./log/$rvm_ruby_string/$action.error.log - eval "$rvm_command" \ + eval "$command" \ >> ./log/$rvm_ruby_string/$action.log \ 2>> ./log/$rvm_ruby_string/$action.error.log else if [[ ${rvm_verbose_flag:-0} -gt 0 ]] ; then @@ -117,10 +116,10 @@ "$rvm_path/scripts/log" "info" \ "$current_env: $(ruby -v $rvm_ruby_mode | \tr "\n" ' ')\n" unset current_env fi - eval "$rvm_command" + eval "$command" fi result=$? string=$(basename $rvm_ruby_gem_home)