scripts/utility in rvm-0.1.15 vs scripts/utility in rvm-0.1.16
- old
+ new
@@ -150,11 +150,11 @@
__rvm_cleanup_variables() {
__rvm_unset_ruby_variables
if [[ "$rvm_sticky_gems" = "1" ]] ; then export rvm_gem_set_name ; else unset rvm_gem_set_name ; fi
- unset rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_url 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_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags rvm_uninstall_flag rvm_install_flag rvm_llvm_flag rvm_ruby_bits rvm_ruby_patch rvm_sticky_gems
+ unset rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_url rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_import_flag rvm_export_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_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags rvm_uninstall_flag rvm_install_flag rvm_llvm_flag rvm_ruby_bits rvm_ruby_patch rvm_sticky_gems
}
# Unset ruby-specific variables
__rvm_unset_ruby_variables() {
unset rvm_ruby_interpreter rvm_ruby_version rvm_url 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 rvm_ruby_configure rvm_ruby_mode rvm_ruby_package_file rvm_ruby_package_name rvm_ruby_gem_path
@@ -467,13 +467,18 @@
# Perform an action using one of a selected ruby's specified binaries.
__rvm_ruby_do() {
__rvm_select
__rvm_use
+
binary="$(echo $rvm_action | sed 's#do$##')"
if [[ -x "$rvm_ruby_home/bin/$binary" ]] ; then
+ rm -f "$rvm_path/gems/cache"
+ ln -nfs "$HOME/.gem/cache" "$rvm_path/gems/cache"
binary="$rvm_ruby_home/bin/$binary"
+ elif [[ -x "$rvm_ruby_global_gems_path/bin/$binary" ]] ; then
+ binary="$rvm_ruby_global_gems_path/bin/$binary"
elif [[ -x "$rvm_ruby_gem_home/bin/$binary" ]] ; then
binary="$rvm_ruby_gem_home/bin/$binary"
elif [[ "system" = "$rvm_ruby_string" ]] && [[ -x "$(which $binary)" ]] ; then
binary="$(basename $(which $binary 2>/dev/null) 2>/dev/null)"
else
@@ -769,11 +774,16 @@
if [[ ! -z "$(ls -A "$rvm_path"/gems/cache/)" ]] ; then
mv $rvm_path/gems/cache/* $HOME/.gem/cache/
fi
rmdir $rvm_path/gems/cache
fi
- rm -f "$rvm_path/gems/cache"
- ln -nfs "$HOME/.gem/cache" "$rvm_path/gems/cache"
+
+ # Some sanity checking.
+ if [[ ! -e "$HOME/.gem/cache" ]] ; then mkdir -p $HOME/.gem/cache ; fi
+ chmod u+w "$HOME/.gem"
+ rm -f "$rvm_gems_path/cache"
+ ln -nfs "$HOME/.gem/cache" "$rvm_gems_path/cache"
+ chmod u+w "$HOME/.gem/cache"
# /TODO
# Careful not to nuke system gems cache.
if [[ ! -z "$rvm_ruby_gem_home" ]] && [[ ! -z "$(echo $rvm_ruby_gem_home | awk '/rvm/')" ]] ; then
# Ensure that the ruby gem home exists.