scripts/selector in rvm-0.0.57 vs scripts/selector in rvm-0.0.58

- old
+ new

@@ -19,20 +19,20 @@ else rvm_ruby_interpreter="${rvm_ruby_interpreter:-ruby}" # Default is standard ruby fi fi - if [ "$rvm_ruby_version" = "1.8" ] ; then rvm_ruby_version="1.8.6" ; fi - if [ "$rvm_ruby_version" = "1.9" ] ; then rvm_ruby_version="1.9.1" ; 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) - if [ "`uname`" = "Darwin" ] ; then - rvm_ruby_repo_url="${rvm_ruby_repo_url:-`__rvm_db "macruby_repo_url"`}" + if [ "Darwin" = "$(uname)" ] ; then + rvm_ruby_repo_url="${rvm_ruby_repo_url:-"$(__rvm_db "macruby_repo_url")"}" rvm_ruby_version="${rvm_ruby_version:-head}" rvm_ruby_package_name=${rvm_ruby_interpreter}-${rvm_ruby_version} - #rvm_ruby_version="${rvm_ruby_version:-`__rvm_db "macruby_version"`}" + #rvm_ruby_version="${rvm_ruby_version:-"$(__rvm_db "macruby_version")"}" #rvm_ruby_package_name=${rvm_ruby_interpreter}_nightly-${rvm_ruby_version} #rvm_url="http://dl.getdropbox.com/u/163257/$rvm_ruby_package_name.pkg" # 'nightly' builds unset rvm_ruby_patch_level else __rvm_log "fail" "MacRuby can only be installed on a Darwin OS." @@ -42,19 +42,19 @@ rbx|rubinius) rvm_ruby_interpreter="rbx" rvm_ruby_version="${rvm_ruby_version:-head}" #rvm_ruby_revision="head" unset rvm_ruby_patch_level - rvm_ruby_repo_url=${rvm_rbx_repo_url:-`__rvm_db "rubinius_repo_url"`} + rvm_ruby_repo_url=${rvm_rbx_repo_url:-"$(__rvm_db "rubinius_repo_url")"} rvm_url=$rvm_ruby_repo_url rvm_ruby_configure="" rvm_ruby_make="build" rvm_ruby_make_install="" ;; jruby) - rvm_ruby_version="${rvm_ruby_version:-`__rvm_db "jruby_version"`}" + rvm_ruby_version="${rvm_ruby_version:-"$(__rvm_db "jruby_version")"}" rvm_jruby_repo_url="${rvm_jruby_repo_url:-"git://kenai.com/jruby~main"}" if [ ! -z "$(echo $rvm_ruby_version | awk '/^1.4/')" ] ; then rvm_ruby_version="1.4.0RC1" rvm_package_file="$rvm_ruby_interpreter-bin-${rvm_ruby_version}" else @@ -69,12 +69,12 @@ alias jruby_ng_server="jruby --ng-server" ;; 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_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_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 @@ -107,11 +107,11 @@ __rvm_log "fail" "Ruby implementation '$rvm_ruby_interpreter' is not known." fi esac if [ ! -z "$rvm_ruby_revision" ] ; then - if [ "$rvm_ruby_revision" = "head" -o "$rvm_ruby_revision" = "trunk" ] ; then + if [ "head" = "$rvm_ruby_revision" -o "trunk" = "$rvm_ruby_revision" ] ; then rvm_ruby_patch_level="head" else rvm_ruby_patch_level="$rvm_ruby_revision" fi fi @@ -127,14 +127,14 @@ 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 - if [ ! -z "`echo $rvm_ruby_patch_level | awk '/^[0-9]/'`" ] ; then + if [ ! -z "$(echo $rvm_ruby_patch_level | awk '/^[0-9]/')" ] ; then rvm_ruby_patch_level="p$rvm_ruby_patch_level" fi - rvm_ruby_patch_level="`echo $rvm_ruby_patch_level | sed 's/^pp/p/'`" # sanity check, thanks sfpyra + rvm_ruby_patch_level="$(echo $rvm_ruby_patch_level | sed 's/^pp/p/')" # sanity check, thanks sfpyra fi rvm_ruby_package_name="${rvm_ruby_package_name:-"$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level"}" rvm_ruby_home="${rvm_ruby_home:-"$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level"}" fi @@ -153,11 +153,11 @@ function __rvm_use { if [ -z "$rvm_selected_flag" ] ; then __rvm_select $* ; fi if [ -z "$rvm_ruby_interpreter" ] ; then rvm_ruby_interpreter="default" ; fi - if [ "$rvm_ruby_interpreter" = "default" ] ; then + if [ "default" = "$rvm_ruby_interpreter" ] ; then PATH=$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -) PATH=$rvm_bin_path:$PATH ; export PATH if [ -s $rvm_path/default ] ; then @@ -167,11 +167,11 @@ __rvm_log "warn" "no default rvm specified, defaulting to pre-rvm sytem." unset GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC if [ -s $rvm_path/system ] ; then source $rvm_path/system ; fi fi - elif [ "$rvm_ruby_interpreter" = "system" ] ; then + elif [ "system" = "$rvm_ruby_interpreter" ] ; then unset GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC PATH=$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -) PATH=$rvm_bin_path:$PATH ; export PATH if [ -s $rvm_path/system ] ; then @@ -205,11 +205,11 @@ PATH=$MY_RUBY_HOME/bin:$GEM_HOME/bin:$rvm_path/bin:$PATH ; export PATH fi if [ ! -z "$rvm_default_flag" -a "$rvm_ruby_interpreter" != "default" ] ; then - if [ "$rvm_ruby_interpreter" = "system" ] ; then + if [ "system" = "$rvm_ruby_interpreter" ] ; then rm -f $rvm_path/default rm -f $rvm_path/bin/default* else RUBY_VERSION="$($MY_RUBY_HOME/bin/ruby -v | sed 's/^\(.*\) (.*$/\1/')" export GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION @@ -240,11 +240,11 @@ if [ ! -z "$rvm_load_flag" ] ; then __rvm_gems_load ; fi if [ ! -z "$rvm_dump_flag" ] ; then __rvm_gems_dump ; fi } function __rvm_ruby_string { - if [ "$rvm_ruby_interpreter" = "system" ] ; then + 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 : __rvm_unset_ruby_variables @@ -261,18 +261,18 @@ rvm_ruby_version=$rvm_ruby_interpreter rvm_ruby_interpreter=jruby unset rvm_ruby_patch_level fi - if [ "$rvm_ruby_version" = "head" ] ; then + if [ "head" = "$rvm_ruby_version" ] ; then revision="head" - if [ "$rvm_ruby_interpreter" = "ree" ] ; then rvm_ruby_version="1.8.7" ; fi - if [ "$rvm_ruby_interpreter" = "rbx" ] ; then unset revision ; fi + if [ "ree" = "$rvm_ruby_interpreter" ] ; then rvm_ruby_version="1.8.7" ; fi + if [ "rbx" = "$rvm_ruby_interpreter" ] ; then unset revision ; fi else revision=$(echo $ruby_string | awk -F'-' '{print $3}') fi - if [ "$revision" = "head" -o "$revision" = "preview" ] ; then + if [ "head" = "$revision" -o "preview" = "$revision" ] ; then rvm_ruby_revision="$revision" else if [ ! -z "$(echo $revision | awk '/^p[0-9]\+/')" ] ; then rvm_ruby_patch_level=${rvm_ruby_patch_level:-$(echo $revision | awk -F'p' '{print $2}')} else