bash/rvm in rvm-0.0.7 vs bash/rvm in rvm-0.0.8
- old
+ new
@@ -1,11 +1,11 @@
#!/bin/bash
rvm_author="Wayne E. Seguin"
rvm_author_email="wayneeseguin@gmail.com"
rvm_website="http://github.com/wayneeseguin/rvm"
-rvm_version="0.0.7"
+rvm_version="0.0.8"
rvm_updated="2009.08.25"
#
# License: See LICENSE
#
@@ -143,11 +143,10 @@
1.8|1.8.6) major="1.8" ; minor="6" ; level="${2-369}" ;;
1.8.7) major="1.8" ; minor="7" ; level="${2-174}" ;;
*) fail "Ruby version '$version' is unknown."
esac
- set -x
package_name="ruby-$major.$minor-p$level"
url="ftp://ftp.ruby-lang.org/pub/ruby/$major/$package_name.tar.gz"
info "Installing Ruby from source to: $install_path/$package_name"
mkdir -p $install_path/$package_name
@@ -192,12 +191,10 @@
for gem_name in rake ; do
info "Installing $gem_name"
$install_path/$package_name/bin/gem install $gem_name --no-rdoc --no-ri -q >> $install_path/$package_name/gems.install.log
done
-
- set +x
}
function rvm-install-ruby {
case "$implementation" in
@@ -295,16 +292,18 @@
}
function rvm-use {
+ implementation="${1-$implementation}"
case "$implementation" in
default)
rm -f ~/.rvm/current
unset MY_RUBY_HOME
unset GEM_HOME
+ unset RUBY_VERSION
;;
#leopard) MY_RUBY_HOME="/System/Library/Frameworks/Ruby.framework/Versions/Current/usr"; GEM_HOME="$HOME/.gem/ruby/1.8" ;;
jruby)
version="${version-1.3.1}"
@@ -522,11 +521,11 @@
-p|--prefix) install_path="$1" ; shift ;;
-s|--source) source_path="$1" ; shift ;; # Undocumented / untested "feature"
-c|--configure) configure="$1" ; shift ;;
-m|--manager) manager="$1" ; shift ;;
-u|--gemdup) action="gemdup" ; gem_dir="$1" ; shift ;;
- -d|--debug) debug=true ;;
+ -d|--debug) debug=1 ;;
*) rvm-usage ; return 1
esac
done
if [ -z "$implementation" -a -z "$version" ] ; then
@@ -536,27 +535,30 @@
fi
username=`whoami`
# TODO: Sanitize user input, ensure that there is a / a the end...
if [ "$username" = "root" ] ; then
- prefix_path=${prefix-/usr/local/}
+ fail "root user support is not yet implemented."
+ #prefix_path=${prefix-/usr/local/}
else
prefix_path=${prefix-$HOME/.}
fi
source_path="${source_path-${prefix_path}rvm/src}"
install_path="${prefix_path}rvm"
- mkdir -p $source_path $install_path
+ mkdir -p ~/.rvm/ $source_path $install_path
if [ -f ~/.rvm/original_path ] ; then
original_path=`cat ~/.rvm/original_path`
fi
if [ -z "$original_path" ] ; then
echo $PATH > $install_path/.original_path
original_path=$PATH
fi
+ if [ "$debug" = "1" ] ; then set -x ; fi
+
case "$action" in
install)
if [ "$implementation" = "all" ] ; then
for implementation in ruby jruby ree ; do
if [ "$implementation" = "ruby" ] ; then
@@ -592,8 +594,10 @@
else
rvm-usage
fi
return 1
esac
+
+ set +x
}