scripts/set in rvm-1.0.11 vs scripts/set in rvm-1.0.13

- old
+ new

@@ -1,10 +1,11 @@ #!/usr/bin/env bash source "$rvm_path/scripts/base" -__rvm_attempt_single_exec() { +__rvm_attempt_single_exec() +{ # Return if we have multiple rubies. or we're not running exec. if [[ "$action" = "exec" && ${#rvm_ruby_strings[@]} -lt 2 ]]; then __rvm_become "$rvm_ruby_strings" @@ -13,12 +14,12 @@ return 1 } # Perform an action using one of a selected ruby's specified binaries. -__rvm_ruby_do() { - +__rvm_ruby_do() +{ # Return on invalid rubies. __rvm_become "$current_set_ruby" || return 1 if [[ "$action" = "exec" ]]; then # Exec is a special case. @@ -142,11 +143,12 @@ __rvm_unset_ruby_variables } # Output the summary in a human readable format. -__rvm_summary() { +__rvm_summary() +{ export successes errors statuses summary="\nSummary:\n\n" if [[ ${#successes[*]} -gt 0 ]] ; then @@ -170,12 +172,12 @@ return ${#errors[*]} } # Output the summary in a yaml format. -__rvm_yaml() { - +__rvm_yaml() +{ export successes errors statuses yaml="totals:\n rubies: ${#rubies[*]}\n successes: ${#successes[*]}\n errors: ${#errors[*]}\nsuccesses:" for var in ${successes[*]} ; do yaml="$yaml\n - $var" ; done @@ -208,11 +210,11 @@ return ${#errors[*]} } # Output the summary in a json format. -__rvm_json() { - +__rvm_json() +{ local index array_start json="{ \"totals\": { \"rubies\": ${#rubies[*]}, \"successes\": ${#successes[*]}, \"errors\": ${#errors[*]} }, \"successful\": [$(echo \"${successes[*]}\" | sed 's# #", "#g' | sed 's#\"\"##')],