scripts/gemsets in rvm-0.1.37 vs scripts/gemsets in rvm-0.1.38

- old
+ new

@@ -340,43 +340,22 @@ $rvm_scripts_path/log "info" "Importing initial gemsets for $(__rvm_environment_identifier)." mkdir -p "$rvm_gemsets_path/$(echo "$rvm_ruby_string" | tr '-' '/')" 2>/dev/null for gemsets_path in "$rvm_gemsets_path" "$rvm_gemsets_path/$rvm_ruby_interpreter" "$rvm_gemsets_path/$rvm_ruby_interpreter/$rvm_ruby_version" "$rvm_gemsets_path/$rvm_ruby_interpreter/$rvm_ruby_version/$rvm_ruby_patch_level" ; do if [[ ! -z "$rvm_gemset_name" ]] ; then if [[ -s "${gemsets_path}/${rvm_gemset_name}.gems" ]] ; then - printf $(rvm gemset import "${gemsets_path}/${rvm_gemset_name}.gems") > /dev/null + (source "$rvm_scripts_path/rvm"; rvm gemset import "${gemsets_path}/${rvm_gemset_name}.gems") > /dev/null fi else if [[ -d "$gemsets_path" ]] && [[ -s "${gemsets_path}/default.gems" ]] ; then - printf $(rvm gemset import "$gemsets_path/default.gems") > /dev/null + (source "$rvm_scripts_path/rvm"; rvm gemset import "$gemsets_path/default.gems") > /dev/null fi if [[ -d "$gemsets_path" ]] && [[ -s "${gemsets_path}/global.gems" ]] ; then - printf $(rvm use "$rvm_ruby_string@global" --create ; rvm gemset import "${gemsets_path}/global.gems") > /dev/null + (source "$rvm_scripts_path/rvm"; rvm use "$rvm_ruby_string@global" --create ; rvm gemset import "${gemsets_path}/global.gems") > /dev/null fi fi done $rvm_scripts_path/log "info" "Installation of gems for $(__rvm_environment_identifier) is complete." - - # Original code, which swapped out the environments on the fly. - #post_install_gems="rdoc rake" - #for rvm_gem_name in $(echo $post_install_gems); do - # home="$GEM_HOME" ; path="$GEM_PATH" # Save - # for dir in $rvm_ruby_global_gems_path $rvm_ruby_gem_home ; do - # GEM_HOME="$dir" ; GEM_PATH="$dir" ; BUNDLE_PATH="$dir" - # export GEM_HOME GEM_PATH BUNDLE_PATH - # __rvm_run "gems.install" "$rvm_ruby_home/bin/gem install --no-rdoc --no-ri $rvm_gem_name $rvm_gem_options" "Installing $rvm_gem_name to $dir" - - # if [[ -x $rvm_ruby_gem_home/bin/$rvm_gem_name ]] ; then - # if [[ "$rvm_ruby_gem_home" != "$rvm_ruby_home" ]] && [[ ! -x $rvm_ruby_home/bin/$rvm_gem_name ]] ; then - # ln -nfs $rvm_ruby_gem_home/bin/$rvm_gem_name $rvm_ruby_home/bin/$rvm_gem_name - # fi - # __rvm_inject_ruby_shebang "$rvm_ruby_home/bin/$rvm_gem_name" - # __rvm_inject_gem_env "$rvm_ruby_home/bin/$rvm_gem_name" - # fi - # done ; unset home path dir - # GEM_HOME="$home" ; GEM_PATH="$path" ; BUNDLE_PATH="$home" - # export GEM_HOME GEM_PATH BUNDLE_PATH - #done ; unset rvm_gem_name post_install_gems } unset GEM_PATH if ! command -v gem > /dev/null ; then @@ -387,10 +366,20 @@ action="$(echo $* | awk '{print $1}')" gems_args=$(echo "$*" | awk '{$1="" ; print}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') export rvm_gemset_name if [[ "import" = "$action" ]] || [[ "load" = "$action" ]] ; then - gemset_import + if [[ -z "$rvm_ruby_strings" ]]; then + gemset_import + else + original_env="$(__rvm_environment_identifier)" + for rvm_ruby_string in $(echo "$rvm_ruby_strings" | tr "," " "); do + __rvm_become + gemset_import + done + __rvm_become "$original_env" + unset original_env + fi elif [[ "export" = "$action" ]] || [[ "dump" = "$action" ]] ; then gemset_export elif [[ "create" = "$action" ]] ; then gemset_create elif [[ "copy" = "$action" ]] ; then