scripts/selector in rvm-0.0.65 vs scripts/selector in rvm-0.0.66

- old
+ new

@@ -238,11 +238,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 { +__rvm_ruby_string() { if [[ ! -z "$rvm_ruby_string" ]] ; then if [[ "system" = "$rvm_ruby_string" ]] ; then __rvm_unset_ruby_variables rvm_ruby_interpreter="system" else @@ -258,11 +258,11 @@ rvm_ruby_interpreter=$(echo $ruby_string | awk -F'-' '{print $1}') rvm_ruby_version=$(echo $ruby_string | awk -F'-' '{print $2}') if [[ "$rvm_ruby_version" != "head" ]] ; then patch_level=$(echo $ruby_string | awk -F'-' '{print $3}') - if [[ ! -z "$patch_level" ]] ; then rvm_ruby_patch_level="$patch_level" ; fi + if [[ ! -z "$patch_level" ]] ; then rvm_ruby_patch_level="p$patch_level" ; fi else unset rvm_ruby_version rvm_head_flag=1 rvm_ruby_revision="head" rvm_ruby_patch_level="head" @@ -297,24 +297,29 @@ rvm_ruby_patch_level="head" rvm_head_flag=1 if [[ "rbx" = "$rvm_ruby_interpreter" ]] ; then unset rvm_ruby_patch_level ; fi if [[ "mput" = "$rvm_ruby_interpreter" ]] ; then unset rvm_ruby_patch_level ; fi else - revision=$(echo $ruby_string | awk -F'-' '{print $3}') + revision=$(echo $ruby_string | awk -F'-' '{print $NF}') + if [[ ! -z "$revision" ]] ; then rvm_ruby_patch_level="${rvm_ruby_patch_level:-p${patch_level}}" ; fi if [[ ! -z "$revision" ]] ; then - if match "$revision" "^p" ; then + if match "$revision" "^[0-9]\.[0-9]" ; then + unset rvm_ruby_revision rvm_ruby_tag + elif match "$revision" "^p" ; then rvm_ruby_patch_level="$revision" # if [[ "preview" == "$revision" ]] ; then elif match "$revision" "^[0-9]" ; then if [[ "ree" = "$rvm_ruby_interpreter" ]] ; then rvm_ruby_patch_level="$revision" unset rvm_ruby_revision else rvm_ruby_revision="r$revision" fi elif match "$revision" "^r" ; then + unset rvm_ruby_patch_level rvm_ruby_revision="$revision" elif match "$revision" "^t" ; then + unset rvm_ruby_patch_level rvm_ruby_revision rvm_ruby_tag="$revision" else unset rvm_ruby_patch_level rvm_ruby_revision rvm_ruby_tag fi ; unset revision else