scripts/selector in rvm-0.1.47 vs scripts/selector in rvm-1.0.0

- old
+ new

@@ -2,14 +2,14 @@ # __rvm_select implementation version patch_level __rvm_select() { if [[ -z "$rvm_ruby_string" ]] ; then rvm_ruby_string="${rvm_ruby_interpreter}" - if [[ -n "$rvm_ruby_version" ]] ; then rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_version" ; fi - if [[ -n "$rvm_ruby_patch_level" ]] ; then rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_patch_level" ; fi - if [[ -n "$rvm_ruby_revision" ]] ; then rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_revision" ; fi - if [[ -n "$rvm_ruby_name" ]]; then rvm_ruby_name="$rvm_ruby_string-n$rvm_ruby_name"; fi + [[ -n "$rvm_ruby_version" ]] && rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_version" + [[ -n "$rvm_ruby_patch_level" ]] && rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_patch_level" + [[ -n "$rvm_ruby_revision" ]] && rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_revision" + [[ -n "$rvm_ruby_name" ]] && rvm_ruby_name="$rvm_ruby_string-n$rvm_ruby_name" fi __rvm_ruby_string rvm_archive_extension="tar.gz" @@ -145,14 +145,17 @@ rvm_url=$rvm_ruby_repo_url unset rvm_ruby_configure rvm_ruby_make rvm_ruby_make_install ;; ruby) - if [[ -z "$rvm_ruby_version" ]] && [[ -z "$rvm_head_flag" ]]; then + if [[ -z "$rvm_ruby_version" && -z "$rvm_head_flag" ]]; then $rvm_scripts_path/log "fail" "Unknown ruby version: $rvm_ruby_version" else rvm_ruby_repo_url="${rvm_ruby_repo_url:-"$(__rvm_db "ruby_repo_url")"}" + if [[ -z "$rvm_head_flag" ]]; then + rvm_archive_extension="tar.bz2" + fi fi ;; current) ruby_binary="$(command -v ruby)" @@ -227,11 +230,11 @@ unset GEM_HOME GEM_PATH BUNDLE_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_config_path/system ]] ; then - grep "MY_RUBY_HOME='$rvm_rubies_path" "$rvm_config_path/system" > /dev/null + \grep "MY_RUBY_HOME='$rvm_rubies_path" "$rvm_config_path/system" > /dev/null if [[ $? -eq 0 ]] ; then [[ -f "$rvm_config_path/system" ]] && \rm -f $rvm_config_path/system # 'system' should *not* point to an rvm ruby. else source "$rvm_config_path/system" fi @@ -336,10 +339,12 @@ $MAGLEV_HOME/gemstone/bin/gslist -clv > /dev/null 2>&1 ; result=$? if [[ $result -eq 1 ]] ; then $rvm_ruby_home/bin/maglev start ; fi fi fi + # Rehash executable locations, e.g. to force the shell to recognize new items in the path. + builtin hash -r rvm_hook="after_use" ; source $rvm_scripts_path/hook } __rvm_ruby_string() { # rvm_ruby_string may designate any of the following items: @@ -557,10 +562,10 @@ rvm_ruby_gem_path="$rvm_ruby_gem_home:$rvm_ruby_global_gems_path" # Ensure that the ruby gem home exists. \mkdir -p "$rvm_ruby_gem_home" - if [[ -n "$rvm_ruby_gem_home" ]] && echo "$rvm_ruby_gem_home" | grep -q 'rvm'; then + if [[ -n "$rvm_ruby_gem_home" ]] && echo "$rvm_ruby_gem_home" | \grep -q 'rvm'; then if __rvm_using_gemset_globalcache && [[ ! -L "$rvm_ruby_gem_home/cache" ]]; then mv "$rvm_ruby_gem_home/cache/"*.gem "$rvm_gems_cache_path/" 2>/dev/null \rm -rf "$rvm_ruby_gem_home/cache" ln -nfs "$rvm_gems_cache_path" "$rvm_ruby_gem_home/cache" fi