scripts/selector in rvm-1.1.0 vs scripts/selector in rvm-1.1.1
- old
+ new
@@ -160,20 +160,10 @@
if ! "$rvm_path/scripts/match" "$rvm_ruby_version" "^1\.8" ; then
"$rvm_path/scripts/log" "fail" "Unknown Ruby Enterprise Edition version: $rvm_ruby_version"
fi
;;
- mput|shyouhei)
- rvm_ruby_interpreter="mput"
- rvm_ruby_version="head"
- rvm_ruby_string=$(echo $rvm_ruby_string | sed -e 's/shyouhei/mput/g')
- rvm_ruby_patch_level=""
- rvm_ruby_repo_url=${rvm_mput_repo_url:-"$(__rvm_db "shyouhei_repo_url")"}
- rvm_ruby_url=$rvm_ruby_repo_url
- rvm_ruby_configure="" ; rvm_ruby_make="" ; rvm_ruby_make_install=""
- ;;
-
ruby)
if [[ -z "${rvm_ruby_version:-""}" && ${rvm_head_flag:-0} -eq 0 ]]; then
"$rvm_path/scripts/log" "fail" "Ruby version was not specified!"
else
@@ -305,10 +295,11 @@
new_path="$PATH:${rvm_bin_path:-"$rvm_path/bin"}"
export rvm_ruby_string="system"
else
+ unset BUNDLE_PATH # Ensure that BUNDLE_PATH is not set!
GEM_HOME="$rvm_ruby_gem_home"
GEM_PATH="$rvm_ruby_gem_home:$rvm_ruby_global_gems_path"
MY_RUBY_HOME="$rvm_ruby_home"
RUBY_VERSION="$rvm_ruby_string"
IRBRC="$rvm_ruby_irbrc"
@@ -428,26 +419,26 @@
local ruby_string gemset_name
rvm_expanding_aliases=${rvm_expanding_aliases:-0}
- rvm_ruby_version=${rvm_ruby_version:-""}
- rvm_gemset_name=${rvm_gemset_name:-""}
- rvm_ruby_interpreter=${rvm_ruby_interpreter:-""}
- rvm_ruby_version=${rvm_ruby_version:-""}
- rvm_ruby_patch_level=${rvm_ruby_patch_level:-""}
- rvm_ruby_revision=${rvm_ruby_revision:-""}
- rvm_ruby_tag=${rvm_ruby_tag:-""}
+ rvm_ruby_version="${rvm_ruby_version:-""}"
+ rvm_gemset_name="${rvm_gemset_name:-""}"
+ rvm_ruby_interpreter="${rvm_ruby_interpreter:-""}"
+ rvm_ruby_version="${rvm_ruby_version:-""}"
+ rvm_ruby_patch_level="${rvm_ruby_patch_level:-""}"
+ rvm_ruby_revision="${rvm_ruby_revision:-""}"
+ rvm_ruby_tag="${rvm_ruby_tag:-""}"
if echo "$rvm_ruby_string" | \grep -q "${rvm_gemset_separator:-"@"}" ; then
rvm_gemset_name="${rvm_ruby_string/*${rvm_gemset_separator:-"@"}/}"
rvm_ruby_string="${rvm_ruby_string/${rvm_gemset_separator:-"@"}*/}"
fi
# Alias'd rubies
- if [[ ${rvm_expanding_aliases:-0} -eq 0 && -n ${rvm_ruby_string:-""}
- && $rvm_ruby_string != "system" ]] ; then
+ if [[ ${rvm_expanding_aliases:-0} -eq 0 && -n "${rvm_ruby_string:-""}"
+ && "$rvm_ruby_string" != "system" ]] ; then
if expanded_alias_name="$("$rvm_path/scripts/alias" show "$rvm_ruby_string" 2>/dev/null)" \
&& [[ -n "$expanded_alias_name" ]] ; then
rvm_ruby_string="$expanded_alias_name"
elif [[ "$rvm_ruby_string" = default ]] ; then
# Default is not a known value. Instead, we need to therefore set it to system.
@@ -459,26 +450,26 @@
rvm_gemset_name="${rvm_ruby_string/*${rvm_gemset_separator:-"@"}/}"
rvm_ruby_string="${rvm_ruby_string/${rvm_gemset_separator:-"@"}*/}"
fi
# Stash the ruby string.
- ruby_string=${rvm_ruby_string:-""}
- gemset_name=${rvm_gemset_name:-""}
- repo_url=${rvm_ruby_repo_url:-""}
- branch_name=${rvm_ruby_repo_branch:-""}
+ ruby_string="${rvm_ruby_string:-""}"
+ gemset_name="${rvm_gemset_name:-""}"
+ repo_url="${rvm_ruby_repo_url:-""}"
+ branch_name="${rvm_ruby_repo_branch:-""}"
__rvm_unset_ruby_variables
- rvm_ruby_repo_url=${repo_url:-""}
- rvm_ruby_repo_branch=${branch_name:-""}
+ rvm_ruby_repo_url="${repo_url:-""}"
+ rvm_ruby_repo_branch="${branch_name:-""}"
if [[ ! -z "$gemset_name" ]] ; then
rvm_gemset_name="$gemset_name"
rvm_sticky_flag=1 # <- not sold on this.
fi
- strings=($(echo ${ruby_string//-/ }))
+ strings=($(echo "${ruby_string//-/ }"))
if [[ ${#strings[@]} -eq 0 ]] ; then
if echo "${GEM_HOME:-""}" | grep -q "rvm" ; then
# Current Ruby
@@ -602,11 +593,11 @@
n*)
rvm_ruby_name="${string/n/}"
;;
- ruby|rbx|jruby|macruby|ree|rubinius|maglev|mput|shyouhei|ironruby)
+ ruby|rbx|jruby|macruby|ree|rubinius|maglev|ironruby)
rvm_ruby_interpreter="$string"
;;
*)
"$rvm_path/scripts/log" "error" \
@@ -624,13 +615,13 @@
1.[2-7]*) rvm_ruby_interpreter="jruby" ;;
esac
fi
# Unspecified version
- rvm_ruby_version=${rvm_ruby_version:-""}
+ rvm_ruby_version="${rvm_ruby_version:-""}"
if [[ -z "${rvm_ruby_version:-""}" && ${rvm_head_flag:-0} -eq 0 ]] ; then
- rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "${rvm_ruby_interpreter}_version")"}
+ rvm_ruby_version="${rvm_ruby_version:-"$(__rvm_db "${rvm_ruby_interpreter}_version")"}"
fi
if [[ -z "${rvm_ruby_version:-""}" ]] ; then
rvm_ruby_string="${rvm_ruby_interpreter}"
else
@@ -702,25 +693,25 @@
__rvm_gemset_select()
{
command -v gem > /dev/null
if [[ $? -gt 0 ]] ; then return 0 ; fi # Stop if no 'gem' command is available.
- rvm_ruby_gem_home=${rvm_ruby_gem_home:-""}
- rvm_gemset_name=${rvm_gemset_name:-""}
+ rvm_ruby_gem_home="${rvm_ruby_gem_home:-""}"
+ rvm_gemset_name="${rvm_gemset_name:-""}"
if [[ -z "${rvm_gemset_name:-""}" ]] ; then
# No longer defaulting to 'sticky' gem sets.
# Set 'rvm_sticky_flag=1' in ~/.rvmrc to enable.
if [[ ${rvm_sticky_flag:-0} -eq 1 ]] ; then
if [[ -n "${GEM_HOME:-""}" ]] ; then
- rvm_gemset_name=$(echo $GEM_HOME | xargs basename | awk -F${rvm_gemset_separator:-"@"} '{print $2}')
+ rvm_gemset_name="$(echo $GEM_HOME | xargs basename | awk -F${rvm_gemset_separator:-"@"} '{print $2}')"
fi
if [[ -n "${rvm_ruby_gem_home:-""}" ]] ; then
- rvm_gemset_name=$(echo $rvm_ruby_gem_home | xargs basename | awk -F${rvm_gemset_separator:-"@"} '{print $2}')
+ rvm_gemset_name="$(echo $rvm_ruby_gem_home | xargs basename | awk -F${rvm_gemset_separator:-"@"} '{print $2}')"
fi
fi
if [[ -n "${rvm_gemset_name:-""}" ]] &&
! echo "${rvm_gemset_name:-""}" | grep -q "^[[:digit:]]\.[[:digit:]]" ; then
@@ -730,24 +721,24 @@
else
if [[ -n "${rvm_ruby_string:-""}" && "${rvm_ruby_interpreter:-""}" != "system" ]] ; then
rvm_ruby_gem_home="${rvm_gems_path:-"$rvm_path/gems"}/$rvm_ruby_string"
elif [[ -z "${GEM_HOME:-""}" && -n "$(command -v gem)" ]] ; then
- rvm_ruby_gem_home=$(gem env gemdir)
+ rvm_ruby_gem_home="$(gem env gemdir)"
elif [[ -n "${GEM_HOME:-""}" ]] ; then
rvm_ruby_gem_home="$GEM_HOME"
else
rvm_ruby_gem_home=""
fi
fi
else
- local gemset=$(echo "$rvm_ruby_gem_home" | awk -F'@' '{print $NF}')
+ local gemset="$(echo "$rvm_ruby_gem_home" | awk -F'@' '{print $NF}')"
if [[ -z "${rvm_ruby_string:-""}" && -n "${GEM_HOME:-""}" && -n "${GEM_HOME/@*/}" ]] ; then
- rvm_ruby_string=$(basename ${GEM_HOME/@*/})
+ rvm_ruby_string="$(basename ${GEM_HOME/@*/})"
fi
if [[ -n "${rvm_ruby_string:-""}" ]] ; then
if [[ -z "${rvm_ruby_gem_home:-""}" || -n "${gemset:-""}" ]] ; then
@@ -862,10 +853,10 @@
rvm_ruby_gem_home="${GEM_HOME//${rvm_gemset_separator:-"@"}*}"
rvm_ruby_global_gems_path="${rvm_ruby_gem_home}${rvm_gemset_separator:-"@"}global"
- GEM_HOME=$rvm_ruby_gem_home
+ GEM_HOME="$rvm_ruby_gem_home"
GEM_PATH="$rvm_ruby_gem_home:$rvm_ruby_global_gems_path"
export rvm_ruby_gem_home rvm_ruby_global_gems_path GEM_HOME GEM_PATH