scripts/utility in rvm-0.0.98 vs scripts/utility in rvm-0.0.99

- old
+ new

@@ -107,11 +107,11 @@ __rvm_remove_rvm_from_path() { PATH=$(echo $PATH | tr -s ':' '\n' | grep -v "\.rvm" | tr -s '\n' ':' | sed 's#:$##') export PATH } -__rvm_gi() { gem install -q --no-rdoc --no-ri $* ; } +__rvm_gi() { gem install $rvm_gem_options $* ; } __rvm_run() { log_file_name="$1" ; command="$2" ; message="$3" rvm_ruby_log_path="${rvm_ruby_log_path:-$rvm_path/log}" mkdir -p $(dirname "$rvm_ruby_log_path/$log_file_name.log") @@ -267,18 +267,19 @@ echo "$rvm_ruby_src_path" fi } __rvm_list() { + echo if [[ ! -z "$rvm_all_flag" ]] ; then while read -r tag do prefix="$(echo ${tag/\//} | sed 's#^v1_##' | awk -F'_' '{print "(ruby-)1."$1"."$2}' | sed 's#p$##')" echo "${prefix}-t${tag/\//}" unset prefix tag done < <(svn list http://svn.ruby-lang.org/repos/ruby/tags/ | awk '/^v1_[8|9]/') - echo -e "(ruby-)1.8.6(-p383)\n(ruby-)1.8.6-head\n(ruby-)1.8.7(-p174)\n(ruby-)1.8.7-head\n(ruby-)1.9.1(-p243)\n(ruby-)1.9.1(-p376)\n(ruby-)1.9.1-head\n(ruby-)1.9.2-preview1" + echo -e "(ruby-)1.8.6(-p383)\n(ruby-)1.8.6-head\n(ruby-)1.8.7(-p248)\n(ruby-)1.8.7-head\n(ruby-)1.9.1(-p243)\n(ruby-)1.9.1(-p376)\n(ruby-)1.9.1-head\n(ruby-)1.9.2-preview1" echo -e "jruby-1.2.0\njruby-1.3.0\njruby-1.3.1\njruby(-1.4.0) # the default\njruby-head" echo -e "rbx(-head) # rubinius head, the default rbx \nrbx(-head) --jit (rubinius head with LLVM enabled)" echo -e "ree-1.8.6\nree(-1.8.7) # the default\nree-1.8.6-head\nree-1.8.7-head" echo -e "mput(-head) # shyouhei head, the default mput" echo -e "ironruby-0.9.3 # (1.0 RC1)\nironruby-head" @@ -291,11 +292,11 @@ current_ruby="$(echo $ruby | xargs dirname | xargs dirname | xargs basename 2> /dev/null)" fi for version in $(\ls $rvm_path/ 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}') ; do if [[ ! -z "$(echo $version | awk '/^jruby-/')" ]] ; then - string="$($version -v | awk '{print $NF}')" + string="$($rvm_path/$version/bin/ruby -v | awk '{print $NF}')" else string="[ $(file $rvm_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]" fi if [[ "$version" = "$current_ruby" ]] ; then echo -e "=> $(tput setaf 2)$version$(tput sgr0) $string" @@ -322,20 +323,21 @@ if [[ ! -z "$system_ruby" ]] && [[ -x "$system_ruby" ]]; then #system_version=$($system_ruby -v | awk -F: '{print $2}' | grep 8 | awk '{print $NF}' | tr "\n" ' ') system_version=$($system_ruby -v) string="[ $(file $system_ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]" if [[ ! -z "$system_ruby" ]] && [[ "$system_ruby -v)" = "$system_version" ]] ; then - echo -e "=> $(tput setaf 2)system$(tput sgr0) $string\n" + echo -e "=> $(tput setaf 2)system$(tput sgr0) $string" else - echo -e " $(tput setaf 2)system$(tput sgr0) $string\n" + echo -e " $(tput setaf 2)system$(tput sgr0) $string" fi else $rvm_scripts_path/log "info" "No system ruby found." fi unset current_ruby version selected system_ruby system_version string fi + echo } __rvm_initialize() { rvm_ruby_load_path="." rvm_ruby_require="" @@ -348,18 +350,20 @@ mkdir -p $rvm_src_path $rvm_bin_path $rvm_archives_path $rvm_gem_path $rvm_tmp_path } __rvm_update() { + __rvm_pushpop $rvm_path if [[ "head" = "$rvm_ruby_revision" ]] || [[ ! -z "$rvm_self_flag" ]] || [[ "update" = "$rvm_action" ]] || [[ ! -z "$rvm_update_flag" ]] ; then __rvm_version __rvm_update_rvm fi if [[ ! -z "$rvm_bin_flag" ]] ; then __rvm_bin_scripts ; fi if [[ ! -z "$rvm_rubygems_flag" ]] ; then __rvm_rubygems_setup ; fi unset rvm_update_flag rvm_action rvm_self_flag rvm_ruby_revision rvm_bin_flag rvm_rubygems_flag + __rvm_pushpop } __rvm_update_rvm() { mkdir -p "$rvm_src_path" __rvm_pushpop "$rvm_src_path" @@ -380,20 +384,20 @@ else builtin cd $rvm_src_path && git clone git://github.com/wayneeseguin/rvm.git && builtin cd rvm/ && ./install fi else if [[ "true" = "$($ruby -S gem list rvm --installed)" ]]; then - $ruby -S gem update rvm --no-rdoc --no-ri --quiet + $ruby -S gem update rvm $rvm_gem_options else - $ruby -S gem install rvm --no-rdoc --no-ri --quiet + $ruby -S gem install rvm $rvm_gem_options fi # TODO: Check all gem paths instead of simply assuming the last one... builtin cd "$($ruby -S gem env | grep "\- $HOME" | awk '{print $NF}' | head -n 1)/gems/rvm-$(gem list rvm | sed 's/.*(//' | sed 's/).*//' | awk -F',' '{print $1 ; exit}')" && ./install fi unset ruby system_ruby __rvm_pushpop - __rvm_hook "after_update" + $rvm_scripts_path/hook "after_update" } __rvm_reboot() { $rvm_scripts_path/log "warn" "Do you wish to reset rvm? ('yes', or 'no')" read response @@ -404,11 +408,11 @@ if [[ "/" = "$rvm_path" ]] ; then $rvm_scripts_path/log "error" "remove '/' ?!... NO!" else if [[ -d "$rvm_path" ]] ; then rm -rf "$rvm_path/" ; fi fi - gem install rvm --no-rdoc --no-ri -q + gem install rvm $rvm_gem_options __rvm_update_rvm source $rvm_path/scripts/rvm else $rvm_scripts_path/log "info" "Carry on then..." fi ; unset response @@ -446,21 +450,21 @@ fi rvm_command="$binary $rvm_ruby_mode $rvm_ruby_require -I$load_path $rvm_ruby_args" elif [[ "gem" = "$(basename $binary)" ]] && $rvm_scripts_path/match "$rvm_ruby_args" '^install' ; then #__rvm_gem_install #$rvm_scripts_path/gem install $rvm_ruby_args - rvm_command="$rvm_scripts_path/gems $rvm_ruby_mode $rvm_ruby_args --no-rdoc --no-ri" + rvm_command="$rvm_scripts_path/gems $rvm_ruby_mode $rvm_ruby_args $rvm_gem_options" else rvm_command="$binary $rvm_ruby_mode $rvm_ruby_args" fi - mkdir -p ./log/$rvm_ruby_string/ if [[ ! -z "$rvm_json_flag" ]] || [[ ! -z "$rvm_yaml_flag" ]] || [[ ! -z "$rvm_summary_flag" ]] ; then + mkdir -p ./log/$rvm_ruby_string/ touch ./log/$rvm_ruby_string/$rvm_action.log ./log/$rvm_ruby_string/$rvm_action.error.log eval "$rvm_command" >> ./log/$rvm_ruby_string/$rvm_action.log 2>> ./log/$rvm_ruby_string/$rvm_action.error.log else - echo -e "\n\n\033[0;32m$rvm_ruby_string: $($binary -v $rvm_ruby_mode | tr "\n" ' ')\033[0m\n" + $rvm_scripts_path/log "info" "$rvm_ruby_string: $($rvm_ruby_home/bin/ruby -v $rvm_ruby_mode | tr "\n" ' ')" eval "$rvm_command" fi result=$? if [[ $result -eq 0 ]]; then @@ -501,11 +505,11 @@ if [[ ! -z "$rvm_yaml_flag" ]] ; then __rvm_yaml ; fi if [[ ! -z "$rvm_json_flag" ]] ; then __rvm_json ; fi __rvm_state - __rvm_hook "after_do" + $rvm_scripts_path/hook "after_do" return ${#errors[*]} } __rvm_summary() { @@ -653,18 +657,9 @@ # Use the latest sdk available. if [[ -z "$rvm_sdk" ]] ; then rvm_sdk="$(/usr/bin/basename -a /Developer/SDKs/* | awk '/^M/' | sort | tail -n 1)" ; fi CFLAGS="${CFLAGS:-"-isysroot /Developer/SDKs/$rvm_sdk $rvm_archflags"}" ; export CFLAGS LDFLAGS="${LDFLAGS:-"-Wl,-syslibroot /Developer/SDKs/$rvm_sdk $rvm_archflags"}" ; export LDFLAGS # CXXFLAGS="-mmacosx-version-min="$(sw_vers -productVersion | awk -F'.' '{print $1"."$2}')" -isysroot /Developer/SDKs/$rvm_sdk " ; export CXXFLAGS - fi - fi -} - -__rvm_hook() { - if [[ ! -z "$1" ]] ; then - if [[ -s "$rvm_hooks_path/$1" ]] ; then - if [[ "$rvm_verbose_flag" -eq 1 ]] || [[ "$rvm_debug_flag" -eq 1 ]] ; then $rvm_scripts_path/log "info" "running hook $1" ; fi - source "$rvm_hooks_path/$1" fi fi } __rvm_gems_select() {