scripts/selector in rvm-0.1.44 vs scripts/selector in rvm-0.1.45
- old
+ new
@@ -217,11 +217,12 @@
rvm_ruby_interpreter="${rvm_ruby_interpreter:-system}"
fi
}
__rvm_use() {
- if [[ -z "$rvm_ruby_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="system" ; fi
if [[ "system" = "$rvm_ruby_interpreter" ]] ; then
unset GEM_HOME GEM_PATH BUNDLE_PATH MY_RUBY_HOME RUBY_VERSION IRBRC
@@ -235,11 +236,11 @@
source "$rvm_config_path/system"
fi
fi
# Check binaries, remove under the condition they're symlinks.
- if [[ "$rvm_sandboxed" = "0" ]] ; then
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
for binary in ruby gem irb ri rdoc rake erb testrb ; do
full_binary_path="$rvm_bin_path/$binary"
[[ -L "$full_binary_path" ]] && rm -f "$full_binary_path"
done; unset binary full_binary_path
fi
@@ -271,30 +272,30 @@
return 1
fi
fi
# Ensure the environment file for the selected ruby exists.
- __rvm_ensure_has_enviroment_files
+ __rvm_ensure_has_environment_files
if [[ ! -z "$rvm_verbose_flag" ]] ; then
$rvm_scripts_path/log "info" "Using $(basename $GEM_HOME | \tr '-' ' ' | sed 's/'${rvm_gemset_separator}'/ with gemset /')"
fi
new_path="$(echo $PATH | \tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)"
new_path="$GEM_HOME/bin:$rvm_ruby_global_gems_path/bin:$MY_RUBY_HOME/bin:$rvm_bin_path:$new_path"
fi
# Export ruby string and gem set me for extrenal scripts to take advantage of them.
- if [[ ! -z "$rvm_ruby_string" ]] ; then export rvm_ruby_string ; fi
- if [[ ! -z "$rvm_gemset_name" ]] ; then export rvm_gemset_name ; fi
- if [[ ! -z "$new_path" ]] ; then export PATH="$new_path" ; unset new_path ; fi
- if [[ ! -z "$rvm_rvmrc_flag" ]] ; then __rvm_set_rvmrc ; fi
+ if [[ -n "$rvm_ruby_string" ]] ; then export rvm_ruby_string ; fi
+ if [[ -n "$rvm_gemset_name" ]] ; then export rvm_gemset_name ; fi
+ if [[ -n "$new_path" ]] ; then export PATH="$new_path" ; unset new_path ; fi
+ if [[ -n "$rvm_rvmrc_flag" ]] ; then __rvm_set_rvmrc ; fi
environment_id="$(__rvm_environment_identifier)"
if [[ ! -z "$rvm_default_flag" ]] && [[ "default" != "$rvm_ruby_interpreter" ]] ; then
- if [[ "$rvm_sandboxed" = "0" ]] ; then
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
# Sets up the default wrappers.
$rvm_scripts_path/wrapper "$rvm_ruby_string"
fi
if [[ "system" = "$rvm_ruby_interpreter" ]] ; then
$rvm_scripts_path/alias delete default &> /dev/null
@@ -310,15 +311,22 @@
ln -nfs $rvm_environments_path/$environment_id $rvm_environments_path/default
ln -nfs $rvm_wrappers_path/$environment_id $rvm_wrappers_path/default
fi
fi ; unset rvm_default_flag
- if [[ ! -z "$rvm_wrapper_name" ]] ; then
+ if [[ -n "$rvm_wrapper_name" ]] ; then
$rvm_scripts_path/wrapper "$environment_id" "$rvm_wrapper_name" > /dev/null 2>&1
unset rvm_wrapper_name
fi
+ if [[ -n "$rvm_ruby_alias" ]]; then
+ $rvm_scripts_path/log "info" "Attempting to alias $environment_id to $rvm_ruby_alias"
+ $rvm_scripts_path/alias delete "$rvm_ruby_alias" > /dev/null 2>&1
+ rvm_alias_expanded=1 $rvm_scripts_path/alias create "$rvm_ruby_alias" "$environment_id" > /dev/null 2>&1
+ unset ruby_alias rvm_ruby_alias
+ fi
+
unset environment_id
if [[ "maglev" = "$rvm_ruby_interpreter" ]] ; then
export MAGLEV_HOME="$rvm_ruby_home"
export GEMSTONE_GLOBAL_DIR=$MAGLEV_HOME
@@ -350,14 +358,10 @@
# Default is not a known value. Instead, we need to therefore set it to system.
rvm_ruby_string="system"
fi
fi
- # Preparation for alias tags
- rvm_ruby_alias=$(echo "$rvm_ruby_string" | awk -F+ '{print $2}')
- rvm_ruby_string=$(echo "$rvm_ruby_string" | awk -F+ '{print $1}')
-
set_name=$(echo "$rvm_ruby_string" | awk -F${rvm_gemset_separator} '{print $2}')
if [[ ! -z "$set_name" ]] ; then rvm_gemset_name="$set_name" ; fi
ruby_string=$(echo "$rvm_ruby_string" | awk -F${rvm_gemset_separator} '{print $1}')
__rvm_unset_ruby_variables
@@ -488,14 +492,10 @@
command -v gem > /dev/null
if [[ $? -gt 0 ]] ; then return 0 ; fi # Stop if no 'gem' command is available.
rvm_ruby_global_gems_path="$rvm_gems_path/${rvm_ruby_string}${rvm_gemset_separator}global"
- #if [[ -z "$(echo $rvm_ruby_gem_home | grep "$rvm_path")" ]] ; then
- # $rvm_scripts_path/log "warn" "Gemsets cannot be used with system ruby installs (yet)."
- #fi
-
if [[ -z "$rvm_gemset_name" ]] ; then
# No longer defaulting to 'sticky' gem sets.
# Set 'rvm_sticky_flag=1' in ~/.rvmrc to enable.
if [[ -n "$rvm_sticky_flag" ]] ; then
if [[ -n "$GEM_HOME" ]] ; then
@@ -568,12 +568,9 @@
export rvm_ruby_gem_path rvm_ruby_gem_home
}
# Use a gemset specified by 'rvm_ruby_gem_home'
__rvm_gemset_use() {
- #if [[ -z "$(echo $rvm_ruby_gem_home | grep "rvm")" ]] ; then
- # $rvm_scripts_path/log "warn" "Gemsets cannot be used with system ruby installs (yet)."
- #fi
if [[ -n "$rvm_ruby_gem_home" ]] ; then
if [[ ! -d "$rvm_ruby_gem_home" ]] ; then
if [[ "$rvm_gemset_create_on_use_flag" -eq 1 ]] || [[ "$rvm_create_flag" -eq 1 ]]; then
$rvm_scripts_path/gemsets create $rvm_gemset_name
else