scripts/cli in rvm-0.0.55 vs scripts/cli in rvm-0.0.56
- old
+ new
@@ -3,11 +3,11 @@
function __rvm_meta {
rvm_meta_author="Wayne E. Seguin"
rvm_meta_author_email="wayneeseguin@gmail.com"
rvm_meta_website="http://rvm.beginrescueend.com/"
rvm_meta_version="`cat $rvm_path/lib/VERSION.yml | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//'`"
- rvm_meta_updated="2009.10.05"
+ rvm_meta_updated="2009.10.09"
}
function __rvm_version { __rvm_meta ; echo "rvm $rvm_meta_version ($rvm_meta_updated) [$rvm_meta_website]" ; }
function __rvm_usage {
@@ -101,11 +101,11 @@
https://www.pivotaltracker.com/projects/26822
" | ${PAGER:-/usr/bin/less}
}
-function __rvm_parse-args {
+function __rvm_parse_args {
while [ $# -gt 0 ] ; do
rvm_token="$1" ; shift
case "$rvm_token" in
install|uninstall|path|info|setup|version|srcdir|list|reset|debug|reload|implode|update|readline|iconv|gemsync)
rvm_action=$rvm_token
@@ -138,22 +138,18 @@
if [ ! -z "$(echo $1 | awk '/^[0-9]/')" ] ; then
rvm_ruby_version=$1 ; shift
fi
;;
- gemset)
- rvm_action=$rvm_token
- if [ "$1" = "delete" ] ; then
- rvm_delete_flag=1
- shift
- if [ -z "$1" -a -z "$rvm_gem_set_name" ] ; then
- rvm_action="error"
- rvm_error_message="A gem set name must be specified with 'gemset delete'"
- else
- rvm_gem_set_name="$1"
- shift
- fi
+ gems|gemset)
+ rvm_action="gems"
+ if [ "$1" = "name" -o "$1" = "dir" -o "$1" = "list" -o "$1" = "empty" -o "$1" = "delete" ] ; then
+ eval "rvm_${1}_flag=1" ; shift
+ elif [ "$1" = "dump" -o "$1" = "load" ] ; then
+ eval "rvm_${1}_flag=1" ; shift
+ else
+ rvm_use_flag=1 # Default is to use the (named) gem set.
fi
;;
gemdir)
rvm_action=$rvm_token
@@ -161,18 +157,17 @@
if [ "$1" = "user" ] ; then rvm_ruby_interpreter="user" ; shift ; fi
rvm_ruby_interpreter="${rvm_ruby_interpreter:-current}"
;;
--load|load|dump)
- rvm_action=gemset
+ rvm_action=gems
eval "rvm_${rvm_token}_flag=1"
if [ ! -z "$1" ] ; then
- rvm_gem_set_name=$(echo $1 | sed 's/\.gemset//' | xargs basename)
- rvm_file_name="$(echo $1 | sed 's/\.gemset//').gemset"
+ rvm_file_name="$(echo $1 | sed 's/\.gems//').gems"
shift
else
- rvm_file_name="$rvm_gem_set_name.gemset"
+ rvm_file_name="$rvm_gem_set_name.gems"
fi
;;
gemdup)
rvm_action=$rvm_token
@@ -192,11 +187,11 @@
do|ruby|rake|gem|rubydo|rakedo|gemdo)
if [ "$rvm_action" = "do" ] ; then rvm_action="ruby" ; fi
rvm_action=$(echo $rvm_token | sed 's/do//g')
- if [ "$rvm_action" = "rake" -o "$rvm_action" = "gem" ] ; then
+ if [ "$rvm_action" = "rake" -o "$rvm_action" = "gem" -o "$rvm_action" = "ruby" ] ; then
rvm_action="ruby"
rvm_ruby_args="$rvm_token $@"
rvm_parse_break=1
else
if [ ! -z "$(echo $1 | awk '/^-/')" ] ; then
@@ -261,17 +256,17 @@
rvm_action="${rvm_action:-use}"
shift
;;
--head)
- rvm_ruby_rev="head"
+ rvm_ruby_revision="head"
rvm_head_flag=1
rvm_action="${rvm_action:-use}"
;;
--rev|--revision)
- rvm_ruby_rev="$1";
+ rvm_ruby_revision="$1";
rvm_action="${rvm_action:-use}"
shift
;;
-b|--branch)
@@ -345,21 +340,20 @@
rvm_action="use"
rvm_ruby_interpreter="system"
;;
--install) rvm_install_on_use_flag=1 ;;
+ -h|--help|usage|help) rvm_action=help ;;
--prefix) rvm_prefix_path="$1" ; shift ;;
-G|--gems) rvm_gem_path="$1" ; shift ;;
- --source) rvm_source_path="$1" ; shift ;;
+ --source) rvm_src_path="$1" ; shift ;;
--archives) rvm_archives_path="$1" ; shift ;;
--make) rvm_ruby_make="$1" ; shift ;;
--make-install) rvm_ruby_make_install="$1"; shift ;;
--nice) rvm_niceness="$1" ; shift ;;
-l|--level) rvm_ruby_patch_level="$1" ; shift ;;
- -h|--help|usage|help) rvm_action=help ; shift ;;
-m|--gem-set) rvm_gem_set_name="$1" ; shift ;;
- --rm-gem-set) rvm_gem_set_name_rm="$1" ; shift ;;
tests|specs) rvm_action="tests" ;;
--trace)
eval "rvm_$(echo $rvm_token | sed 's/-//g')_flag=1"
set -x
@@ -372,17 +366,22 @@
$rvm_action="reboot"
;;
*)
if [ ! -z "$rvm_token" ] ; then
- if [ ! -z "`echo $rvm_token | awk '/,/'`" ] ; then
+ if [ "$rvm_action" = "gems" ] ; then
+ if [ -z "$(echo $rvm_token | awk '/\.gems$/')" ] ; then
+ rvm_gem_set_name=$(echo $rvm_token | sed 's/\.gems//g')
+ else
+ rvm_file_name="$(echo $rvm_token | sed 's/\.gems//g').gems"
+ fi
+ elif [ ! -z "$(echo $rvm_token | awk '/,/')" ] ; then
rvm_ruby_version="$rvm_token"
if [ -z "$rvm_action" ] ; then
- rvm_action="ruby" # Not sure if we really want to do this but we'll try it out.
+ rvm_action="do" # Not sure if we really want to do this but we'll try it out.
fi
else
-
if [ ! -z "`echo $rvm_token | awk '/\.rb$/{print}' 2> /dev/null`" ] ; then # we have a specified ruby script
rvm_ruby_args=$rvm_token
rvm_ruby_file=$rvm_token
if [ -z "$rvm_action" ] ; then
rvm_action="ruby" # Not sure if we really want to do this but we'll try it out.
@@ -407,15 +406,17 @@
if [ ! -z "$rvm_error_message" ] ; then __rvm_pushpop ; return 1 ; fi
}
function rvm {
+ trap '__rvm_cleanup_variables ; rm -f "/tmp/rvm/$$" >/dev/null 2>&1' 0 1 2 3 15
+
__rvm_cleanup_variables
__rvm_load-rvmrc
__rvm_initialize
__rvm_load_defaults
- __rvm_parse-args $@
+ __rvm_parse_args $@
if [ -z "$rvm_trace_flag" ] ; then set +x ; else set -x ; fi
result=0
case "$rvm_action" in
use) __rvm_use ; result=$? ;;
@@ -434,30 +435,18 @@
reboot) __rvm_reboot ; result=$? ;;
usage|help) __rvm_usage ; result=$? ;;
benchmark) __rvm_benchmark ; result=$? ;;
ruby) __rvm_do ; result=$? ;;
inspect) __rvm_inspect ; result=$? ;;
+ gems) __rvm_gems ; result=$? ;;
install|uninstall|remove)
__rvm_manage_rubies
result=$?
;;
- gemset)
- if [ ! -z "$rvm_load_flag" ] ; then
- __rvm_gemset_load
- elif [ ! -z "$rvm_dump_flag" ] ; then
- __rvm_gemset_load
- elif [ ! -z "$rvm_delete_flag" ] ; then
- __rvm_gemset_delete
- else
- rvm_action="error"
- rvm_error_message="At least one of load, dump, or delete must be specified with 'gemset'."
- fi
- ;;
-
gemsync)
- rvm_source_gem_path=`__rvm_select ; echo $rvm_gem_home`
+ rvm_source_gem_path=`__rvm_select ; echo $rvm_ruby_gem_home`
__rvm_gem_sync
;;
tests|specs)
rvm_summary_flag=1