scripts/gemsets in rvm-0.1.41 vs scripts/gemsets in rvm-0.1.42

- old
+ new

@@ -24,11 +24,22 @@ $rvm_scripts_path/set "gem" "update" return $? } gemset_globalcache() { - if [[ "$1" == "disable" ]]; then + if [[ "$1" == "enabled" ]]; then + __rvm_using_gemset_globalcache + local globalcache_enabled="$?" + local gc_status="Unknown" + if [[ "$globalcache_enabled" == "0" ]]; then + gc_status="Enabled" + else + gc_status="Disabled" + fi + $rvm_scripts_path/log "info" "Gemset global cache is currently: $gc_status" + return "$globalcache_enabled" + elif [[ "$1" == "disable" ]]; then $rvm_scripts_path/log "info" "Removing the global cache (note: this will empty the caches)" for directory_name in $(\ls "$rvm_gems_path"); do current_cache_path="$rvm_gems_path/$directory_name/cache" if [[ -L "$current_cache_path" && "$(readlink "$current_cache_path")" == "$rvm_gems_cache_path" ]]; then $rvm_scripts_path/log "info" "Reverting the gem cache for $directory_name to an empty directory." @@ -66,12 +77,12 @@ } gemset_create() { rvm_ruby_gem_prefix=$(echo $rvm_ruby_gem_home | sed 's/'${rvm_gemset_separator}'.*$//') for gemset in $(echo $gems_args) ; do - gem_home="${rvm_ruby_gem_prefix}${rvm_gemset_separator}${gems_args/ /}" - mkdir -p $gem_home + gem_home="${rvm_ruby_gem_prefix}${rvm_gemset_separator}${gemset}" + mkdir -p "$gem_home" # When the globalcache is enabled, we need to ensure we setup the cache directory correctly. if __rvm_using_gemset_globalcache; then if [[ -d "$gem_home/cache" && ! -L "$gem_home/cache" ]]; then mv "$gem_home/cache"/*.gem "$rvm_gems_cache_path/" 2>/dev/null rm -rf "$gem_home/cache" @@ -460,10 +471,10 @@ elif [[ "prune" = "$action" ]] ; then gemset_prune elif [[ "update" = "$action" ]]; then gemset_update elif [[ "globalcache" = "$action" ]]; then - gemset_globalcache $2 + gemset_globalcache "$2" elif [[ "clear" = "$action" ]] ; then $rvm_scripts_path/log "info" "gemset cleared." exit 0 else usage