scripts/manage in rvm-0.1.35 vs scripts/manage in rvm-0.1.36

- old
+ new

@@ -9,10 +9,20 @@ trap "rm -rf ${rvm_tmp_path}/$$* > /dev/null 2>&1 ; exit" 0 1 2 3 15 if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi +# Checks for bison, returns zero iff it is found +__rvm_check_for_bison() { + if [[ "$rvm_head_flag" -gt 0 ]]; then + if ! command -v bison >/dev/null ; then + $rvm_scripts_path/log "fail" "bison is not available in your path. Please ensure it exists before compiling from head." + return 1 + fi + fi +} + __rvm_install_source() { if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi $rvm_scripts_path/log "info" "Installing Ruby from source to: $rvm_ruby_home" __rvm_pushpop "$rvm_src_path" @@ -668,10 +678,13 @@ __rvm_post_install __rvm_pushpop ;; ruby) + __rvm_check_for_bison + result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi + if [[ "rvm_make_flags_flag" -eq 1 ]] ; then __rvm_make_flags ; fi __rvm_install_source $* ;; default) @@ -896,12 +909,21 @@ done ; unset rvm_gem_name post_install_gems $rvm_scripts_path/log "info" "Installation of gems for $rvm_ruby_string is complete." __rvm_irbrc __rvm_load_gemsets + + __rvm_generate_default_docs } +__rvm_generate_default_docs() { + if [[ "$rvm_docs_flag" = "1" && "$rvm_ruby_interpreter" != "macruby" ]]; then + $rvm_scripts_path/log "info" "Attempting to generate ri docs..." + (source $rvm_scripts_path/rvm; rvm use "$rvm_ruby_string"; rvm docs generate-ri) > ~/rvm-install-docs 2>&1 + fi +} + __rvm_load_gemsets() { # Gemset for every interpreter's global gems if [[ -s "$rvm_gemsets_path/global.gems" ]] ; then dir=$rvm_ruby_global_gems_path GEM_HOME="$dir" ; GEM_PATH="$dir" ; BUNDLE_PATH="$dir" ; export GEM_HOME GEM_PATH BUNDLE_PATH @@ -1061,24 +1083,14 @@ unset rvm_gemset_name rvm_ruby_selected_flag rvm_ruby_gem_home=$(echo $rvm_ruby_gem_home | awk -F${rvm_gemset_separator} '{print $1}') rvm_ruby_string=$(echo $rvm_ruby_string | awk -F${rvm_gemset_separator} '{print $1}') - # TODO: Extract the common functionality out of the if below - #if [[ ! -z "$rvm_ruby_string" ]] ; then - # unset rvm_ruby_interpreter rvm_ruby_version - # eval "__rvm_${rvm_action}_ruby" - # __rvm_unset_ruby_variables - #elif [[ ! -z "$rvm_ruby_version" ]] ;then if [[ ! -z "$rubies_string" ]] ;then for rvm_ruby_string in $(echo $rubies_string | tr ',' ' ') ; do eval "__rvm_${rvm_action}_ruby" __rvm_unset_ruby_variables done - #elif [[ ! -z "$rvm_ruby_interpreter" ]] ; then - # unset rvm_ruby_string rvm_ruby_version - # eval "__rvm_${rvm_action}_ruby" - # __rvm_unset_ruby_variables else # all if [[ "$rvm_action" != "install" ]] ; then while read -r bin_line do # Keep this on second line damnit! if [[ -x "$bin_line" ]] ; then