scripts/utility in rvm-0.0.79 vs scripts/utility in rvm-0.0.80

- old
+ new

@@ -379,17 +379,23 @@ fi } __rvm_list() { if [[ ! -z "$rvm_all_flag" ]] ; then - svn list http://svn.ruby-lang.org/repos/ruby/tags/ | grep 'v1_[8|9]' | sed 's#^v1_##' | sed 's#/$##' | awk -F'_' '{print "1."$1"."$2 " -l "$3}' | sed 's#p$##' - echo -e "jruby 1.2.0\njruby 1.3.0\njruby 1.3.1\njruby (1.4.0, the default)\njruby --head" - echo -e "rbx (rubinius head, the default)\nrbx-head --jit" - echo -e "ree 1.8.6-head\nree (1.8.7, the default)" - echo -e "mput head (shyouhei head, the default)" + while read -r tag + do + prefix="$(echo ${tag/\//} | sed 's#^v1_##' | awk -F'_' '{print "(ruby-)1."$1"."$2}' | sed 's#p$##')" + echo "${prefix}-t${tag/\//}" + unset prefix tag + done < <(svn list http://svn.ruby-lang.org/repos/ruby/tags/ | awk '/^v1_[8|9]/') + echo -e "(ruby-)1.8.6(-p383)\n(ruby-)1.8.6-head\n(ruby-)1.8.7(-p174)\n(ruby-)1.8.7-head\n(ruby-)1.9.1(-p243)\n(ruby-)1.9.1-head\n(ruby-)1.9.2-preview1" + echo -e "jruby-1.2.0\njruby-1.3.0\njruby-1.3.1\njruby(-1.4.0) # the default\njruby-head" + echo -e "rbx(-head) # rubinius head, the default rbx \nrbx(-head) --jit (rubinius head with LLVM enabled)" + echo -e "ree-1.8.6\nree(-1.8.7) # the default\nree-1.8.6-head\nree-1.8.7-head" + echo -e "mput(-head) # shyouhei head, the default mput" if [[ "Darwin" = "$(uname)" ]] ; then - echo -e "macruby-nightly (macruby-nightly, the default)\nmacruby-head" + echo -e "macruby(-nightly) # the default macruby\nmacruby-head # Build from the macruby git repository" fi else current_ruby="$(which ruby | xargs dirname | xargs dirname | xargs basename 2> /dev/null)" for version in $(\ls -l $rvm_path/ 2> /dev/null | awk '/ ruby-[1-2].*/ { print $NF }') ; do string=$($rvm_path/$version/bin/ruby -v) @@ -582,44 +588,50 @@ __rvm_ruby_do() { __rvm_select __rvm_use binary="$(echo $rvm_action | sed 's#do$##')" if [[ -x "$rvm_ruby_home/bin/$binary" ]] ; then - load_path="$rvm_ruby_home/bin:$rvm_ruby_load_path" - # TODO: the else case below should be run if $rvm_ruby_args =~ /\.rb$/ - if [[ "ruby" = "$binary" ]] && [[ "$rvm_benchmark_flag" -ne 1 ]] ; then - if match "$rvm_ruby_args" "\.rb$" ; then - if [[ -z "$prefix" ]] ; then prefix="-S" ; fi - if ! match "$rvm_ruby_args" "$prefix" ; then - rvm_ruby_args="$prefix $rvm_ruby_args" - fi + binary="$rvm_ruby_home/bin/$binary" + elif [[ "system" = "$rvm_ruby_string" ]] && [[ -x "$(which $binary)" ]] ; then + binary="$(which $binary)" + else + __rvm_log "warn" "'$binary not found for $rvm_ruby_string' either does not exist or is not executable? :(" + __rvm_unset_ruby_variables + return 1 + fi + + load_path="$rvm_ruby_home/bin:$rvm_ruby_load_path" + # TODO: the else case below should be run if $rvm_ruby_args =~ /\.rb$/ + if [[ "ruby" = "$binary" ]] && [[ "$rvm_benchmark_flag" -ne 1 ]] ; then + if match "$rvm_ruby_args" "\.rb$" ; then + if [[ -z "$prefix" ]] ; then prefix="-S" ; fi + if ! match "$rvm_ruby_args" "$prefix" ; then + rvm_ruby_args="$prefix $rvm_ruby_args" fi - rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_require -I$load_path $rvm_ruby_args" - elif [[ "gem" = "$binary" ]] && match "$rvm_ruby_args" '^install' ; then - rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_args --no-rdoc --no-ri" - else - rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_args" fi + rvm_command="$binary $rvm_ruby_require -I$load_path $rvm_ruby_args" + elif [[ "gem" = "$binary" ]] && match "$rvm_ruby_args" '^install' ; then + rvm_command="$binary $rvm_ruby_args --no-rdoc --no-ri" + else + rvm_command="$binary $rvm_ruby_args" + fi - if [[ ! -z "$rvm_json_flag" ]] || [[ ! -z "$rvm_yaml_flag" ]] || [[ ! -z "$rvm_summary_flag" ]] ; then - mkdir -p ./log/$rvm_ruby_string/ - touch ./log/$rvm_ruby_string/$rvm_action.log ./log/$rvm_ruby_string/$rvm_action.error.log - eval "$rvm_command" >> ./log/$rvm_ruby_string/$rvm_action.log 2>> ./log/$rvm_ruby_string/$rvm_action.error.log - else - echo -e "\n\n\033[0;32m$rvm_ruby_string: $($rvm_ruby_home/bin/ruby -v | tr "\n" ' ')\033[0m\n" - eval "$rvm_command" - fi - result=$? - if [[ $result -eq 0 ]]; then - eval "successes=(${successes[*]} $rvm_ruby_string)" - else - eval "errors=(${errors[*]} $rvm_ruby_string)" - fi - eval "rubies=(${rubies[*]} $rvm_ruby_string)" - eval "statuses=(${statuses[*]} $result)" + if [[ ! -z "$rvm_json_flag" ]] || [[ ! -z "$rvm_yaml_flag" ]] || [[ ! -z "$rvm_summary_flag" ]] ; then + mkdir -p ./log/$rvm_ruby_string/ + touch ./log/$rvm_ruby_string/$rvm_action.log ./log/$rvm_ruby_string/$rvm_action.error.log + eval "$rvm_command" >> ./log/$rvm_ruby_string/$rvm_action.log 2>> ./log/$rvm_ruby_string/$rvm_action.error.log else - __rvm_log "warn" "'$rvm_ruby_home/bin/$binary' either does not exist or is not executable? :(" + echo -e "\n\n\033[0;32m$rvm_ruby_string: $($rvm_ruby_home/bin/ruby -v | tr "\n" ' ')\033[0m\n" + eval "$rvm_command" fi + result=$? + if [[ $result -eq 0 ]]; then + eval "successes=(${successes[*]} $rvm_ruby_string)" + else + eval "errors=(${errors[*]} $rvm_ruby_string)" + fi + eval "rubies=(${rubies[*]} $rvm_ruby_string)" + eval "statuses=(${statuses[*]} $result)" __rvm_unset_ruby_variables } __rvm_do() { __rvm_state