scripts/selector in rvm-0.0.86 vs scripts/selector in rvm-0.0.87

- old
+ new

@@ -22,16 +22,17 @@ rvm_url="$rvm_ruby_repo_url" rvm_ruby_string="${rvm_ruby_interpreter}-head" elif [[ "nightly" = "$rvm_ruby_version" ]] ; then rvm_url="http://macruby.icoretech.org/latest" rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}" + rvm_ruby_package_name="${rvm_ruby_interpreter}_nightly-${rvm_ruby_version}" + rvm_ruby_package_file="$rvm_ruby_package_name" else __rvm_db "macruby_version" "rvm_ruby_version" - rvm_ruby_package_name="${rvm_ruby_interpreter}_nightly-${rvm_ruby_version}" - rvm_ruby_package_file="MacRuby%200.5%20beta%201.zip" + rvm_ruby_package_name="MacRuby%200.5%20beta%201.zip" + rvm_ruby_package_file="$rvm_ruby_package_name" rvm_url="http://www.macruby.org/files/MacRuby%200.5%20beta%201.zip" - rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}" fi unset rvm_ruby_patch_level else $rvm_scripts_path/log "fail" "MacRuby can only be installed on a Darwin OS." @@ -55,13 +56,14 @@ rvm_ruby_string="jruby-head" rvm_ruby_repo_url="${rvm_ruby_repo_url:-$(__rvm_db "jruby_repo_url")}" rvm_url="${rvm_ruby_repo_url:-$(__rvm_db "jruby_repo_url")}" else rvm_ruby_version="${rvm_ruby_version:-"$(__rvm_db "jruby_version")"}" - rvm_package_file="${rvm_ruby_interpreter}-bin-${rvm_ruby_version}" + rvm_ruby_package_file="${rvm_ruby_interpreter}-bin-${rvm_ruby_version}" + rvm_ruby_package_name="${rvm_ruby_interpreter}-${rvm_ruby_version}" rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}" - rvm_url="http://jruby.kenai.com/downloads/${rvm_ruby_version}/${rvm_package_file}.tar.gz" + rvm_url="http://jruby.kenai.com/downloads/${rvm_ruby_version}/${rvm_ruby_package_file}.tar.gz" fi alias jruby_ng="jruby --ng" alias jruby_ng_server="jruby --ng-server" ;; @@ -79,11 +81,11 @@ if [[ ! -z "$rvm_ruby_revision" ]] ; then unset rvm_ruby_patch_level rvm_ruby_package_file rvm_ruby_package_name="ree-$rvm_ruby_version-$rvm_ruby_revision" else rvm_ruby_package_file="ruby-enterprise-$rvm_ruby_version-$rvm_ruby_patch_level" - rvm_url="${rvm_url:-$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_url")}/$rvm_ruby_package_file.tar.gz" + rvm_url="$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_url")/$rvm_ruby_package_file.tar.gz" fi fi if ! $rvm_scripts_path/match "$rvm_ruby_version" "^1\.8" ; then $rvm_scripts_path/log "fail" "Unknown Ruby Enterprise Edition version: $rvm_ruby_version" @@ -194,11 +196,11 @@ fi fi if [[ "root" = "$(whoami)" ]] ; then for binary in erb gem irb rake rdoc ri ruby testrb ; do - rm -f /usr/local/bin/$binary + rm -f $rvm_symlink_path/$binary done fi if [[ ! -z "$rvm_verbose_flag" ]] ; then $rvm_scripts_path/log "info" "Now using system ruby." @@ -237,14 +239,14 @@ PATH=$rvm_bin_path:$PATH ; export PATH PATH=$MY_RUBY_HOME/bin:$GEM_HOME/bin:$rvm_path/bin:$PATH ; export PATH if [[ "root" = "$(whoami)" ]] ; then for binary in erb gem irb rake rdoc ri ruby testrb ; do - rm -f /usr/local/bin/$binary - ln -nfs $rvm_ruby_home/bin/$binary /usr/local/bin/$binary - rm -f /usr/local/bin/passenger_ruby - ln -nfs $rvm_bin_path/$rvm_ruby_string /usr/local/bin/passenger_ruby + rm -f $rvm_symlink_path/$binary + ln -nfs $rvm_ruby_home/bin/$binary $rvm_symlink_path/$binary + rm -f $rvm_symlink_path/passenger_ruby + ln -nfs $rvm_bin_path/$rvm_ruby_string $rvm_symlink_path/passenger_ruby done fi fi if [[ ! -z "$rvm_default_flag" ]] && [[ "default" != "$rvm_ruby_interpreter" ]] ; then @@ -295,10 +297,11 @@ # * rvm_ruby_interpreter # * rvm_ruby_version # * rvm_ruby_patch_level # * rvm_ruby_revision # * rvm_ruby_tag + # * rvm_ruby_patch set_name=$(echo "$rvm_ruby_string" | awk -F'%' '{print $2}') if [[ ! -z "$set_name" ]] ; then rvm_gem_set_name="$set_name" ; fi ruby_string=$(echo "$rvm_ruby_string" | awk -F'%' '{print $1}') @@ -344,10 +347,13 @@ elif $rvm_scripts_path/match "$string" "^t[v0-9]" ; then unset rvm_ruby_patch_level rvm_ruby_revision rvm_ruby_tag="$string" elif $rvm_scripts_path/match "$string" "^m[0-9]" ; then rvm_ruby_mode="$string" + elif $rvm_scripts_path/match "$string" "^h[a-z]" ; then + unset rvm_ruby_patch_level rvm_ruby_revision rvm_ruby_tag + rvm_ruby_patch="$string" elif $rvm_scripts_path/match "$string" "^[a-z][a-z]" ; then rvm_ruby_interpreter="$string" else $rvm_scripts_path/log "error" "Unknown ruby string component: '$string'" fi @@ -379,9 +385,14 @@ 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 rvm_ruby_string="${rvm_ruby_string}-${rvm_ruby_tag}" + elif [[ ! -z "$rvm_ruby_patch" ]] ; then + if [[ -z "$rvm_ruby_patch_name" ]] ; then + rvm_ruby_patch_name="$(basename $rvm_ruby_patch | awk -F',' '{print $1}')" + fi + rvm_ruby_string="${rvm_ruby_string}-${rvm_ruby_patch}" elif [[ ! -z "$rvm_ruby_patch_level" ]] ; then rvm_ruby_string="${rvm_ruby_string}-${rvm_ruby_patch_level}" else patch_level="$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_patch_level")" if [[ ! -z "$patch_level" ]] ; then rvm_ruby_patch_level="p${patch_level}" ; fi