scripts/utility in rvm-0.0.65 vs scripts/utility in rvm-0.0.66
- old
+ new
@@ -120,16 +120,16 @@
fi
if [[ $? -gt 0 ]] ; then __rvm_log "error" "Error running '$command', please check $rvm_ruby_log_path/$log_file_name.error.log" ; __rvm_pushpop ; return 1 ; fi
unset log_file command
}
-function __rvm_cleanup_variables {
+__rvm_cleanup_variables() {
__rvm_unset_ruby_variables
- unset rvm_ruby_selected_flag rvm_action rvm_irbrc_file rvm_src_path rvm_path rvm_prefix_path rvm_gem_path rvm_command rvm_error_message rvm_gem_set_name rvm_url rvm_config_path rvm_bin_path rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_log_path rvm_file_name rvm_ruby_configure
+ unset rvm_ruby_selected_flag rvm_action rvm_irbrc_file rvm_src_path rvm_path rvm_prefix_path rvm_gem_path rvm_command rvm_error_message rvm_gem_set_name rvm_url rvm_config_path rvm_bin_path rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_log_path rvm_file_name rvm_ruby_configure rvm_benchmark_flag
}
-function __rvm_unset_ruby_variables {
+__rvm_unset_ruby_variables() {
unset rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_ruby_binary rvm_ruby_home rvm_ruby_log_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string rvm_ruby_string rvm_ruby_src_path rvm_ruby_repo_url rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_head_flag
}
# TODO: root user loadng of /etc/rvmrc
function __rvm_load_rvmrc {
@@ -560,15 +560,16 @@
__rvm_select
__rvm_use
binary="$(echo $rvm_action | sed 's#do$##')"
if [[ -x "$rvm_ruby_home/bin/$binary" ]] ; then
load_path="$rvm_ruby_home/bin:$rvm_ruby_load_path"
- if [[ "ruby" = "$binary" ]] ; then
+ # TODO: the else case below should be run if $rvm_ruby_args =~ /\.rb$/
+ if [[ "ruby" = "$binary" ]] && [[ "$rvm_benchmark_flag" -ne 1 ]] ; then
if match "$rvm_ruby_args" "\.rb$" ; then
if [[ -z "$prefix" ]] ; then prefix="-S" ; fi
if ! match "$rvm_ruby_args" "$prefix" ; then
- rvm_ruby_args="$prefix $rvm_ruby_args"
+ rvm_ruby_args="$prefix '$rvm_ruby_args'"
fi
fi
rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_require -I$load_path $rvm_ruby_args"
else
rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_args"
@@ -691,41 +692,19 @@
echo -e "$code" > "$rvm_temp_path/$$.rb"
unset code
cat $rvm_ruby_file >> "$rvm_temp_path/$$.rb"
echo -e "\n end \nend\n" >> "$rvm_temp_path/$$.rb"
rvm_ruby_args="$rvm_temp_path/$$.rb"
+ rvm_benchmark_flag=1
rvm_action="ruby"
if [[ ! -z "$rvm_debug_flag" ]] ; then echo -e "$rvm_temp_path/$$.rb:\n$(cat $rvm_temp_path/$$.rb)" ; fi
__rvm_do
}
function __rvm_irbrc {
+ # Create the irbrc for the currently selected ruby installation.
if [[ -d "$rvm_ruby_home" ]] && [[ ! -s "$rvm_ruby_irbrc" ]] ; then
- rvm_ruby_irbrc_file=$(cat <<-Config
-
-require "irb/completion" rescue nil
-
-require "irb/ext/save-history"
-IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
-
-@prompt = {
- :PROMPT_I => "${rvm_ruby_package_name} > ", # default prompt
- :PROMPT_S => "${rvm_ruby_package_name}%l> ", # known continuation
- :PROMPT_C => "${rvm_ruby_package_name} > ",
- :PROMPT_N => "${rvm_ruby_package_name} ?> ", # unknown continuation
- :RETURN => " => %s \n",
- :AUTO_INDENT => true
-}
-IRB.conf[:PROMPT][:RVM] = @prompt
-IRB.conf[:PROMPT_MODE] = :RVM
-
-load '$HOME/.irbrc' if File.exists?('$HOME/.irbrc') rescue nil
-
-Config
-)
- touch $rvm_ruby_irbrc
- echo -e "\n$rvm_ruby_irbrc_file" > $rvm_ruby_home/.irbrc
- unset rvm_ruby_irbrc_file
+ cp $rvm_path/scripts/irbrc $rvm_ruby_irbrc
fi
}
function __rvm_pushpop {
if [[ -z "$1" ]] ; then