scripts/selector in rvm-0.0.999 vs scripts/selector in rvm-0.0.9999
- old
+ new
@@ -9,10 +9,12 @@
if [[ ! -z "$rvm_ruby_revision" ]] ; then rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_revision" ; fi
fi
__rvm_ruby_string
+ rvm_archive_extension="tar.gz"
+
case "$rvm_ruby_interpreter" in
macruby)
if [[ "Darwin" = "$(uname)" ]] ; then
rvm_ruby_package_name=${rvm_ruby_interpreter}-${rvm_ruby_version}
if [[ "$rvm_head_flag" -eq 1 ]] ; then
@@ -73,10 +75,41 @@
fi
alias jruby_ng="jruby --ng"
alias jruby_ng_server="jruby --ng-server"
;;
+ maglev)
+ unset rvm_ruby_patch_level
+ if [[ ! -z "$rvm_head_flag" ]] ; then
+ rvm_ruby_version="head"
+ rvm_ruby_string="maglev-head"
+ rvm_ruby_repo_url="${rvm_ruby_repo_url:-$(__rvm_db "maglev_repo_url")}"
+ rvm_url="${rvm_ruby_repo_url:-$(__rvm_db "maglev_repo_url")}"
+ else
+ system="$(uname -s)"
+ arch="$(uname -m)"
+ # It would be nice if we didn't have to do this if..else..
+ #if [[ "Darwin" = "$system" ]] ; then
+ # rvm_ruby_package_file="MagLev-${rvm_ruby_version}.MacOSX"
+ # rvm_gemstone_package_file="GemStone-${rvm_ruby_version}.MacOSX"
+ #elif [[ "SunOS" = "$system" ]] && [[ "i86pc" = "$(uname -m)" ]] ; then
+ # rvm_ruby_package_file="MagLev-${rvm_ruby_version}.Solaris-x86"
+ # rvm_gemstone_package_file="GemStone-${rvm_ruby_version}.Solaris-x86"
+ #else
+ rvm_ruby_package_file="MagLev-${rvm_ruby_version}.${system}-${arch}"
+ rvm_gemstone_package_file="GemStone-${rvm_ruby_version}.${system}-${arch}"
+ #fi
+ rvm_ruby_version="${rvm_ruby_version:-"$(__rvm_db "maglev_version")"}"
+ rvm_ruby_package_name="${rvm_ruby_interpreter}-${rvm_ruby_version}"
+ rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}"
+ maglev_url="$(__rvm_db "maglev_url")"
+ rvm_url="${rvm_ruby_url:-"$maglev_url/${rvm_ruby_package_file}.${rvm_archive_extension}"}"
+ rvm_gemstone_url="${rvm_gemstone_url:-"$maglev_url/${rvm_gemstone_package_file}.${rvm_archive_extension}"}"
+ export MAGLEV_HOME="$rvm_path/$rvm_ruby_string"
+ fi
+ ;;
+
ironruby)
unset rvm_ruby_patch_level
if [[ "$rvm_head_flag" -eq 1 ]] ; then
rvm_ruby_version="head"
rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}"
@@ -170,10 +203,15 @@
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"
rvm_ruby_gem_home="${rvm_gem_path}/${rvm_ruby_string}"
+ if [[ "maglev" = "$rvm_ruby_interpreter" ]] ; then
+ export MAGLEV_HOME="$rvm_ruby_home"
+ export GEMSTONE_GLOBAL_DIR=$MAGLEV_HOME
+ fi
+
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
@@ -278,11 +316,11 @@
RUBY_VERSION="$($rvm_ruby_home/bin/ruby -v | sed 's#^\(.*\) (.*$#\1#')"
export GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION
echo "export PATH=\"$rvm_ruby_home/bin:$rvm_ruby_gem_home/bin:$rvm_path/bin:\$PATH\"" > $rvm_path/default
- for variable in RUBY_VERSION GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC rvm_ruby_string rvm_gem_set_name ; do
+ for variable in RUBY_VERSION GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC rvm_ruby_string rvm_gem_set_name MAGLEV_HOME ; do
eval "export $variable"
eval value=\$${variable}
if [[ ! -z "$value" ]] ; then
echo "export ${variable}='$value'" >> $rvm_path/default
else
@@ -293,20 +331,25 @@
if [[ ! -z "$rvm_default_flag" ]] ; then $rvm_scripts_path/symlink "default" ; fi
fi
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
-
+ 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
# Export ruby string and gem set name for extrnal scripts to take advantage of them.
- if [[ ! -z "$rvm_ruby_string" ]] ; then export rvm_ruby_string ; fi
- if [[ ! -z "$rvm_gem_set_name" ]] ; then export rvm_gem_set_name ; fi
+ if [[ ! -z "$rvm_ruby_string" ]] ; then export rvm_ruby_string ; fi
+ if [[ ! -z "$rvm_gem_set_name" ]] ; then export rvm_gem_set_name ; fi
+ if [[ ! -z "$new_path" ]] ; then export PATH="$new_path" ; unset new_path ; fi
- if [[ ! -z "$new_path" ]] ; then
- export PATH="$new_path" ; unset new_path
+ if [[ "maglev" = "$rvm_ruby_interpreter" ]] ; then
+ export MAGLEV_HOME="$rvm_ruby_home"
+ export GEMSTONE_GLOBAL_DIR=$MAGLEV_HOME
+ if [[ -x "$MAGLEV_HOME/gemstone/bin/gslist" ]] ; then
+ $MAGLEV_HOME/gemstone/bin/gslist -clv > /dev/null 2>&1 ; result=$?
+ if [[ $result -eq 1 ]] ; then $rvm_ruby_home/bin/maglev start ; fi
+ fi
fi
$rvm_scripts_path/hook "after_use"
}
@@ -356,10 +399,13 @@
rvm_ruby_patch_level="$string"
elif $rvm_scripts_path/match "$string" "^[0-9][0-9]" ; then
if [[ "ree" = "$rvm_ruby_interpreter" ]] ; then
rvm_ruby_patch_level="$string"
unset rvm_ruby_revision
+ elif [[ "maglev" = "$rvm_ruby_interpreter" ]] ; then
+ rvm_ruby_version="$string"
+ unset rvm_ruby_revision rvm_ruby_patch_level
else
rvm_ruby_revision="r$string"
fi
elif $rvm_scripts_path/match "$string" "^r[0-9]" ; then
unset rvm_ruby_patch_level
@@ -376,11 +422,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 $rvm_scripts_path/match "ruby rbx jruby macruby ree rubinius mput shyouhei ironruby" "$string" ; then
+ elif $rvm_scripts_path/match "ruby rbx jruby macruby ree rubinius maglev mput shyouhei ironruby" "$string" ; then
rvm_ruby_interpreter="$string"
else
$rvm_scripts_path/log "error" "Unknown ruby string component: '$string'"
return 1
fi
@@ -406,9 +452,10 @@
rvm_ruby_string="${rvm_ruby_interpreter}"
else
rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}"
fi
+ # Head
if [[ "$rvm_head_flag" -eq 1 ]] ; then
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