scripts/gems in rvm-0.0.89 vs scripts/gems in rvm-0.0.90

- old
+ new

@@ -1,10 +1,12 @@ #!/usr/bin/env bash -source $rvm_path/scripts/initialize +#source $rvm_path/scripts/rvm source $rvm_path/scripts/utility source $rvm_path/scripts/selector +rvm_ruby_string="${rvm_ruby_string:-system}" +__rvm_select if [[ "$rvm_trace_flag" -eq 1 ]] ; then set -x ; export rvm_trace_flag ; fi trap "rm -f $rvm_path/$$* > /dev/null 2>&1 ; exit" 0 1 2 3 15 @@ -15,21 +17,17 @@ __rvm_gems_dir() { echo "$rvm_ruby_gem_home" } __rvm_gems_list() { - for gemdir in "$rvm_gem_path/$rvm_ruby_interpreter/$rvm_ruby_version%"* ; do - echo "$gemdir" | awk -F'%' '{print $2}' - done + if [[ $rvm_dir =~ rvm ]] ; then + for gemdir in $rvm_gem_path/$rvm_ruby_interpreter/$rvm_ruby_version%* ; do + echo "$gemdir" | awk -F'%' '{print $2}' + done + fi } -__rvm_gems_clear() { - unset rvm_ruby_gem_home rvm_gem_set_name GEM_HOME GEM_PATH - __rvm_gems_select - __rvm_gems_use -} - __rvm_gems_delete() { if [[ ! -z "$rvm_gem_set_name" ]] ; then gemdir="$rvm_gem_path/$rvm_ruby_interpreter/$rvm_ruby_version%$rvm_gem_set_name" if [[ -d "$gemdir" ]] && [[ ! -z "$rvm_force_flag" ]] ; then rm -rf "$gemdir" @@ -215,11 +213,11 @@ fi fi unset gem gem_prefix gem_name gem_version gem_file_name gem_postfix cache_file gem_file_name gem_string } -__rvm_gemdir() { +__rvm_gems_gemdir() { if [[ "$rvm_user_flag" -eq 1 ]] ; then echo $(rvm system ; gem env | grep "\- $HOME" | awk '{print $NF}') elif [[ "$rvm_system_flag" -eq 1 ]] ; then echo $(rvm system ; gem env gemdir system) @@ -239,24 +237,24 @@ if [[ -z "$(which gem 2>/dev/null)" ]] ; then $rvm_scripts_path/log "error" "'gem' was not found, cannot perform gem actions." return 1 fi -if [[ "$rvm_clear_flag" -eq 1 ]] ; then - __rvm_gems_clear -elif [[ "$rvm_load_flag" -eq 1 ]] ; then +if [[ "load" = "$1" ]] ; then __rvm_gems_load -elif [[ "$rvm_dump_flag" -eq 1 ]] ; then +elif [[ "dump" = "$1" ]] ; then __rvm_gems_dump -elif [[ "$rvm_delete_flag" -eq 1 ]] ; then +elif [[ "delete" = "$1" ]] ; then __rvm_gems_delete -elif [[ "$rvm_name_flag" -eq 1 ]] ; then +elif [[ "name" = "$1" ]] ; then __rvm_gems_name -elif [[ "$rvm_dir_flag" -eq 1 ]] ; then +elif [[ "dir" = "$1" ]] ; then __rvm_gems_dir -elif [[ "$rvm_list_flag" -eq 1 ]] ; then +elif [[ "list" = "$1" ]] ; then __rvm_gems_list -elif [[ "$rvm_install_flag" -eq 1 ]] ; then +elif [[ "gemdir" = "$1" ]] ; then + __rvm_gems_gemdir +elif [[ "install" = "$1" ]] ; then __rvm_gem_install else - gem $* + $rvm_scripts_path/log "error" "gems must be passed an action as the first parameter {load,dump,delete,name,list,gemdir,install}" fi