scripts/selector in rvm-0.0.97 vs scripts/selector in rvm-0.0.98

- old
+ new

@@ -40,20 +40,27 @@ ;; rbx|rubinius) rvm_ruby_interpreter="rbx" rvm_ruby_version=${rvm_ruby_version:-$(__rvm_db "rbx_version")} - rvm_ruby_patch_level=${rvm_ruby_patch_level:-$(__rvm_db "rbx_patch_level")} rvm_ruby_repo_url=${rvm_rbx_repo_url:-$(__rvm_db "rubinius_repo_url")} __rvm_db "rbx_url" "rvm_url" - - rvm_ruby_file="rubinius-$rvm_ruby_version-$rvm_ruby_patch_level" + if [[ -z "$rvm_head_flag" ]] ; then + rvm_ruby_patch_level=${rvm_ruby_patch_level:-$(__rvm_db "rbx_patch_level")} + rvm_ruby_string="$rvm_ruby_interpreter-$rvm_ruby_version-p$rvm_ruby_patch_level" + rvm_ruby_string="${rvm_ruby_string/-prc/-rc}" + rvm_ruby_string="$(echo $rvm_ruby_string | sed 's#-pp#-p#')" + rvm_ruby_file="rubinius-$rvm_ruby_version-$rvm_ruby_patch_level" + else + unset rvm_ruby_patch_level + rvm_ruby_string="$rvm_ruby_interpreter-$rvm_ruby_version-head" + fi ;; jruby) unset rvm_ruby_patch_level - if [[ "$rvm_head_flag" -eq 1 ]] ; then + if [[ ! -z "$rvm_head_flag" ]] ; then 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 @@ -67,15 +74,23 @@ alias jruby_ng_server="jruby --ng-server" ;; ironruby) unset rvm_ruby_patch_level - rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "ironruby_version")"} - rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}" - rvm_ruby_package_file="${rvm_ruby_string}.zip" - rvm_ruby_package_name="${rvm_ruby_string}" - rvm_url="$(__rvm_db "ironruby_url")${rvm_ruby_package_file}" + if [[ "$rvm_head_flag" -eq 1 ]] ; then + 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 + rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "ironruby_version")"} + rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}" + rvm_ruby_package_file="${rvm_ruby_string}.zip" + rvm_ruby_package_name="${rvm_ruby_string}" + rvm_url="$(__rvm_db "ironruby_url")${rvm_ruby_package_file}" + fi ;; ree) rvm_ruby_interpreter=ree rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "ree_version")"} @@ -152,14 +167,14 @@ rvm_ruby_home="$rvm_path/$rvm_ruby_string" rvm_ruby_log_path="$rvm_log_path/$rvm_ruby_string" rvm_ruby_src_path="$rvm_src_path/$rvm_ruby_string" rvm_ruby_binary="$rvm_ruby_home/bin/ruby" rvm_ruby_irbrc="$rvm_ruby_home/.irbrc" - if [[ -z "$rvm_gem_set_name" ]] ; then - rvm_ruby_gem_home="${rvm_gem_path}/${rvm_ruby_interpreter}/${rvm_ruby_version}" - else - rvm_ruby_gem_home="${rvm_gem_path}/${rvm_ruby_interpreter}/${rvm_ruby_version}%${rvm_gem_set_name}" + rvm_ruby_gem_home="${rvm_gem_path}/${rvm_ruby_string}" + + if [[ ! -z "$rvm_gem_set_name" ]] ; then + rvm_ruby_gem_home="${rvm_ruby_gem_home}%${rvm_gem_set_name}" fi rvm_ruby_selected_flag=1 export rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_url rvm_ruby_patch_level rvm_ruby_configure rvm_ruby_configure_flags rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_gem_set_name rvm_gem_path rvm_ruby_gem_home rvm_path rvm_src_path rvm_bin_path rvm_ruby_binary rvm_ruby_home rvm_log_path rvm_ruby_log_path rvm_src_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string @@ -229,11 +244,11 @@ if [[ -z "$IRBRC" ]] ; then unset IRBRC ; fi if [[ ! -d $MY_RUBY_HOME ]] ; then $rvm_scripts_path/log "warn" "$rvm_ruby_interpreter $rvm_ruby_string is not installed." if [[ ! -z "$rvm_install_on_use_flag" ]] ; then - __rvm_install_ruby $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level + $rvm_scripts_path/manage "install" "$rvm_ruby_string" else $rvm_scripts_path/log "info" "To install do: 'rvm install $rvm_ruby_string'" return 1 fi fi @@ -275,13 +290,12 @@ done ; unset variable value if [[ ! -z "$rvm_default_flag" ]] ; then $rvm_scripts_path/symlink "default" ; fi fi fi - - unset rvm_default_flag fi + unset rvm_default_flag if [[ ! -z "$rvm_symlink_name" ]] ; then $rvm_scripts_path/symlink "$rvm_symlink_name" ; unset rvm_symlink_name ; fi if [[ ! -z "$rvm_editor_flag" ]] ; then $rvm_scripts_path/symlink "editor" ; unset rvm_editor_flag ; fi if [[ ! -z "$rvm_passenger_flag" ]] ; then $rvm_scripts_path/symlink "passenger" ; unset rvm_passenger_flag; fi @@ -327,10 +341,12 @@ rvm_ruby_version="nightly" rvm_nightly_flag=1 break elif $rvm_scripts_path/match "$string" "^preview" ; then rvm_ruby_patch_level="$string" + elif $rvm_scripts_path/match "$string" "^rc[0-9]" ; then + rvm_ruby_patch_level="$string" elif $rvm_scripts_path/match "$string" "^[0-9]\.[0-9]" ; then if [[ "1.8" = "$string" ]] ; then string="1.8.6" ; fi if [[ "1.9" = "$string" ]] ; then string="1.9.1" ; fi rvm_ruby_version="$string" unset rvm_ruby_revision rvm_ruby_tag @@ -358,11 +374,11 @@ unset rvm_ruby_patch_level rvm_ruby_revision rvm_ruby_tag rvm_ruby_patch="$string" elif $rvm_scripts_path/match "$string" "^u[a-z0-9]" ; then unset rvm_ruby_patch_level rvm_ruby_revision rvm_ruby_tag rvm_ruby_patch rvm_ruby_user_tag="$string" - elif [[ "$string" = "ruby" ]] || [[ "$string" = "jruby" ]] || [[ "$string" = "ree" ]] || [[ "$string" = "macruby" ]] || [[ "$string" = "rbx" ]] || [[ "$string" = "rubinius" ]] || [[ "$string" = "mput" ]] || [[ "$string" = "shyouhei" ]] || [[ "$string" = "ironruby" ]] ; then + elif $rvm_scripts_path/match "ruby rbx jruby macruby ree rubinius mput shyouhei ironruby" "$string" ; then rvm_ruby_interpreter="$string" else $rvm_scripts_path/log "error" "Unknown ruby string component: '$string'" return 1 fi @@ -409,9 +425,10 @@ 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 if [[ ! -z "$rvm_ruby_patch_level" ]] ; then rvm_ruby_patch_level="$(echo $rvm_ruby_patch_level | sed 's#^pp#p#')" rvm_ruby_string="${rvm_ruby_string}-${rvm_ruby_patch_level}" + rvm_ruby_string="$(echo $rvm_ruby_string | sed 's#-pp#-p#')" fi fi }