scripts/selector in rvm-1.0.20 vs scripts/selector in rvm-1.0.21
- old
+ new
@@ -12,11 +12,13 @@
[[ -n "${rvm_ruby_patch_level:-""}" ]] && rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_patch_level"
[[ -n "${rvm_ruby_revision:-""}" ]] && rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_revision"
[[ -n "${rvm_ruby_name:-""}" ]] && rvm_ruby_name="$rvm_ruby_string-n$rvm_ruby_name"
fi
- __rvm_ruby_string
+ if ! __rvm_ruby_string ; then
+ return $?
+ fi
rvm_archive_extension="tar.gz"
if [[ -z "${rvm_ruby_interpreter:-""}" ]] ; then
rvm_ruby_interpreter="${rvm_ruby_string//-*/}"
@@ -522,13 +524,26 @@
rc[[:digit:]]*)
rvm_ruby_patch_level="$string"
;;
[[:digit:]]\.[[:digit:]]*)
- rvm_ruby_version="$string"
- rvm_ruby_revision=""
- rvm_ruby_tag=""
+
+ case "$string" in
+
+ 0.*|1.*)
+ rvm_ruby_version="$string"
+ rvm_ruby_revision=""
+ rvm_ruby_tag=""
+ ;;
+
+ *)
+ "$rvm_path/scripts/log" "error" \
+ "Unknown ruby interpreter version: '$string'"
+ return 1
+ ;;
+ esac
+
;;
p[[:digit:]]*)
rvm_ruby_patch_level="$string"
;;
@@ -594,10 +609,10 @@
rvm_ruby_interpreter="$string"
;;
*)
"$rvm_path/scripts/log" "error" \
- "Unknown ruby string component: '$string'"
+ "Unknown ruby interpreter string component: '$string'"
return 1
;;
esac
done