scripts/selector in rvm-0.1.31 vs scripts/selector in rvm-0.1.32
- old
+ new
@@ -41,23 +41,23 @@
$rvm_scripts_path/log "fail" "MacRuby can only be installed on a Darwin OS."
fi
;;
rbx|rubinius)
+ rvm_archive_extension="tar.gz"
rvm_ruby_interpreter="rbx"
rvm_ruby_version=${rvm_ruby_version:-$(__rvm_db "rbx_version")}
rvm_ruby_repo_url=${rvm_rbx_repo_url:-$(__rvm_db "rubinius_repo_url")}
- __rvm_db "rbx_${rvm_ruby_version}_${rvm_ruby_patch_level}_url" "rvm_url"
if [[ -z "$rvm_head_flag" ]] ; then
rvm_ruby_patch_level=${rvm_ruby_patch_level:-$(__rvm_db "rbx_patch_level")}
- rvm_ruby_string="$rvm_ruby_interpreter-$rvm_ruby_version-p$rvm_ruby_patch_level"
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"
+ rvm_ruby_string="$(echo "$rvm_ruby_string" | sed 's#-p*#-#')"
+ rvm_ruby_package_file="$(echo "rubinius-${rvm_ruby_version}-${rvm_ruby_patch_level}.${rvm_archive_extension}" | sed 's#-p*#-#' )"
+ __rvm_db "rbx_url" "rvm_url"
+ rvm_url="$rvm_url/$rvm_ruby_package_file"
else
- unset rvm_ruby_patch_level
- unset rvm_ruby_version
+ unset rvm_ruby_patch_level rvm_ruby_version
rvm_ruby_string="$rvm_ruby_interpreter-head"
fi
;;
jruby)
@@ -354,11 +354,11 @@
$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
- $rvm_scripts_path/hook "after_use"
+ rvm_hook="after_use" ; source $rvm_scripts_path/hook
}
__rvm_ruby_string() {
# rvm_ruby_string may designate any of the following items:
# * rvm_gemset_name
@@ -409,10 +409,12 @@
rvm_ruby_patch_level="$string"
elif $rvm_scripts_path/match "$string" "^[0-9][0-9]" ; then
if [[ "ree" = "$rvm_ruby_interpreter" ]] ; then
rvm_ruby_patch_level="$string"
unset rvm_ruby_revision
+ elif [[ "rbx" = "$rvm_ruby_interpreter" ]] ; then
+ rvm_ruby_patch_level="$string"
elif [[ "maglev" = "$rvm_ruby_interpreter" ]] ; then
rvm_ruby_version="$string"
unset rvm_ruby_revision rvm_ruby_patch_level
else
rvm_ruby_revision="r$string"
@@ -478,14 +480,24 @@
rvm_ruby_string="${rvm_ruby_string}-${rvm_ruby_patch_level}"
elif [[ ! -z "$rvm_ruby_user_tag" ]] ; then
rvm_ruby_string="${rvm_ruby_string}-${rvm_ruby_user_tag}"
else
patch_level="$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_patch_level")"
- if [[ ! -z "$patch_level" ]] ; then rvm_ruby_patch_level="p${patch_level}" ; fi
+ if [[ ! -z "$patch_level" ]] ; then
+ if [[ "ree" = "$rvm_ruby_interpreter" ]] || [[ "rbx" = "$rvm_ruby_interpreter" ]] ; then
+ rvm_ruby_patch_level="${patch_level}"
+ else
+ rvm_ruby_patch_level="p${patch_level}"
+ fi
+ fi
if [[ ! -z "$rvm_ruby_patch_level" ]] ; then
rvm_ruby_patch_level="$(echo $rvm_ruby_patch_level | sed 's#^pp#p#')"
rvm_ruby_string="${rvm_ruby_string}-${rvm_ruby_patch_level}"
- rvm_ruby_string="$(echo $rvm_ruby_string | sed 's#-pp#-p#')"
+ if [[ "ree" = "$rvm_ruby_interpreter" ]] || [[ "rbx" = "$rvm_ruby_interpreter" ]] ; then
+ rvm_ruby_string="$(echo $rvm_ruby_string | sed 's#-p*#-#')"
+ else
+ rvm_ruby_string="$(echo $rvm_ruby_string | sed 's#-pp#-p#')"
+ fi
fi
fi
}