rvm 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/VERSION.yml +1 -1
- data/lib/rvm/environment.rb +1 -1
- data/lib/rvm/shell/shell_wrapper.sh +1 -1
- data/rvm.gemspec +3 -110
- metadata +4 -111
- data/binscripts/rvm +0 -76
- data/binscripts/rvm-auto-ruby +0 -24
- data/binscripts/rvm-prompt +0 -208
- data/binscripts/rvm-shell +0 -35
- data/binscripts/rvm-update-head +0 -58
- data/binscripts/rvm-update-latest +0 -27
- data/binscripts/rvmsudo +0 -20
- data/config/db +0 -71
- data/config/known +0 -54
- data/config/md5 +0 -139
- data/contrib/gemset_snapshot +0 -25
- data/contrib/install-system-wide +0 -221
- data/contrib/r +0 -44
- data/examples/rvmrc +0 -49
- data/gemsets/default.gems +0 -1
- data/gemsets/global.gems +0 -1
- data/help/alias +0 -46
- data/help/benchmark +0 -17
- data/help/cleanup +0 -23
- data/help/debug +0 -8
- data/help/disk-usage +0 -15
- data/help/docs +0 -22
- data/help/exec +0 -33
- data/help/fetch +0 -5
- data/help/gem +0 -0
- data/help/gemdir +0 -0
- data/help/gemset +0 -14
- data/help/implode +0 -0
- data/help/info +0 -62
- data/help/install +0 -0
- data/help/list +0 -0
- data/help/migrate +0 -15
- data/help/monitor +0 -0
- data/help/notes +0 -0
- data/help/package +0 -0
- data/help/rake +0 -14
- data/help/remove +0 -0
- data/help/repair +0 -23
- data/help/reset +0 -0
- data/help/ruby +0 -84
- data/help/rubygems +0 -11
- data/help/rvmrc +0 -34
- data/help/snapshot +0 -15
- data/help/specs +0 -0
- data/help/srcdir +0 -0
- data/help/tests +0 -0
- data/help/tools +0 -22
- data/help/uninstall +0 -0
- data/help/update +0 -0
- data/help/upgrade +0 -18
- data/help/use +0 -0
- data/help/wrapper +0 -41
- data/install +0 -667
- data/man/man1/rvm.1 +0 -380
- data/man/man1/rvm.1.gz +0 -0
- data/scripts/alias +0 -226
- data/scripts/aliases +0 -4
- data/scripts/array +0 -32
- data/scripts/base +0 -57
- data/scripts/cd +0 -94
- data/scripts/cleanup +0 -58
- data/scripts/cli +0 -798
- data/scripts/color +0 -49
- data/scripts/completion +0 -151
- data/scripts/db +0 -87
- data/scripts/default +0 -64
- data/scripts/disk-usage +0 -60
- data/scripts/docs +0 -115
- data/scripts/env +0 -46
- data/scripts/environment-convertor +0 -74
- data/scripts/fetch +0 -231
- data/scripts/gemsets +0 -1045
- data/scripts/get +0 -126
- data/scripts/hash +0 -37
- data/scripts/help +0 -46
- data/scripts/hook +0 -23
- data/scripts/info +0 -213
- data/scripts/initialize +0 -29
- data/scripts/install +0 -667
- data/scripts/irbrc +0 -13
- data/scripts/irbrc.rb +0 -64
- data/scripts/list +0 -315
- data/scripts/log +0 -38
- data/scripts/maglev +0 -193
- data/scripts/manage +0 -2157
- data/scripts/match +0 -6
- data/scripts/md5 +0 -22
- data/scripts/migrate +0 -175
- data/scripts/monitor +0 -105
- data/scripts/notes +0 -140
- data/scripts/override_gem +0 -14
- data/scripts/package +0 -302
- data/scripts/patches +0 -64
- data/scripts/patchsets +0 -87
- data/scripts/repair +0 -199
- data/scripts/rubygems +0 -157
- data/scripts/rvm +0 -128
- data/scripts/rvm-install +0 -667
- data/scripts/selector +0 -904
- data/scripts/set +0 -301
- data/scripts/snapshot +0 -262
- data/scripts/tools +0 -58
- data/scripts/update +0 -667
- data/scripts/upgrade +0 -144
- data/scripts/utility +0 -1499
- data/scripts/version +0 -17
- data/scripts/wrapper +0 -210
data/scripts/aliases
DELETED
data/scripts/array
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
if [[ -n "${ZSH_VERSION:-""}" ]] ; then __array_start=1 ; else __array_start=0 ; fi
|
4
|
-
|
5
|
-
# Usage: contains "a_string" "${an_array[@]}"
|
6
|
-
array_contains()
|
7
|
-
{
|
8
|
-
local pattern="$1" ; shift
|
9
|
-
local index list
|
10
|
-
list=("$@")
|
11
|
-
for index in "${!list[@]}" ; do
|
12
|
-
[[ ${list[index]} = $pattern ]] && { echo $index ; return 0 ; }
|
13
|
-
done
|
14
|
-
echo -1 ; return 1
|
15
|
-
}
|
16
|
-
|
17
|
-
array_length()
|
18
|
-
{
|
19
|
-
array=$1
|
20
|
-
eval "length=\${#${array}[*]}"
|
21
|
-
echo $length
|
22
|
-
return $length
|
23
|
-
}
|
24
|
-
|
25
|
-
array_push()
|
26
|
-
{
|
27
|
-
array=$1 ; item=$2
|
28
|
-
# TODO: allow loop over more arguments.
|
29
|
-
eval "index=\$((\${#${array}[*]} + $__array_start))"
|
30
|
-
eval "${array}[${index}]=${item}"
|
31
|
-
}
|
32
|
-
|
data/scripts/base
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
# Base is a collection general files + commonely included
|
4
|
-
# setup functions.
|
5
|
-
|
6
|
-
# Load the general scripts.
|
7
|
-
# Use rvm_base_except="" to override the except.
|
8
|
-
for script_name in initialize utility selector ; do
|
9
|
-
|
10
|
-
if echo "${rvm_base_except:-""}" | \grep -vq "$script_name" ; then
|
11
|
-
|
12
|
-
source "$rvm_path/scripts/$script_name"
|
13
|
-
|
14
|
-
fi
|
15
|
-
|
16
|
-
done
|
17
|
-
|
18
|
-
unset script_name rvm_base_except
|
19
|
-
|
20
|
-
|
21
|
-
#for option in errexit noclobber nounset ; do
|
22
|
-
# set -o $option
|
23
|
-
#done
|
24
|
-
|
25
|
-
#if [[ -z "${ZSH_VERSION:-""}" ]] ; then
|
26
|
-
# set -o errtrace
|
27
|
-
# set -o pipefail
|
28
|
-
#fi
|
29
|
-
|
30
|
-
if [[ ${rvm_trace_flag:-0} -gt 0 ]]; then
|
31
|
-
|
32
|
-
export rvm_trace_flag=1
|
33
|
-
|
34
|
-
set -o xtrace
|
35
|
-
|
36
|
-
if [[ -z "${ZSH_VERSION:-""}" ]] ; then
|
37
|
-
|
38
|
-
export PS4='+[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() $ }'
|
39
|
-
|
40
|
-
fi
|
41
|
-
|
42
|
-
elif [[ ${rvm_debug_flag:-0} > 0 ]] ; then
|
43
|
-
|
44
|
-
rvm_debug_flag=0
|
45
|
-
|
46
|
-
fi
|
47
|
-
|
48
|
-
if [[ -n "${ZSH_VERSION:-""}" ]] ; then
|
49
|
-
__array_start=1
|
50
|
-
else
|
51
|
-
__array_start=0
|
52
|
-
fi
|
53
|
-
|
54
|
-
export GEM_HOME GEM_PATH rvm_action rvm_alias_expanded rvm_archflags rvm_archive_extension rvm_bin_flag rvm_bin_path rvm_clang_flag rvm_configure_flags rvm_debug_flag rvm_default_flag rvm_delete_flag rvm_docs_type rvm_dump_environment_flag rvm_error_message rvm_expanding_aliases rvm_file_name rvm_gemdir_flag rvm_gemset_name rvm_gemstone_package_file rvm_gemstone_url rvm_head_flag rvm_hook rvm_install_arguments rvm_install_on_use_flag rvm_interactive_flag rvm_llvm_flag rvm_loaded_flag rvm_make_flags rvm_niceness rvm_nightly_flag rvm_only_path_flag rvm_parse_break rvm_patch_names rvm_patch_original_pwd rvm_pretty_print_flag rvm_prior_cc rvm_proxy rvm_quiet_flag rvm_ree_options rvm_reload_flag rvm_remove_flag rvm_ruby_alias rvm_ruby_aliases rvm_ruby_args rvm_ruby_binary rvm_ruby_bits rvm_ruby_configure rvm_ruby_file rvm_ruby_gem_home rvm_ruby_gem_path rvm_ruby_global_gems_path rvm_ruby_home rvm_ruby_interpreter rvm_ruby_irbrc rvm_ruby_load_path rvm_ruby_major_version rvm_ruby_make rvm_ruby_make_install rvm_ruby_minor_version rvm_ruby_mode rvm_ruby_name rvm_ruby_package_file rvm_ruby_package_name rvm_ruby_patch rvm_ruby_patch_level rvm_ruby_release_version rvm_ruby_repo_url rvm_ruby_require rvm_ruby_revision rvm_ruby_selected_flag rvm_ruby_sha rvm_ruby_string rvm_ruby_strings rvm_ruby_tag rvm_ruby_url rvm_ruby_user_tag rvm_ruby_version rvm_script_name rvm_sdk rvm_silent_flag rvm_sticky_flag rvm_system_flag rvm_token rvm_trace_flag rvm_use_flag rvm_user_flag rvm_verbose_flag rvm_wrapper_name
|
55
|
-
|
56
|
-
# Cleanup tmp on exit.
|
57
|
-
trap "__rvm_cleanup_temp_for '$$'" 0 1 2 3 15
|
data/scripts/cd
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
# Source a .rvmrc file in a directory after changing to it, if it exists.
|
4
|
-
# To disable this fature, set export rvm_project_rvmrc=0 in $HOME/.rvmrc
|
5
|
-
if [[ ${rvm_project_rvmrc:-1} -ne 0 ]] ; then
|
6
|
-
|
7
|
-
if [[ -n "${ZSH_VERSION:-""}" ]] ; then
|
8
|
-
|
9
|
-
__rvm_after_cd() {
|
10
|
-
|
11
|
-
rvm_hook="after_cd"
|
12
|
-
|
13
|
-
source "$rvm_path/scripts/hook"
|
14
|
-
|
15
|
-
}
|
16
|
-
|
17
|
-
autoload is-at-least
|
18
|
-
|
19
|
-
if is-at-least 4.3.4 >/dev/null 2>&1; then
|
20
|
-
|
21
|
-
# On zsh, use chpwd_functions
|
22
|
-
chpwd_functions=( "${chpwd_functions[@]}" __rvm_project_rvmrc __rvm_after_cd )
|
23
|
-
|
24
|
-
else
|
25
|
-
|
26
|
-
cd()
|
27
|
-
{
|
28
|
-
builtin cd "$@"
|
29
|
-
|
30
|
-
local result=$?
|
31
|
-
|
32
|
-
__rvm_project_rvmrc
|
33
|
-
|
34
|
-
__rvm_after_cd
|
35
|
-
|
36
|
-
return $result
|
37
|
-
}
|
38
|
-
|
39
|
-
fi
|
40
|
-
|
41
|
-
else
|
42
|
-
|
43
|
-
cd()
|
44
|
-
{
|
45
|
-
builtin cd "$@"
|
46
|
-
|
47
|
-
local result=$?
|
48
|
-
|
49
|
-
__rvm_project_rvmrc
|
50
|
-
|
51
|
-
rvm_hook="after_cd" ; source "$rvm_path/scripts/hook"
|
52
|
-
|
53
|
-
return $result
|
54
|
-
}
|
55
|
-
|
56
|
-
# This functionality is opt-in by setting rvm_cd_complete_flag=1 in ~/.rvmrc
|
57
|
-
# Generic bash cd completion seems to work great for most, so this is only
|
58
|
-
# for those that have some issues with that.
|
59
|
-
if [[ ${rvm_cd_complete_flag:-0} = 1 ]] ; then
|
60
|
-
|
61
|
-
# If $CDPATH is set, bash should tab-complete based on directories in those paths,
|
62
|
-
# but with the cd function above, the built-in tab-complete ignores $CDPATH. This
|
63
|
-
# function returns that functionality.
|
64
|
-
_rvm_cd_complete ()
|
65
|
-
{
|
66
|
-
local directory current matches item index sep
|
67
|
-
sep="${IFS}"
|
68
|
-
declare -x IFS=$'\n'
|
69
|
-
COMPREPLY=()
|
70
|
-
current="${COMP_WORDS[COMP_CWORD]}"
|
71
|
-
if [[ -n "$CDPATH" && ${current:0:1} != "/" ]] ; then
|
72
|
-
index=0
|
73
|
-
# The change to IFS above means that the tr below should replace ':'
|
74
|
-
# with a newline rather than a space. A space would be ignored, breaking
|
75
|
-
# TAB completion based on CDPATH again
|
76
|
-
for directory in $(printf "%s" "$CDPATH" | tr -s ':' '\n') ; do
|
77
|
-
for item in $( compgen -d "$directory/$current" ) ; do
|
78
|
-
COMPREPLY[index++]=${item#$directory/}
|
79
|
-
done
|
80
|
-
done
|
81
|
-
else
|
82
|
-
COMPREPLY=( $(compgen -d ${current}) )
|
83
|
-
fi
|
84
|
-
declare -x IFS="${sep}";
|
85
|
-
}
|
86
|
-
|
87
|
-
complete -o bashdefault -o default -o filenames -o dirnames -o nospace -F _rvm_cd_complete cd
|
88
|
-
|
89
|
-
fi
|
90
|
-
|
91
|
-
fi
|
92
|
-
|
93
|
-
fi
|
94
|
-
|
data/scripts/cleanup
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
rvm_base_except="selector"
|
3
|
-
source "$rvm_path/scripts/base"
|
4
|
-
|
5
|
-
usage()
|
6
|
-
{
|
7
|
-
printf "
|
8
|
-
|
9
|
-
Usage:
|
10
|
-
|
11
|
-
rvm cleanup {all,archives,repos,sources,logs}
|
12
|
-
|
13
|
-
Description:
|
14
|
-
|
15
|
-
Cleans up the directory tree for the specified item.
|
16
|
-
"
|
17
|
-
return 0
|
18
|
-
}
|
19
|
-
|
20
|
-
cleanup()
|
21
|
-
{
|
22
|
-
local cleanup_type current_path
|
23
|
-
|
24
|
-
for cleanup_type in $1; do
|
25
|
-
|
26
|
-
current_path="${rvm_path}/${cleanup_type}"
|
27
|
-
|
28
|
-
if [[ -n "$current_path" && -d "$current_path" \
|
29
|
-
&& "$current_path" != "/" ]]; then
|
30
|
-
|
31
|
-
"$rvm_path/scripts/log" "info" \
|
32
|
-
"Cleaning up rvm directory '$current_path'"
|
33
|
-
|
34
|
-
rm -rf "$current_path"/* >/dev/null 2>&1
|
35
|
-
|
36
|
-
fi
|
37
|
-
|
38
|
-
done
|
39
|
-
|
40
|
-
return 0
|
41
|
-
}
|
42
|
-
|
43
|
-
# Exit when there is no argument.
|
44
|
-
if [[ -z "${1:-""}" ]] ; then
|
45
|
-
usage
|
46
|
-
fi
|
47
|
-
|
48
|
-
case "$1" in
|
49
|
-
all) cleanup "archives repos src log" ;;
|
50
|
-
archives) cleanup "archives" ;;
|
51
|
-
repos) cleanup "repos" ;;
|
52
|
-
sources) cleanup "src" ;;
|
53
|
-
logs) cleanup "log" ;;
|
54
|
-
help) usage ;;
|
55
|
-
*) usage ; exit 1;;
|
56
|
-
esac
|
57
|
-
|
58
|
-
exit $?
|
data/scripts/cli
DELETED
@@ -1,798 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
__rvm_usage() {
|
4
|
-
eval "${PAGER:-less -X} '${rvm_path:-$HOME/.rvm}/README'"
|
5
|
-
}
|
6
|
-
|
7
|
-
__rvm_run_script()
|
8
|
-
{
|
9
|
-
local rvm_script_name="${1:-"$rvm_action"}"
|
10
|
-
|
11
|
-
eval "$rvm_path/scripts/$rvm_script_name $rvm_ruby_args"
|
12
|
-
|
13
|
-
return $?
|
14
|
-
}
|
15
|
-
|
16
|
-
__rvm_parse_args()
|
17
|
-
{
|
18
|
-
# TODO:
|
19
|
-
# Make this more robust '__rvm_history' so that it stores *unique* rvm commands.
|
20
|
-
# Otherwise this file gets big rather fast.
|
21
|
-
#echo "$@" >> $HOME/.rvm_history
|
22
|
-
|
23
|
-
if echo "$@" | \grep -q 'trace' ; then echo "$@" ; __rvm_version ; fi
|
24
|
-
|
25
|
-
rvm_action="${rvm_action:-""}"
|
26
|
-
|
27
|
-
export rvm_ruby_string
|
28
|
-
|
29
|
-
rvm_parse_break=0
|
30
|
-
|
31
|
-
while [[ -n "$next_token" ]] ; do
|
32
|
-
|
33
|
-
rvm_token="$next_token"
|
34
|
-
|
35
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
36
|
-
|
37
|
-
case "$rvm_token" in
|
38
|
-
fetch|version|srcdir|reset|debug|reload|update|monitor|notes|implode|seppuku|question|answer|env)
|
39
|
-
rvm_action=$rvm_token
|
40
|
-
;;
|
41
|
-
|
42
|
-
package)
|
43
|
-
rvm_action="$rvm_token"
|
44
|
-
if [[ "$next_token" = "--only-path" ]]; then
|
45
|
-
shift; rvm_only_path_flag=1
|
46
|
-
fi
|
47
|
-
rvm_ruby_args="$next_token $*"
|
48
|
-
rvm_parse_break=1
|
49
|
-
;;
|
50
|
-
|
51
|
-
use)
|
52
|
-
rvm_action="$rvm_token"
|
53
|
-
rvm_verbose_flag=1
|
54
|
-
if [[ "ruby" = "$next_token" ]] ; then
|
55
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
56
|
-
fi
|
57
|
-
;;
|
58
|
-
|
59
|
-
install|uninstall)
|
60
|
-
export ${rvm_token}_flag=1
|
61
|
-
rvm_action=$rvm_token
|
62
|
-
export rvm_install_arguments="$(__rvm_quote_args_with_shift 1 "$@")"
|
63
|
-
;;
|
64
|
-
|
65
|
-
rm|remove)
|
66
|
-
rvm_action="remove"
|
67
|
-
rvm_remove_flag=1
|
68
|
-
;;
|
69
|
-
|
70
|
-
# Can likely remove this due to the *) case
|
71
|
-
jruby*|ree*|macruby*|rbx*|rubinius*|goruby|ironruby*|default*|maglev*|all)
|
72
|
-
if [[ "rubinius" = "$rvm_token" ]] ; then rvm_token="rbx"; fi
|
73
|
-
rvm_ruby_interpreter="$rvm_token"
|
74
|
-
rvm_ruby_string="$rvm_token"
|
75
|
-
rvm_ruby_strings="$rvm_token"
|
76
|
-
rvm_action="${rvm_action:-use}"
|
77
|
-
if "$rvm_path/scripts"/match "$next_token" "^[0-9]\.[0-9]" ; then
|
78
|
-
rvm_ruby_version=$next_token
|
79
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
80
|
-
fi
|
81
|
-
;;
|
82
|
-
|
83
|
-
default)
|
84
|
-
|
85
|
-
;;
|
86
|
-
|
87
|
-
gemset)
|
88
|
-
rvm_action=$rvm_token
|
89
|
-
|
90
|
-
rvm_ruby_gem_home="${GEM_HOME:-""}"
|
91
|
-
|
92
|
-
if [[ -z "$next_token" ]] ; then
|
93
|
-
rvm_ruby_args="help"
|
94
|
-
|
95
|
-
elif [[ "clear" = "$next_token" ]] ; then
|
96
|
-
__rvm_gemset_clear
|
97
|
-
rvm_ruby_args="clear"
|
98
|
-
|
99
|
-
elif [[ "use" = "$next_token" ]] ; then
|
100
|
-
rvm_use_flag=1
|
101
|
-
rvm_ruby_args="$next_token $@"
|
102
|
-
rvm_gemset_name="$next_token"
|
103
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
104
|
-
|
105
|
-
if [[ -n "$next_token" ]] ; then rvm_gemset_name="$next_token" ; else rvm_gemset_name="" ; fi
|
106
|
-
|
107
|
-
if echo $rvm_gemset_name | \grep -q ${rvm_gemset_separator:-"@"} ; then
|
108
|
-
rvm_ruby_string=$(echo $rvm_gemset_name | sed -e 's/\(.*\)'"${rvm_gemset_separator:-"@"}"'.*/\1/')
|
109
|
-
rvm_gemset_name=$(echo $rvm_gemset_name | sed -e 's/.*'"${rvm_gemset_separator:-"@"}"'\(.*\)/\1/')
|
110
|
-
|
111
|
-
if [[ "${rvm_ruby_string:-""}" != "${rvm_gemset_name:-""}" ]] ; then
|
112
|
-
rvm_ruby_string="$rvm_ruby_string${rvm_gemset_separator:-"@"}$rvm_gemset_name"
|
113
|
-
fi
|
114
|
-
|
115
|
-
rvm_ruby_gem_home="$rvm_ruby_gem_home${rvm_gemset_separator:-"@"}$rvm_gemset_name"
|
116
|
-
fi
|
117
|
-
|
118
|
-
elif [[ "delete" = "$next_token" ]] ; then
|
119
|
-
rvm_delete_flag=1
|
120
|
-
rvm_ruby_args="$next_token $@"
|
121
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
122
|
-
rvm_gemset_name="$next_token"
|
123
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
124
|
-
|
125
|
-
if echo "$rvm_gemset_name" | \grep -q "${rvm_gemset_separator:-"@"}" ; then
|
126
|
-
rvm_ruby_string=$(echo "$rvm_gemset_name" | sed 's/\(.*\)'"${rvm_gemset_separator:-"@"}"'.*/\1/')
|
127
|
-
rvm_gemset_name=$(echo "$rvm_gemset_name" | sed 's/.*'"${rvm_gemset_separator:-"@"}"'\(.*\)/\1/')
|
128
|
-
|
129
|
-
if [[ "$rvm_ruby_string" != "$rvm_gemset_name" ]] ; then
|
130
|
-
rvm_ruby_string="$rvm_ruby_string${rvm_gemset_separator:-"@"}$rvm_gemset_name"
|
131
|
-
fi
|
132
|
-
|
133
|
-
rvm_ruby_gem_home="$rvm_ruby_gem_home${rvm_gemset_separator:-"@"}$rvm_gemset_name"
|
134
|
-
fi
|
135
|
-
|
136
|
-
else
|
137
|
-
if [[ "${rvm_ruby_string:-""}" != "${rvm_gemset_name:-""}" ]] ; then __rvm_ruby_string ; fi
|
138
|
-
rvm_ruby_args="$next_token $@"
|
139
|
-
fi
|
140
|
-
|
141
|
-
rvm_parse_break=1
|
142
|
-
;;
|
143
|
-
|
144
|
-
gemdir|gempath|gemhome)
|
145
|
-
rvm_action=$rvm_token
|
146
|
-
rvm_gemdir_flag=1
|
147
|
-
|
148
|
-
if [[ "system" = "$next_token" ]] ; then
|
149
|
-
rvm_system_flag=1
|
150
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
151
|
-
fi
|
152
|
-
|
153
|
-
if [[ "user" = "$next_token" ]] ; then
|
154
|
-
rvm_user_flag=1
|
155
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
156
|
-
fi
|
157
|
-
;;
|
158
|
-
|
159
|
-
inspect|list|info|strings|get)
|
160
|
-
rvm_action="$rvm_token"
|
161
|
-
rvm_ruby_args="$next_token $@"
|
162
|
-
rvm_parse_break=1
|
163
|
-
;;
|
164
|
-
|
165
|
-
-S)
|
166
|
-
rvm_action="ruby"
|
167
|
-
rvm_ruby_args="$rvm_token $next_token $(__rvm_quote_args "$@")"
|
168
|
-
rvm_parse_break=1
|
169
|
-
;;
|
170
|
-
|
171
|
-
-e)
|
172
|
-
rvm_action="ruby"
|
173
|
-
IFS="\n" ; rvm_ruby_args="$rvm_token '$next_token $@'" ; IFS=" "
|
174
|
-
rvm_parse_break=1
|
175
|
-
;;
|
176
|
-
|
177
|
-
docs|alias|rubygems|exec|cleanup|tools|disk-usage|snapshot|repair|migrate|upgrade)
|
178
|
-
rvm_action="$rvm_token"
|
179
|
-
rvm_ruby_args="$next_token $(__rvm_quote_args "$@")"
|
180
|
-
rvm_parse_break=1
|
181
|
-
;;
|
182
|
-
|
183
|
-
load-rvmrc)
|
184
|
-
rvm_action="rvmrc"
|
185
|
-
rvm_ruby_args="'load' $next_token $(__rvm_quote_args "$@")"
|
186
|
-
rvm_parse_break=1
|
187
|
-
;;
|
188
|
-
|
189
|
-
rvmrc)
|
190
|
-
rvm_action="rvmrc"
|
191
|
-
rvm_ruby_args="$next_token $(__rvm_quote_args "$@")"
|
192
|
-
rvm_parse_break=1
|
193
|
-
;;
|
194
|
-
|
195
|
-
do|ruby|rake|gem|rubydo|rakedo|gemdo)
|
196
|
-
if [[ "do" = "${rvm_action:-""}" ]] ; then rvm_action="ruby" ; fi
|
197
|
-
|
198
|
-
rvm_action=${rvm_token//do}
|
199
|
-
|
200
|
-
if [[ "rake" = "${rvm_action:-""}" || "gem" = "${rvm_action:-""}" || "ruby" = "${rvm_action:-""}" ]] ; then
|
201
|
-
|
202
|
-
if [[ -z "$next_token" ]] ; then
|
203
|
-
|
204
|
-
if [[ "gem" = "${rvm_action:-""}" ]] ; then
|
205
|
-
rvm_action="error"
|
206
|
-
rvm_error_message="'rvm $rvm_action' must be followed by arguments."
|
207
|
-
elif [[ "ruby" = "${rvm_action:-""}" ]] ; then
|
208
|
-
if echo "${rvm_ruby_strings:-""}" | \grep -q ',' ; then
|
209
|
-
rvm_action="ruby"
|
210
|
-
rvm_ruby_args=""
|
211
|
-
else
|
212
|
-
rvm_action="error"
|
213
|
-
rvm_error_message="rvm X,Y,Z '$rvm_action' must be followed by arguments."
|
214
|
-
fi
|
215
|
-
fi
|
216
|
-
|
217
|
-
elif [[ "-S" = "$next_token" ]] ; then
|
218
|
-
rvm_action="ruby"
|
219
|
-
rvm_ruby_args="$flag $next_token $(__rvm_quote_args "$@")"
|
220
|
-
rvm_parse_break=1
|
221
|
-
|
222
|
-
elif [[ "-e" = "$next_token" ]] ; then
|
223
|
-
rvm_action="ruby"
|
224
|
-
IFS="\n" ; rvm_ruby_args="$flag $next_token '$@'" ; IFS=" "
|
225
|
-
rvm_parse_break=1
|
226
|
-
|
227
|
-
else
|
228
|
-
rvm_ruby_args="$next_token $@"
|
229
|
-
rvm_parse_break=1
|
230
|
-
fi
|
231
|
-
else
|
232
|
-
if "$rvm_path/scripts"/match "$next_token" "^-" ; then
|
233
|
-
unset rvm_ruby_strings
|
234
|
-
|
235
|
-
else
|
236
|
-
if "$rvm_path/scripts"/match "$next_token" "^[0-9]" ; then
|
237
|
-
rvm_ruby_strings="${1//,/ }"
|
238
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
239
|
-
unset rvm_ruby_interpreter
|
240
|
-
|
241
|
-
else
|
242
|
-
case "$next_token" in
|
243
|
-
|
244
|
-
ruby|rbx|jruby|macruby|ree|rubinius|maglev|goruby|ironruby)
|
245
|
-
rvm_ruby_strings=$next_token
|
246
|
-
rvm_ruby_interpreter=$next_token
|
247
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
248
|
-
;;
|
249
|
-
|
250
|
-
*)
|
251
|
-
unset rvm_ruby_interpreter rvm_ruby_strings
|
252
|
-
;;
|
253
|
-
esac
|
254
|
-
fi
|
255
|
-
fi
|
256
|
-
fi
|
257
|
-
;;
|
258
|
-
|
259
|
-
benchmark|bench)
|
260
|
-
rvm_action="benchmark"
|
261
|
-
;;
|
262
|
-
|
263
|
-
specs|tests)
|
264
|
-
rvm_action="rake"
|
265
|
-
rvm_ruby_args="${rvm_token/%ss/s}"
|
266
|
-
;;
|
267
|
-
|
268
|
-
-v|--version)
|
269
|
-
if [[ -z "$next_token" ]] ; then
|
270
|
-
rvm_action="version"
|
271
|
-
else
|
272
|
-
rvm_ruby_version="$next_token"
|
273
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
274
|
-
fi
|
275
|
-
;;
|
276
|
-
|
277
|
-
--branch)
|
278
|
-
rvm_ruby_repo_branch="$next_token"
|
279
|
-
next_token="${1:-""}"
|
280
|
-
shift
|
281
|
-
;;
|
282
|
-
|
283
|
-
--repository|--repo|--url)
|
284
|
-
rvm_ruby_repo_url="$next_token"
|
285
|
-
next_token="${1:-""}"
|
286
|
-
shift
|
287
|
-
;;
|
288
|
-
|
289
|
-
--ree-options)
|
290
|
-
if [[ ! -z "$next_token" ]] ; then
|
291
|
-
export rvm_ree_options="${1//,/ }"
|
292
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
293
|
-
|
294
|
-
else
|
295
|
-
rvm_action="error"
|
296
|
-
rvm_error_message="--ree-options *must* be followed by... well... options."
|
297
|
-
fi
|
298
|
-
;;
|
299
|
-
|
300
|
-
--patches|--patch)
|
301
|
-
rvm_patch_names="$next_token ${rvm_patch_names:-""}"
|
302
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
303
|
-
rvm_patch_original_pwd="$PWD"
|
304
|
-
;;
|
305
|
-
|
306
|
-
--head) rvm_head_flag=1 ;;
|
307
|
-
|
308
|
-
--bin)
|
309
|
-
if [[ "update" = "${rvm_action:-""}" ]] ; then
|
310
|
-
rvm_bin_flag=1
|
311
|
-
else
|
312
|
-
rvm_bin_path="$next_token"
|
313
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
314
|
-
fi
|
315
|
-
;;
|
316
|
-
|
317
|
-
-r|--require)
|
318
|
-
if [[ -z "$next_token" ]] ; then
|
319
|
-
rvm_action="error"
|
320
|
-
rvm_error_message="-r|--require *must* be followed by a library name."
|
321
|
-
else
|
322
|
-
rvm_ruby_require="$rvm_ruby_require -r$next_token"
|
323
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
324
|
-
fi
|
325
|
-
;;
|
326
|
-
|
327
|
-
--rdoc|--yard)
|
328
|
-
rvm_docs_type="$rvm_token"
|
329
|
-
rvm_docs_type
|
330
|
-
;;
|
331
|
-
|
332
|
-
-f|--file)
|
333
|
-
rvm_action="ruby"
|
334
|
-
rvm_ruby_file="$next_token"
|
335
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
336
|
-
;;
|
337
|
-
|
338
|
-
system|default)
|
339
|
-
rvm_action=${rvm_action:-use}
|
340
|
-
rvm_ruby_interpreter="$rvm_token"
|
341
|
-
rvm_ruby_string="$rvm_token"
|
342
|
-
rvm_ruby_strings="$rvm_token"
|
343
|
-
;;
|
344
|
-
|
345
|
-
help)
|
346
|
-
rvm_action="$rvm_token"
|
347
|
-
rvm_ruby_args="$next_token $@"
|
348
|
-
rvm_parse_break=1
|
349
|
-
;;
|
350
|
-
|
351
|
-
--passenger)
|
352
|
-
"$rvm_path/scripts/log" "info" \
|
353
|
-
"NOTE: If you are using Passenger 3 you no longer need the passenger_ruby,\nuse the wrapper script for your ruby instead (see 'rvm wrapper')"
|
354
|
-
rvm_wrapper_name="${rvm_token/--/}"
|
355
|
-
;;
|
356
|
-
|
357
|
-
--editor)
|
358
|
-
rvm_wrapper_name="${rvm_token/--/}"
|
359
|
-
;;
|
360
|
-
|
361
|
-
--alias)
|
362
|
-
if [[ -n "$next_token" ]]; then
|
363
|
-
rvm_ruby_aliases="$(echo "${rvm_ruby_aliases//,/ } ${1//,/ }" | __rvm_strip)"
|
364
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
365
|
-
fi
|
366
|
-
;;
|
367
|
-
|
368
|
-
--symlink)
|
369
|
-
"$rvm_path/scripts/log" "warn" "--symlink has been removed, please see 'rvm wrapper'."
|
370
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
371
|
-
;;
|
372
|
-
|
373
|
-
wrapper)
|
374
|
-
rvm_action="$rvm_token"
|
375
|
-
rvm_ruby_string="$next_token" ;
|
376
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
377
|
-
rvm_wrapper_name="$next_token"
|
378
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
379
|
-
rvm_ruby_args="$next_token $@" # list of binaries, or none
|
380
|
-
rvm_parse_break=1
|
381
|
-
;;
|
382
|
-
|
383
|
-
-h|--help|usage)
|
384
|
-
rvm_action=help
|
385
|
-
;;
|
386
|
-
|
387
|
-
--make)
|
388
|
-
rvm_ruby_make="$next_token"
|
389
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
390
|
-
;;
|
391
|
-
--make-install)
|
392
|
-
rvm_ruby_make_install="$next_token" ; shift
|
393
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
394
|
-
;;
|
395
|
-
|
396
|
-
--nice)
|
397
|
-
rvm_niceness="$next_token"
|
398
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
399
|
-
;;
|
400
|
-
|
401
|
-
-l|--level)
|
402
|
-
rvm_ruby_patch_level="p$next_token"
|
403
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
404
|
-
;;
|
405
|
-
|
406
|
-
--sdk)
|
407
|
-
rvm_sdk="$next_token"
|
408
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
409
|
-
;;
|
410
|
-
|
411
|
-
--archflags)
|
412
|
-
rvm_archflags="$next_token"
|
413
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
414
|
-
;;
|
415
|
-
|
416
|
-
--debug)
|
417
|
-
export rvm_debug_flag=1
|
418
|
-
set -o verbose
|
419
|
-
;;
|
420
|
-
|
421
|
-
--trace|--debug)
|
422
|
-
local option
|
423
|
-
|
424
|
-
set -o noclobber
|
425
|
-
set -o nounset
|
426
|
-
|
427
|
-
if [[ -z "${ZSH_VERSION:-""}" ]] ; then
|
428
|
-
set -o errtrace
|
429
|
-
fi
|
430
|
-
|
431
|
-
# errexit pipefail
|
432
|
-
if [[ "$rvm_token" = "--trace" ]] ; then
|
433
|
-
|
434
|
-
export rvm_trace_flag=1
|
435
|
-
|
436
|
-
set -o xtrace
|
437
|
-
|
438
|
-
if [[ -z "${ZSH_VERSION:-""}" ]] ; then
|
439
|
-
export PS4='+[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() $ }'
|
440
|
-
fi
|
441
|
-
fi
|
442
|
-
;;
|
443
|
-
|
444
|
-
--proxy)
|
445
|
-
rvm_proxy="$next_token"
|
446
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
447
|
-
;;
|
448
|
-
|
449
|
-
-q|--quiet) rvm_quiet_flag=1 ;;
|
450
|
-
-s|--silent) rvm_silent_flag=1 ;;
|
451
|
-
--disable-llvm|--disable-jit) rvm_llvm_flag=0 ;;
|
452
|
-
--enable-llvm|--enable-jit) rvm_llvm_flag=1 ;;
|
453
|
-
--install) rvm_install_on_use_flag=1 ;;
|
454
|
-
--pretty) rvm_pretty_print_flag=1 ;;
|
455
|
-
|
456
|
-
reboot|damnit|wtf|argh|BOOM|boom|wth) $rvm_action="reboot" ;;
|
457
|
-
|
458
|
-
--self|--gem|--rubygems|--reconfigure|--default|--force|--export|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--import|--rvmrc|--sticky|--create|--gems|--docs)
|
459
|
-
export "rvm_${rvm_token//-/}_flag"=1
|
460
|
-
;;
|
461
|
-
|
462
|
-
--dump-environment)
|
463
|
-
export rvm_dump_environment_flag="$next_token"
|
464
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
465
|
-
;;
|
466
|
-
|
467
|
-
--clang)
|
468
|
-
export rvm_clang_flag=1
|
469
|
-
export rvm_prior_cc="$CC"
|
470
|
-
export CC="clang"
|
471
|
-
;;
|
472
|
-
|
473
|
-
-j)
|
474
|
-
if [[ ! -z "$next_token" ]] ; then
|
475
|
-
rvm_make_flags="$rvm_make_flags -j$next_token"
|
476
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
477
|
-
|
478
|
-
else
|
479
|
-
rvm_action="error"
|
480
|
-
rvm_error_message="-j *must* be followed by an integer (normally the # of CPU's in your machine)."
|
481
|
-
fi
|
482
|
-
;;
|
483
|
-
|
484
|
-
--with-rubies)
|
485
|
-
rvm_ruby_strings="$next_token"
|
486
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
487
|
-
|
488
|
-
;;
|
489
|
-
|
490
|
-
-C|--configure)
|
491
|
-
if [[ ! -z "$next_token" ]] ; then
|
492
|
-
rvm_configure_flags="${next_token//,--/ --}"
|
493
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
494
|
-
|
495
|
-
else
|
496
|
-
rvm_action="error"
|
497
|
-
rvm_error_message="--configure *must* be followed by configure flags."
|
498
|
-
fi
|
499
|
-
;;
|
500
|
-
|
501
|
-
--with-*|--without-*|--enable-*|--disable-*)
|
502
|
-
rvm_configure_flags="${rvm_configure_flags:-""} $rvm_token"
|
503
|
-
;;
|
504
|
-
|
505
|
-
-I|--include)
|
506
|
-
if [[ -z "$next_token" ]] ; then
|
507
|
-
rvm_action="error"
|
508
|
-
rvm_error_message="-I|--include *must* be followed by a path."
|
509
|
-
else
|
510
|
-
rvm_ruby_load_path="$rvm_ruby_load_path:$next_token"
|
511
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
512
|
-
fi
|
513
|
-
;;
|
514
|
-
|
515
|
-
--) rvm_ruby_args="$next_token $*" ; rvm_parse_break=1 ;;
|
516
|
-
|
517
|
-
*)
|
518
|
-
if [[ -n "$rvm_token" ]] ; then
|
519
|
-
|
520
|
-
|
521
|
-
if [[ "gemset" = "$rvm_action" ]] ; then
|
522
|
-
if "$rvm_path/scripts/match" "$rvm_token" "^.+${rvm_gemset_separator:-"@"}.+$" ; then
|
523
|
-
rvm_gemset_name="${rvm_token/*${rvm_gemset_separator:-"@"}/}"
|
524
|
-
rvm_ruby_string="${rvm_token/${rvm_gemset_separator:-"@"}*/}"
|
525
|
-
|
526
|
-
elif echo "$rvm_token" | \grep -q '.gems$' ; then
|
527
|
-
rvm_file_name="${rvm_token/.gems/}.gems" # Account for possible .gems.gems
|
528
|
-
# elif [[ ! -z "$(echo "$rvm_token" | awk '/\.gems$/')" ]] ; then
|
529
|
-
else
|
530
|
-
rvm_gemset_name="${rvm_token/.gems/}"
|
531
|
-
rvm_file_name="$rvm_gemset_name.gems"
|
532
|
-
fi
|
533
|
-
|
534
|
-
elif echo "$rvm_token" | \grep -q ',' ; then
|
535
|
-
rvm_ruby_strings="$rvm_token"
|
536
|
-
if [[ -z "${rvm_action:-""}" ]] ; then
|
537
|
-
rvm_action="ruby" # Not sure if we really want to do this but we'll try it out.
|
538
|
-
fi
|
539
|
-
|
540
|
-
elif "$rvm_path/scripts/match" "$rvm_token" "^${rvm_gemset_separator:-"@"}" ; then
|
541
|
-
rvm_action="${rvm_action:-use}"
|
542
|
-
rvm_gemset_name="${rvm_token/*${rvm_gemset_separator:-"@"}/}"
|
543
|
-
rvm_ruby_string="${rvm_ruby_string:-""}"
|
544
|
-
rvm_ruby_strings="${rvm_ruby_string}${rvm_gemset_separator:-"@"}${rvm_gemset_name}"
|
545
|
-
|
546
|
-
elif "$rvm_path/scripts/match" "$rvm_token" "^.+${rvm_gemset_separator:-"@"}.+$" ; then
|
547
|
-
gemset_name="${rvm_token/*${rvm_gemset_separator:-"@"}/}"
|
548
|
-
rvm_ruby_string="$rvm_token"
|
549
|
-
rvm_ruby_strings="$rvm_token"
|
550
|
-
|
551
|
-
elif "$rvm_path/scripts/match" "$rvm_token" "^.+\\+.+$" ; then
|
552
|
-
rvm_ruby_alias="${rvm_token/*+/}"
|
553
|
-
rvm_ruby_string="${rvm_token/+*/}"
|
554
|
-
rvm_ruby_strings="$rvm_ruby_string"
|
555
|
-
|
556
|
-
elif "$rvm_path/scripts/match" "$rvm_token" "-" ; then
|
557
|
-
rvm_ruby_string="$rvm_token"
|
558
|
-
rvm_ruby_strings="$rvm_token"
|
559
|
-
|
560
|
-
elif "$rvm_path/scripts/match" "$rvm_token" "^[0-9].[0-9]" ; then
|
561
|
-
rvm_ruby_string="$rvm_token"
|
562
|
-
rvm_ruby_strings="$rvm_token"
|
563
|
-
rvm_action="${rvm_action:-use}"
|
564
|
-
|
565
|
-
elif "$rvm_path/scripts/match" "$rvm_token" "^ree-" ; then
|
566
|
-
rvm_ruby_string="$rvm_token"
|
567
|
-
rvm_ruby_strings="$rvm_token"
|
568
|
-
rvm_action="${rvm_action:-use}"
|
569
|
-
|
570
|
-
elif [[ -L "$rvm_path/rubies/$rvm_token" ]] ; then # Alias
|
571
|
-
rvm_ruby_string=$rvm_token
|
572
|
-
rvm_ruby_strings="$rvm_token"
|
573
|
-
rvm_action="${rvm_action:-use}"
|
574
|
-
|
575
|
-
else
|
576
|
-
if "$rvm_path/scripts/match" "$rvm_token" ".rb$" ; then # we have a specified ruby script
|
577
|
-
rvm_ruby_args="$rvm_token"
|
578
|
-
rvm_ruby_file="$rvm_token"
|
579
|
-
if [[ -z "${rvm_action:-""}" || "$rvm_action" = "use" ]]; then
|
580
|
-
rvm_action="ruby"
|
581
|
-
fi
|
582
|
-
else
|
583
|
-
rvm_action="error"
|
584
|
-
rvm_error_message="Unrecognized command line argument: '$rvm_token'"
|
585
|
-
fi
|
586
|
-
fi
|
587
|
-
else
|
588
|
-
rvm_action="error"
|
589
|
-
rvm_error_message="Unrecognized command line argument(s): '$rvm_token $@'"
|
590
|
-
fi
|
591
|
-
|
592
|
-
if [[ "error" = "${rvm_action:-""}" ]] ; then break ; fi
|
593
|
-
esac
|
594
|
-
|
595
|
-
if [[ -z "${rvm_action:-""}" && -n "${rvm_ruby_string:-""}" ]] ; then rvm_action="use" ; fi
|
596
|
-
|
597
|
-
if [[ ${rvm_parse_break:-0} -eq 1 || -n "${rvm_error_message:-""}" ]] ; then break ; fi
|
598
|
-
done
|
599
|
-
|
600
|
-
# Empty args list.
|
601
|
-
while [[ $# -gt 0 ]] ; do shift ; done
|
602
|
-
|
603
|
-
if [[ -n "${rvm_error_message:-""}" ]] ; then
|
604
|
-
"$rvm_path/scripts"/log "fail" "$rvm_error_message ( see: 'rvm usage' )"
|
605
|
-
return 1
|
606
|
-
fi
|
607
|
-
}
|
608
|
-
|
609
|
-
rvm()
|
610
|
-
{
|
611
|
-
local result
|
612
|
-
|
613
|
-
__rvm_setup
|
614
|
-
|
615
|
-
case $- in *i*) rvm_interactive_flag=1 ;;
|
616
|
-
*) rvm_interactive_flag=0 ;;
|
617
|
-
esac ; export rvm_interactive_flag
|
618
|
-
|
619
|
-
if [[ -z "${ZSH_VERSION:-""}" ]] ; then
|
620
|
-
|
621
|
-
trap '\rm -rf "${rvm_tmp_path:-"$rvm_path/tmp"}/$$" >/dev/null 2>&1' 0 1 2 3 15
|
622
|
-
|
623
|
-
fi
|
624
|
-
|
625
|
-
# Check that this is the current version.
|
626
|
-
disk_version="$(awk '/:/{printf $NF"."}' "$rvm_path/lib/VERSION.yml")"
|
627
|
-
disk_version="${disk_version/%.}"
|
628
|
-
|
629
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
630
|
-
|
631
|
-
if [[ "${rvm_version:-""}" != "${disk_version:-""}" && "reload" != "${next_token:-""}" ]] ; then
|
632
|
-
|
633
|
-
printf "\nA RVM version ${disk_version} is installed yet ${rvm_version} is loaded.\n Please do one of the following:\n * 'rvm reload'\n * open a new shell\n * source your shell init scripts"
|
634
|
-
|
635
|
-
return 1
|
636
|
-
|
637
|
-
fi
|
638
|
-
|
639
|
-
__rvm_cleanse_variables
|
640
|
-
|
641
|
-
__rvm_load_rvmrc
|
642
|
-
|
643
|
-
__rvm_initialize
|
644
|
-
|
645
|
-
__rvm_parse_args "$@"
|
646
|
-
|
647
|
-
if [[ $? -gt 0 ]] ; then
|
648
|
-
result=$?
|
649
|
-
return $result
|
650
|
-
fi
|
651
|
-
|
652
|
-
rvm_action="${rvm_action:-usage}"
|
653
|
-
|
654
|
-
export GEM_HOME GEM_PATH rvm_action rvm_archflags rvm_bin_flag rvm_bin_path rvm_clang_flag rvm_configure_flags rvm_debug_flag rvm_delete_flag rvm_docs_type rvm_dump_environment_flag rvm_error_message rvm_file_name rvm_gemdir_flag rvm_gemset_name rvm_head_flag rvm_install_arguments rvm_install_on_use_flag rvm_interactive_flag rvm_llvm_flag rvm_loaded_flag rvm_make_flags rvm_niceness rvm_only_path_flag rvm_parse_break rvm_patch_names rvm_patch_original_pwd rvm_pretty_print_flag rvm_prior_cc rvm_proxy rvm_quiet_flag rvm_ree_options rvm_reload_flag rvm_remove_flag rvm_ruby_alias rvm_ruby_aliases rvm_ruby_args rvm_ruby_file rvm_ruby_gem_home rvm_ruby_interpreter rvm_ruby_load_path rvm_ruby_make rvm_ruby_make_install rvm_ruby_patch_level rvm_ruby_repo_url rvm_ruby_repo_branch rvm_ruby_require rvm_ruby_string rvm_ruby_strings rvm_ruby_version rvm_script_name rvm_sdk rvm_silent_flag rvm_system_flag rvm_token rvm_trace_flag rvm_use_flag rvm_user_flag rvm_verbose_flag rvm_wrapper_name
|
655
|
-
|
656
|
-
case "$rvm_action" in
|
657
|
-
use) __rvm_use ;;
|
658
|
-
srcdir) __rvm_source_dir ;;
|
659
|
-
strings) __rvm_strings ;;
|
660
|
-
version) __rvm_version ;;
|
661
|
-
reset) __rvm_reset ;;
|
662
|
-
update) __rvm_update ;;
|
663
|
-
reboot) __rvm_reboot ;;
|
664
|
-
usage) __rvm_usage ;;
|
665
|
-
benchmark) __rvm_benchmark ;;
|
666
|
-
inspect) __rvm_inspect ;;
|
667
|
-
implode|seppuku) __rvm_implode ;;
|
668
|
-
|
669
|
-
list) "$rvm_path/scripts"/list $rvm_ruby_args ;;
|
670
|
-
# TODO: Make debug run in the current environment.
|
671
|
-
debug) "$rvm_path/scripts/info" '' debug ;;
|
672
|
-
help) "$rvm_path/scripts/help" $rvm_ruby_args ;;
|
673
|
-
env) "$rvm_path/scripts/env" "$rvm_ruby_string" ;;
|
674
|
-
info)
|
675
|
-
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
|
676
|
-
if [[ "$next_token" = "info" ]]; then shift; fi
|
677
|
-
"$rvm_path/scripts/info" $rvm_ruby_args
|
678
|
-
;;
|
679
|
-
|
680
|
-
answer) __rvm_Answer_to_the_Ultimate_Question_of_Life_the_Universe_and_Everything ; result=42 ;;
|
681
|
-
question) __rvm_ultimate_question ; result=42 ;;
|
682
|
-
|
683
|
-
wrapper)
|
684
|
-
"$rvm_path/scripts/wrapper" "$rvm_ruby_string" "$rvm_wrapper_name" $rvm_ruby_args
|
685
|
-
unset rvm_wrapper_name
|
686
|
-
;;
|
687
|
-
|
688
|
-
gemdir|gemhome|gempath)
|
689
|
-
"$rvm_path/scripts/gemsets" "$rvm_action"
|
690
|
-
;;
|
691
|
-
|
692
|
-
ruby|gem|rake|exec)
|
693
|
-
old_rvm_ruby_string=${rvm_ruby_string:-""}
|
694
|
-
unset rvm_ruby_string
|
695
|
-
export rvm_ruby_strings
|
696
|
-
|
697
|
-
"$rvm_path/scripts/set" "$rvm_action" $rvm_ruby_args ; result=$?
|
698
|
-
|
699
|
-
# Restore the state pre-sets.
|
700
|
-
[[ -n "$old_rvm_ruby_string" ]] && rvm_ruby_string=$old_rvm_ruby_string
|
701
|
-
|
702
|
-
unset old_rvm_ruby_string
|
703
|
-
;;
|
704
|
-
|
705
|
-
cleanup|tools|snapshot|disk-usage|repair|alias|docs|rubygems|migrate|upgrade)
|
706
|
-
__rvm_run_script "$rvm_action"
|
707
|
-
;;
|
708
|
-
|
709
|
-
rvmrc) eval "__rvm_rvmrc_tools $rvm_ruby_args" ;;
|
710
|
-
|
711
|
-
gemset)
|
712
|
-
#if "$rvm_path/scripts/match" $rvm_ruby_args use ; then
|
713
|
-
if [[ ${rvm_use_flag:-0} -eq 1 ]] ; then
|
714
|
-
__rvm_gemset_select && __rvm_gemset_use
|
715
|
-
else
|
716
|
-
export rvm_ruby_strings
|
717
|
-
|
718
|
-
"$rvm_path/scripts/gemsets" $rvm_ruby_args ; result=$?
|
719
|
-
|
720
|
-
rvm_ruby_strings=""
|
721
|
-
|
722
|
-
# Clear the gemset.
|
723
|
-
if [[ ${rvm_delete_flag:-0} -eq 1 ]] ; then
|
724
|
-
gem_prefix="$(echo "${GEM_HOME:-""}" | sed 's/'${rvm_gemset_separator:-"@"}'.*$//')"
|
725
|
-
|
726
|
-
if [[ "${GEM_HOME:-""}" = "${gem_prefix}${rvm_gemset_separator:-"@"}${rvm_gemset_name}" ]] ; then
|
727
|
-
rvm_ruby_gem_home="$gem_prefix"
|
728
|
-
GEM_HOME="$rvm_ruby_gem_home"
|
729
|
-
GEM_PATH="$rvm_ruby_gem_home:$rvm_ruby_gem_home${rvm_gemset_separator:-"@"}global"
|
730
|
-
export rvm_ruby_gem_home GEM_HOME GEM_PATH
|
731
|
-
fi
|
732
|
-
unset gem_prefix
|
733
|
-
fi
|
734
|
-
fi
|
735
|
-
;;
|
736
|
-
|
737
|
-
monitor)
|
738
|
-
export rvm_ruby_strings rvm_ruby_string
|
739
|
-
"$rvm_path/scripts/monitor"
|
740
|
-
;;
|
741
|
-
|
742
|
-
notes) "$rvm_path/scripts/notes" ;;
|
743
|
-
get) "$rvm_path/scripts/get" $rvm_ruby_args ;;
|
744
|
-
reload) rvm_reload_flag=1 ;;
|
745
|
-
tests|specs) rvm_action="rake" ; __rvm_do ;;
|
746
|
-
package) "$rvm_path/scripts/package" $rvm_ruby_args ;;
|
747
|
-
|
748
|
-
fetch|install|uninstall|remove)
|
749
|
-
if [[ -n "$rvm_ruby_strings" ]]; then
|
750
|
-
"$rvm_path/scripts"/manage "$rvm_action" "$rvm_ruby_strings"
|
751
|
-
else
|
752
|
-
"$rvm_path/scripts"/manage "$rvm_action"
|
753
|
-
fi
|
754
|
-
;;
|
755
|
-
|
756
|
-
error) false ;;
|
757
|
-
|
758
|
-
*)
|
759
|
-
if [[ -n "${rvm_action:-""}" ]] ; then
|
760
|
-
"$rvm_path/scripts/log" "fail" "unknown action '$rvm_action'"
|
761
|
-
else
|
762
|
-
__rvm_usage
|
763
|
-
fi
|
764
|
-
false # result
|
765
|
-
esac
|
766
|
-
|
767
|
-
result=${result:-$?}
|
768
|
-
|
769
|
-
if [[ ${rvm_reload_flag:-0} -eq 1 ]] ; then
|
770
|
-
|
771
|
-
rvm_loaded_flag=0
|
772
|
-
|
773
|
-
source "$rvm_path/scripts/rvm"
|
774
|
-
|
775
|
-
# Note: Not using builtin on purpose. Done so we can trigger a reload the rvmrc.
|
776
|
-
__rvm_project_rvmrc
|
777
|
-
|
778
|
-
fi
|
779
|
-
|
780
|
-
if [[ ${rvm_trace_flag:-0} -eq 1 ]] ; then
|
781
|
-
rvm_trace_flag=0
|
782
|
-
set +o verbose
|
783
|
-
set +o noclobber
|
784
|
-
set +o nounset
|
785
|
-
set +o xtrace
|
786
|
-
|
787
|
-
if [[ -z "${ZSH_VERSION:-""}" ]] ; then
|
788
|
-
set +o errtrace
|
789
|
-
fi
|
790
|
-
fi
|
791
|
-
|
792
|
-
__rvm_teardown
|
793
|
-
|
794
|
-
return ${result:-0}
|
795
|
-
}
|
796
|
-
|
797
|
-
__rvm_project_rvmrc
|
798
|
-
|