scripts/selector in rvm-0.0.58 vs scripts/selector in rvm-0.0.59
- old
+ new
@@ -1,17 +1,20 @@
#!/bin/bash
# __rvm_select implementation version patch_level
function __rvm_select {
if [ ! -z "$rvm_ruby_string" ] ; then
- __rvm_ruby_string
- elif [ ! -z "$rvm_ruby_selector" ] ; then
- if [ ! -z "$(echo $rvm_ruby_selector | awk '/^[0-9]/')" ] ; then
+ if [ ! -z "$(echo "$rvm_ruby_string" | awk '/^.+%.+$/')" ] ; then
+ rvm_gem_set_name="$(echo "$rvm_ruby_string" | awk -F'%' '{print $2}')"
+ rvm_ruby_string="$(echo "$rvm_ruby_string" | awk -F'%' '{print $1}')"
+ fi
+
+ if [ ! -z "$(echo "$rvm_ruby_string" | awk '/^[0-9]/')" ] ; then
rvm_ruby_interpreter="${rvm_ruby_interpreter:-ruby}"
- rvm_ruby_version=$rvm_ruby_selector
+ rvm_ruby_version=$rvm_ruby_string
else
- rvm_ruby_interpreter="$rvm_ruby_selector"
+ rvm_ruby_interpreter="$rvm_ruby_string"
unset rvm_ruby_version
fi
elif [ ! -z "$rvm_ruby_interpreter" ] ; then
if [ ! -z "$(echo $rvm_ruby_interpreter | awk '/^[0-9]/')" ] ; then
rvm_ruby_version=$rvm_ruby_interpreter
@@ -19,10 +22,11 @@
else
rvm_ruby_interpreter="${rvm_ruby_interpreter:-ruby}" # Default is standard ruby
fi
fi
+ if [ ! -z "$rvm_ruby_string" ] ; then __rvm_ruby_string ; fi
if [ "1.8" = "$rvm_ruby_version" ] ; then rvm_ruby_version="1.8.6" ; fi
if [ "1.9" = "$rvm_ruby_version" ] ; then rvm_ruby_version="1.9.1" ; fi
case "$rvm_ruby_interpreter" in
macruby)
@@ -70,11 +74,11 @@
;;
ruby-enterprise|ree)
rvm_ruby_interpreter=ree
rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "ree_version")"}
- rvm_ruby_patch_level="${rvm_ruby_revision:-"$(__rvm_db "ree_${rvm_ruby_version}_patch_level"))"}"
+ rvm_ruby_patch_level="${rvm_ruby_revision:-"$(__rvm_db "ree_${rvm_ruby_version}_patch_level")"}"
rvm_ruby_package_name="ree-$rvm_ruby_version-$rvm_ruby_patch_level"
rvm_ruby_package_file="ruby-enterprise-$rvm_ruby_version-$rvm_ruby_patch_level"
if [ -z "$(echo $rvm_ruby_version | awk '/^1\.8/')" ] ; then
__rvm_log "fail" "Unknown Ruby Enterprise Edition version: $rvm_ruby_version"
fi
@@ -120,12 +124,10 @@
if [ ! -z "$rvm_ruby_interpreter" -a ! -z "$rvm_ruby_version" -a "$rvm_ruby_interpreter" != "system" ] ; then
rvm_major_version=$(echo $rvm_ruby_version | awk -F'.' '{ print $2 }')
rvm_minor_version=$(echo $rvm_ruby_version | awk -F'.' '{ print $3 }')
- __rvm_gems_select
-
if [ -z "$rvm_ruby_patch_level" ] ; then
rvm_ruby_package_name="${rvm_ruby_package_name:-"$rvm_ruby_interpreter-$rvm_ruby_version"}"
rvm_ruby_home="${rvm_ruby_home:-"$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version"}"
else
if [ "$rvm_ruby_interpreter" != "ree" ] ; then
@@ -141,20 +143,20 @@
rvm_ruby_string="$rvm_ruby_package_name"
rvm_ruby_log_path="$rvm_log_path/$rvm_ruby_package_name"
rvm_ruby_src_path="$rvm_src_path/$rvm_ruby_string"
rvm_ruby_binary="$rvm_ruby_home/bin/ruby"
rvm_ruby_irbrc="$rvm_ruby_home/.irbrc"
- rvm_selected_flag=1
+ 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_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_selected_flag rvm_ruby_string
+ 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_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_ruby_gem_home=$GEM_HOME
fi
}
function __rvm_use {
- if [ -z "$rvm_selected_flag" ] ; then __rvm_select $* ; fi
+ if [ -z "$rvm_ruby_selected_flag" ] ; then __rvm_select $* ; fi
if [ -z "$rvm_ruby_interpreter" ] ; then rvm_ruby_interpreter="default" ; fi
if [ "default" = "$rvm_ruby_interpreter" ] ; then
PATH=$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)
@@ -243,10 +245,15 @@
function __rvm_ruby_string {
if [ "system" = "$rvm_ruby_interpreter" ] ; then
rvm_ruby_string="system"
elif [ ! -z "$rvm_ruby_string" ] ; then
- ruby_string=$(echo "$rvm_ruby_string" | sed 's/ruby-enterprise/ree/g') # dash-antics :
+ ruby_string=$(echo "$rvm_ruby_string" | sed 's/ruby-enterprise/ree/g') # dash-antics
+ if [ ! -z "$(echo "$rvm_ruby_string" | awk -F'%' '{print $2}')" ] ; then
+ rvm_gem_set_name=$(echo "$rvm_ruby_string" | awk -F'%' '{print $2}')
+ fi
+ set +x
+ ruby_string=$(echo "$rvm_ruby_string" | awk -F'%' '{print $1}')
__rvm_unset_ruby_variables
rvm_ruby_interpreter=$(echo $ruby_string | awk -F'-' '{print $1}')
rvm_ruby_version=$(echo $ruby_string | awk -F'-' '{print $2}')
if [ ! -z "$(echo $rvm_ruby_interpreter | awk '/^1\.[8-9]/')" ] ; then