scripts/selector in rvm-0.1.27 vs scripts/selector in rvm-0.1.29

- old
+ new

@@ -29,11 +29,11 @@ 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_db "macruby_url" "rvm_url" - rvm_ruby_package_name="MacRuby%200.5.zip" + rvm_ruby_package_name="MacRuby%20${rvm_ruby_version}.zip" rvm_ruby_package_file="$rvm_ruby_package_name" rvm_url="$rvm_url/$rvm_ruby_package_name" fi unset rvm_ruby_patch_level @@ -66,16 +66,18 @@ rvm_ruby_version="head" 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_archive_extension="zip" + rvm_archive_extension="tar.gz" rvm_ruby_version="${rvm_ruby_version:-"$(__rvm_db "jruby_version")"}" + jruby_url="$(__rvm_db "jruby_url")" 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.org.s3.amazonaws.com/downloads/${rvm_ruby_version}/${rvm_ruby_package_file}.tar.gz" + rvm_url="${jruby_url}/${rvm_ruby_version}/${rvm_ruby_package_file}.tar.gz" + unset jruby_url fi alias jruby_ng="jruby --ng" alias jruby_ng_server="jruby --ng-server" ;; @@ -102,24 +104,24 @@ ;; ironruby) unset rvm_ruby_patch_level if [[ "$rvm_head_flag" -eq 1 ]] ; then - export rvm_ruby_version="head" - export rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}" - export rvm_ruby_package_name="${rvm_ruby_string}" - export rvm_ruby_repo_url="${rvm_ruby_repo_url:-$(__rvm_db "ironruby_repo_url")}" - export rvm_url="${rvm_ruby_repo_url:-$(__rvm_db "ironruby_repo_url")}" + rvm_ruby_version="head" + rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}" + rvm_ruby_package_name="${rvm_ruby_string}" + rvm_ruby_repo_url="${rvm_ruby_repo_url:-$(__rvm_db "ironruby_repo_url")}" + rvm_url="${rvm_ruby_repo_url:-$(__rvm_db "ironruby_repo_url")}" else - export rvm_archive_extension="tar.gz" - export rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "ironruby_version")"} - export rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}" - sha1=$(curl -s http://github.com/api/v2/yaml/repos/show/ironruby/ironruby/tags | awk '/'${rvm_ruby_version}'/{print $NF}') - export rvm_ruby_package_file="ironruby-ironruby-${sha1:0:7}.${rvm_archive_extension}" - export rvm_ruby_package_name="ironruby-ironruby-${sha1:0:7}" - export rvm_url="$(__rvm_db "ironruby_url")v${rvm_ruby_version}" + rvm_archive_extension="zip" + rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "ironruby_version")"} + rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}" + rvm_ruby_package_name="${rvm_ruby_interpreter}-${rvm_ruby_version}" + rvm_ruby_package_file="${rvm_ruby_interpreter}-${rvm_ruby_version}.${rvm_archive_extension}" + rvm_url="$(__rvm_db "ironruby_${rvm_ruby_version}_url")${rvm_ruby_package_file}" fi + export rvm_ruby_version rvm_ruby_string rvm_ruby_package_name rvm_ruby_repo_url rvm_url rvm_archive_extension ;; ree) rvm_ruby_interpreter=ree rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "ree_version")"} @@ -162,12 +164,12 @@ rvm_ruby_repo_url="${rvm_ruby_repo_url:-"$(__rvm_db "ruby_repo_url")"}" fi ;; current) - ruby_binary="$(which binary 2>/dev/null)" - if $rvm_scripts_path/match "$ruby_binary" "rvm" ; then + ruby_binary="$(command -v ruby)" + if [[ $? -eq 0 ]] && $rvm_scripts_path/match "$ruby_binary" "rvm" ; then rvm_ruby_string="$(dirname "$ruby_binary" | xargs dirname | xargs basename)" else rvm_ruby_interpreter="system" fi ;; @@ -370,9 +372,15 @@ 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 + + # Alias'd rubies + if [[ -z "$alias_name" ]] ; then + value="$($rvm_scripts_path/db "$rvm_config_path/alias" "$ruby_string" 2>/dev/null)" + if [[ ! -z "$value" ]] ; then ruby_string="$value" ; fi + fi for string in $(echo $ruby_string | tr '-' ' ') ; do if [[ "head" = "$string" ]] ; then rvm_ruby_revision="head" unset rvm_ruby_patch_level rvm_ruby_revision rvm_ruby_tag