scripts/selector in rvm-0.0.99 vs scripts/selector in rvm-0.0.999

- old
+ new

@@ -50,11 +50,12 @@ rvm_ruby_string="${rvm_ruby_string/-prc/-rc}" rvm_ruby_string="$(echo $rvm_ruby_string | sed 's#-pp#-p#')" rvm_ruby_file="rubinius-$rvm_ruby_version-$rvm_ruby_patch_level" else unset rvm_ruby_patch_level - rvm_ruby_string="$rvm_ruby_interpreter-$rvm_ruby_version-head" + unset rvm_ruby_version + rvm_ruby_string="$rvm_ruby_interpreter-head" fi ;; jruby) unset rvm_ruby_patch_level @@ -155,11 +156,11 @@ fi esac __rvm_gems_select - if [[ ! -z "$rvm_ruby_interpreter" ]] && [[ "system" != "$rvm_ruby_interpreter" ]] ; then + if [[ ! -z "$rvm_ruby_interpreter" ]] && [[ "system" != "$rvm_ruby_interpreter" ]] && [[ "default" != "$rvm_ruby_interpreter" ]] ; then if [[ ! -z "$rvm_ruby_version" ]] ; then rvm_major_version=$(echo $rvm_ruby_version | awk -F'.' '{ print $2 }') rvm_minor_version=$(echo $rvm_ruby_version | awk -F'.' '{ print $3 }') fi @@ -177,12 +178,11 @@ rvm_ruby_selected_flag=1 export rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_url rvm_ruby_patch_level rvm_ruby_configure rvm_ruby_configure_flags rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_gem_set_name rvm_gem_path rvm_ruby_gem_home rvm_path rvm_src_path rvm_bin_path rvm_ruby_binary rvm_ruby_home rvm_log_path rvm_ruby_log_path rvm_src_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string else - __rvm_unset_ruby_variables - rvm_ruby_interpreter="system" + rvm_ruby_interpreter="${rvm_ruby_interpreter:-system}" fi } __rvm_use() { if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select $* ; fi @@ -192,12 +192,12 @@ new_path=$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -) new_path=$rvm_bin_path:$new_path if [[ -s $rvm_path/default ]] ; then + unset new_path source $rvm_path/default - if [[ ! -z "$rvm_verbose_flag" ]] ; then $rvm_scripts_path/log "info" "Now using default ruby." fi else rvm_ruby_interpreter="system" @@ -210,11 +210,11 @@ unset GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC new_path=$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -) new_path=$rvm_bin_path:$new_path if [[ -s $rvm_path/system ]] ; then - grep "^MY_RUBY_HOME='$rvm_path" "$rvm_path/system" > /dev/null + grep "MY_RUBY_HOME='$rvm_path" "$rvm_path/system" > /dev/null if [[ $? -eq 0 ]] ; then rm -f $rvm_path/system # 'system' should *not* point to an rvm ruby. else source $rvm_path/system fi @@ -273,20 +273,20 @@ if [[ "system" = "$rvm_ruby_interpreter" ]] ; then rm -f $rvm_path/default rm -f $rvm_path/bin/default* else - RUBY_VERSION="$($MY_RUBY_HOME/bin/ruby -v | sed 's#^\(.*\) (.*$#\1#')" + RUBY_VERSION="$($rvm_ruby_home/bin/ruby -v | sed 's#^\(.*\) (.*$#\1#')" export GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION - echo "PATH=$MY_RUBY_HOME/bin:$GEM_HOME/bin:$rvm_path/bin:\$PATH ; export PATH" > $rvm_path/default + echo "export PATH=\"$rvm_ruby_home/bin:$rvm_ruby_gem_home/bin:$rvm_path/bin:\$PATH\"" > $rvm_path/default - for variable in RUBY_VERSION GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC rvm_ruby_string rvm_gem_set_name; do + for variable in RUBY_VERSION GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC rvm_ruby_string rvm_gem_set_name ; do eval "export $variable" eval value=\$${variable} if [[ ! -z "$value" ]] ; then - echo "${variable}='$value' ; export ${variable}" >> $rvm_path/default + echo "export ${variable}='$value'" >> $rvm_path/default else echo "unset ${variable}" >> $rvm_path/default fi done ; unset variable value @@ -328,17 +328,19 @@ for string in $(echo $ruby_string | tr '-' ' ') ; do if [[ "head" = "$string" ]] ; then rvm_ruby_revision="head" unset rvm_ruby_patch_level rvm_ruby_revision rvm_ruby_tag - rvm_head_flag=1 + export rvm_head_flag=1 elif [[ "default" = "$string" ]] ; then rvm_ruby_interpreter="default" - break + unset rvm_ruby_patch_level rvm_ruby_tag rvm_head_flag rvm_ruby_revision rvm_ruby_version rvm_gem_set_name + return elif [[ "system" = "$string" ]] ; then rvm_ruby_interpreter="system" - break + unset rvm_ruby_patch_level rvm_ruby_tag rvm_head_flag rvm_ruby_revision rvm_ruby_version rvm_gem_set_name + return elif [[ "nightly" = "$string" ]] ; then rvm_ruby_version="nightly" rvm_nightly_flag=1 break elif $rvm_scripts_path/match "$string" "^preview" ; then @@ -394,10 +396,10 @@ rvm_ruby_interpreter="jruby" fi fi # Unspecified version - if [[ -z "$rvm_ruby_version" ]] ; then + if [[ -z "$rvm_ruby_version" ]] && [[ -z "$rvm_head_flag" ]]; then rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "${rvm_ruby_interpreter}_version")"} fi if [[ -z "$rvm_ruby_version" ]] ; then rvm_ruby_string="${rvm_ruby_interpreter}"