scripts/selector in rvm-0.0.77 vs scripts/selector in rvm-0.0.78
- old
+ new
@@ -250,11 +250,11 @@
RUBY_VERSION="$($MY_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
- for variable in RUBY_VERSION GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC ; 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
else
@@ -271,10 +271,14 @@
fi
fi
unset rvm_default_flag
fi
+ # Export ruby string and gem set name for extrnal scripts to take advantage of them.
+ if [[ ! -z "$rvm_ruby_string" ]] ; then export rvm_ruby_string ; fi
+ if [[ ! -z "$rvm_gem_set_name" ]] ; then export rvm_gem_set_name ; fi
+
if [[ ! -z "$rvm_load_flag" ]] ; then __rvm_gems_load ; fi
if [[ ! -z "$rvm_dump_flag" ]] ; then __rvm_gems_dump ; fi
}
__rvm_ruby_string() {
@@ -307,12 +311,10 @@
rvm_ruby_version="nightly"
rvm_nightly_flag=1
break
elif match "$string" "^preview" ; then
rvm_ruby_patch_level="$string"
- elif match "$string" "^[a-z][a-z]" ; then
- rvm_ruby_interpreter="$string"
elif match "$string" "^[0-9]\.[0-9]" ; then
if [[ "1.8" = "$string" ]] ; then string="1.8.6" ; fi
if [[ "1.9" = "$string" ]] ; then string="1.9.1" ; fi
rvm_ruby_version="$string"
unset rvm_ruby_revision rvm_ruby_tag
@@ -329,13 +331,15 @@
unset rvm_ruby_patch_level
rvm_ruby_revision="$string"
elif match "$string" "^s[0-9]" ; then
unset rvm_ruby_revision
rvm_ruby_sha="$string"
- elif match "$string" "^t[0-9]" ; then
+ elif match "$string" "^t[v0-9]" ; then
unset rvm_ruby_patch_level rvm_ruby_revision
rvm_ruby_tag="$string"
+ elif match "$string" "^[a-z][a-z]" ; then
+ rvm_ruby_interpreter="$string"
else
__rvm_log "error" "Unknown ruby string component: '$string'"
fi
done
@@ -354,10 +358,9 @@
if [[ -z "$rvm_ruby_version" ]] ; then
rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "${rvm_ruby_interpreter}_version")"}
fi
rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}"
- # Unspecified patch level
if [[ "$rvm_head_flag" -eq 1 ]] ; then
rvm_ruby_string="${rvm_ruby_string}-head"
elif [[ ! -z "$rvm_ruby_revision" ]] ; then
rvm_ruby_string="${rvm_ruby_string}-${rvm_ruby_revision}"
elif [[ ! -z "$rvm_ruby_tag" ]] ; then