rvm 0.1.47 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/binscripts/rvm +2 -2
- data/binscripts/rvm-shell +1 -1
- data/config/db +1 -1
- data/config/known +2 -1
- data/config/md5 +26 -0
- data/contrib/install-system-wide +1 -1
- data/install +6 -6
- data/lib/VERSION.yml +3 -3
- data/rvm.gemspec +2 -2
- data/scripts/base +1 -1
- data/scripts/cli +16 -11
- data/scripts/completion +2 -2
- data/scripts/docs +1 -1
- data/scripts/environment-convertor +4 -4
- data/scripts/gemsets +2 -2
- data/scripts/info +1 -1
- data/scripts/install +6 -6
- data/scripts/list +5 -5
- data/scripts/maglev +5 -5
- data/scripts/manage +32 -8
- data/scripts/package +3 -3
- data/scripts/rvm +3 -3
- data/scripts/rvm-install +6 -6
- data/scripts/selector +12 -7
- data/scripts/set +1 -1
- data/scripts/snapshot +3 -3
- data/scripts/update +6 -6
- data/scripts/upgrade +8 -8
- data/scripts/utility +137 -21
- metadata +5 -5
data/binscripts/rvm
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
if [[ -z "$rvm_ignore_rvmrc" ]]; then
|
4
4
|
for rvmrc in /etc/rvmrc "$HOME/.rvmrc" ; do
|
5
5
|
if [[ -f "$rvmrc" ]] ; then
|
6
|
-
if grep -q '^\s*rvm .*$' "$rvmrc" ; then
|
6
|
+
if \grep -q '^\s*rvm .*$' "$rvmrc" ; then
|
7
7
|
printf "\nError: $rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
|
8
8
|
exit 1
|
9
9
|
else
|
@@ -34,7 +34,7 @@ if [[ -z "$rvm_prefix" ]] ; then
|
|
34
34
|
fi
|
35
35
|
|
36
36
|
# Fix rvm_prefix changes.
|
37
|
-
echo "$rvm_prefix" | grep -vq '\(\/\|\.\)$' && [[ -d "$rvm_prefix/rvm/scripts" ]]
|
37
|
+
echo "$rvm_prefix" | \grep -vq '\(\/\|\.\)$' && [[ -d "$rvm_prefix/rvm/scripts" ]]
|
38
38
|
rvm_prefix_needs_trailing_slash="$?"
|
39
39
|
if [[ "$rvm_prefix" = "/usr/local" || "$rvm_prefix_needs_trailing_slash" = "0" ]]; then
|
40
40
|
rvm_prefix="$rvm_prefix/"
|
data/binscripts/rvm-shell
CHANGED
@@ -11,7 +11,7 @@ __rvm_shell_lookup_script() {
|
|
11
11
|
}
|
12
12
|
|
13
13
|
# If the first argument isn't -c, remove it and set it to the ruby string value.
|
14
|
-
if [[ -n "$1" && ! -f "$1" && -n "$(echo "$1" | grep -v '^-')" ]]; then
|
14
|
+
if [[ -n "$1" && ! -f "$1" && -n "$(echo "$1" | \grep -v '^-')" ]]; then
|
15
15
|
rvm_shell_ruby_string="$1"
|
16
16
|
shift
|
17
17
|
fi
|
data/config/db
CHANGED
@@ -39,7 +39,7 @@ ree_1.8.6_repo_url=git://github.com/FooBarWidget/rubyenterpriseedition.git
|
|
39
39
|
ree_1.8.7_url=http://rubyforge.org/frs/download.php/71096
|
40
40
|
ree_1.8.7_repo_url=git://github.com/FooBarWidget/rubyenterpriseedition187.git
|
41
41
|
ree_1.8.7_patch_level=2010.02
|
42
|
-
jruby_version=1.5.
|
42
|
+
jruby_version=1.5.2
|
43
43
|
jruby_repo_url=git://github.com/jruby/jruby.git
|
44
44
|
jruby_url=http://jruby.org.s3.amazonaws.com/downloads
|
45
45
|
macruby_version=0.6
|
data/config/known
CHANGED
data/config/md5
CHANGED
@@ -28,6 +28,31 @@ ruby-1.9.2-preview3.tar.gz=209e59f3495a5503fa948c2732f1d705
|
|
28
28
|
ruby-1.9.2-rc1.tar.gz=fdedd5b42ae89a9a46797823ad2d9acf
|
29
29
|
ruby-1.9.2-rc2.tar.gz=d12cd39eee4d99bc54b52aba5a0ba4e1
|
30
30
|
ruby-1.9.2-p0.tar.gz=755aba44607c580fddc25e7c89260460
|
31
|
+
ruby-1.8.5-p115.tar.bz2=03955e3c367b9beb3efe144c9f00d689
|
32
|
+
ruby-1.8.5-p231.tar.bz2=327f5aa6573787432222e96195cffd1e
|
33
|
+
ruby-1.8.6-p286.tar.bz2=e6b6bf8f34370e433936adb7a7065e63
|
34
|
+
ruby-1.8.6-p287.tar.bz2=80b5f3db12531d36e6c81fac6d05dda9
|
35
|
+
ruby-1.8.6-p369.tar.bz2=c3c1f3dd0dfbd2e17a04e59c2f12cfc8
|
36
|
+
ruby-1.8.6-p383.tar.bz2=a48703cd982b9f0e3002700a50b0e88e
|
37
|
+
ruby-1.8.6-p398.tar.bz2=fbd43dc44ee26be4d37e6bebbed6f8bd
|
38
|
+
ruby-1.8.6-p399.tar.bz2=f77c307cb72fb8808b0e85af5d05cefc
|
39
|
+
ruby-1.8.7-p160.tar.bz2=f8ddb886b8a81cf005f53e9a9541091d
|
40
|
+
ruby-1.8.7-p174.tar.bz2=88c45aaf627b4404e5e4273cb03ba2ee
|
41
|
+
ruby-1.8.7-p248.tar.bz2=37e19d46b7d4b845f57d3389084b94a6
|
42
|
+
ruby-1.8.7-p249.tar.bz2=37200cc956a16996bbfd25bb4068f242
|
43
|
+
ruby-1.8.7-p299.tar.bz2=244439a87d75ab24170a9c2b451ce351
|
44
|
+
ruby-1.8.7-p302.tar.bz2=a6a9e37079ed8cf8726b455dad3de939
|
45
|
+
ruby-1.9.1-p129.tar.bz2=6fa62b20f72da471195830dec4eb2013
|
46
|
+
ruby-1.9.1-p243.tar.bz2=66d4f8403d13623051091347764881a0
|
47
|
+
ruby-1.9.1-p376.tar.bz2=e019ae9c643c5efe91be49e29781fb94
|
48
|
+
ruby-1.9.1-p376.tar.bz2=e019ae9c643c5efe91be49e29781fb94
|
49
|
+
ruby-1.9.1-p378.tar.bz2=5922459622a23612eb9b68a3586cb5f8
|
50
|
+
ruby-1.9.1-p429.tar.bz2=09df32ae51b6337f7a2e3b1909b26213
|
51
|
+
ruby-1.9.2-preview1.tar.bz2=0b8f27ea78afcdc54d5d23e569aa0150
|
52
|
+
ruby-1.9.2-preview3.tar.bz2=19225dceacaac49ddc1664e593af54ac
|
53
|
+
ruby-1.9.2-rc1.tar.bz2=242dcfaed8359a6918941b55d0806bf0
|
54
|
+
ruby-1.9.2-rc2.tar.bz2=4e4906d0aab711286b31f5a834860cc3
|
55
|
+
ruby-1.9.2-p0.tar.bz2=d8a02cadf57d2571cd4250e248ea7e4b
|
31
56
|
ruby-enterprise-1.8.6-20090610.tar.gz=0bf66ee626918464a6eccdd83c99d63a
|
32
57
|
ruby-enterprise-1.8.7-2009.10.tar.gz=3727eef7b6b1b2f31db7d091328d966e
|
33
58
|
ruby-enterprise-1.8.7-20090928.tar.gz=ae00018ce89d95419dfde370fcd485ac
|
@@ -43,6 +68,7 @@ jruby-bin-1.5.0.RC1.tar.gz=47b4ca2a21659d36a2775ade0a2534c4
|
|
43
68
|
jruby-bin-1.5.0.RC3.tar.gz=9c2758600de903b8ca07cb1341f4f1b3
|
44
69
|
jruby-bin-1.5.0.tar.gz=ee2b4e326e8b87858e5dd0c8e94102e6
|
45
70
|
jruby-bin-1.5.1.tar.gz=0196dcfb17354f12253eaddc1166a0ee
|
71
|
+
jruby-bin-1.5.2.tar.gz=d239deb9a108a6abbfbd6cb79cf8255b
|
46
72
|
libiconv-1.13.1.tar.gz=7ab33ebd26687c744a37264a330bbe9a
|
47
73
|
ncurses.tar.gz=cce05daf61a64501ef6cd8da1f727ec6
|
48
74
|
openssl-0.9.8k.tar.gz=e555c6d58d276aec7fdc53363e338ab3
|
data/contrib/install-system-wide
CHANGED
@@ -30,7 +30,7 @@ rvm_path="${rvm_path:-"/usr/local/rvm"}"
|
|
30
30
|
export rvm_selfcontained=0
|
31
31
|
|
32
32
|
rvm_group_name="${rvm_group_name:-"rvm"}"
|
33
|
-
if cat /etc/group | cut -d: -f1 | grep -q "^${rvm_group_name}$"; then
|
33
|
+
if cat /etc/group | cut -d: -f1 | \grep -q "^${rvm_group_name}$"; then
|
34
34
|
echo "Group exists, proceeding with installation."
|
35
35
|
else
|
36
36
|
echo "Creating the group '$rvm_group_name'"
|
data/install
CHANGED
@@ -47,7 +47,7 @@ spinner() {
|
|
47
47
|
command -v perl > /dev/null 2>&1 && perl -e 'sleep 0.5'
|
48
48
|
}
|
49
49
|
|
50
|
-
if echo "$*" | grep -q 'trace' ; then echo "$*" ; env | grep '^rvm_' ; set -x ; fi
|
50
|
+
if echo "$*" | \grep -q 'trace' ; then echo "$*" ; env | \grep '^rvm_' ; set -x ; fi
|
51
51
|
|
52
52
|
while [[ $# -gt 0 ]] ; do
|
53
53
|
token="$1" ; shift
|
@@ -72,7 +72,7 @@ if [[ -z "$rvm_path" ]] ; then rvm_path="${rvm_prefix}rvm" ; fi
|
|
72
72
|
|
73
73
|
source scripts/initialize
|
74
74
|
|
75
|
-
if grep -q 'scripts/rvm' $HOME/.bash* 2>/dev/null || grep -q 'scripts/rvm' $HOME/.zsh* 2>/dev/null; then
|
75
|
+
if \grep -q 'scripts/rvm' $HOME/.bash* 2>/dev/null || \grep -q 'scripts/rvm' $HOME/.zsh* 2>/dev/null; then
|
76
76
|
if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then
|
77
77
|
export upgrade_flag=1
|
78
78
|
else
|
@@ -178,12 +178,12 @@ if [[ -n "$rvm_auto_flag" ]] ; then
|
|
178
178
|
for rcfile in $(echo $rvm_rc_files) ; do
|
179
179
|
if [[ ! -f $rcfile ]] ; then \touch $rcfile ; fi
|
180
180
|
if [[ -s "$HOME/.profile" ]] ; then
|
181
|
-
if ! grep -q '.profile' "$rcfile" ; then
|
181
|
+
if ! \grep -q '.profile' "$rcfile" ; then
|
182
182
|
echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
|
183
183
|
printf "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
|
184
184
|
fi
|
185
185
|
fi
|
186
|
-
if ! grep -q "scripts\/rvm" "$rcfile" ; then
|
186
|
+
if ! \grep -q "scripts\/rvm" "$rcfile" ; then
|
187
187
|
echo " Adding 'if [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi' to $rcfile."
|
188
188
|
printf "\n# rvm-install added:\nif [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi\n" >> $rcfile
|
189
189
|
fi
|
@@ -275,7 +275,7 @@ done
|
|
275
275
|
|
276
276
|
# Move from legacy defaults to the new, alias based system.
|
277
277
|
if [[ -s "$rvm_config_path/default" ]]; then
|
278
|
-
original_version="$(basename "$(grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")"
|
278
|
+
original_version="$(basename "$(\grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")"
|
279
279
|
if [[ -n "$original_version" ]]; then
|
280
280
|
$rvm_scripts_path/alias create default "$original_version" &> /dev/null
|
281
281
|
fi
|
@@ -335,7 +335,7 @@ else
|
|
335
335
|
printf "\n placing all non-interactive items in the .bashrc, including the 'source' line above"
|
336
336
|
printf "\n3) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
|
337
337
|
fi
|
338
|
-
if [[ -s "$HOME/.bashrc" ]] && grep -q '&& return' "$HOME/.bashrc" ; then
|
338
|
+
if [[ -s "$HOME/.bashrc" ]] && \grep -q '&& return' "$HOME/.bashrc" ; then
|
339
339
|
printf "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc."
|
340
340
|
printf "\n This means that if you see '[ -z \"\$PS1\" ] && return' then you must change this line to:"
|
341
341
|
printf "\n if [[ -n \"\$PS1\" ]] ; then"
|
data/lib/VERSION.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
---
|
2
|
-
:major:
|
3
|
-
:minor:
|
4
|
-
:patch:
|
2
|
+
:major: 1
|
3
|
+
:minor: 0
|
4
|
+
:patch: 0
|
data/rvm.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rvm}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "1.0.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Wayne E. Seguin"]
|
12
|
-
s.date = %q{2010-08-
|
12
|
+
s.date = %q{2010-08-22}
|
13
13
|
s.default_executable = %q{rvm-install}
|
14
14
|
s.description = %q{Manages Ruby interpreter environments and switching between them.}
|
15
15
|
s.email = %q{wayneeseguin@gmail.com}
|
data/scripts/base
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# Load the general scripts.
|
5
5
|
# Use rvm_base_except="" to override the except.
|
6
6
|
for script_name in initialize utility selector; do
|
7
|
-
if echo "$rvm_base_except" | grep -vq "$script_name" ; then
|
7
|
+
if echo "$rvm_base_except" | \grep -vq "$script_name" ; then
|
8
8
|
source $rvm_scripts_path/$script_name
|
9
9
|
fi
|
10
10
|
done; unset script_name rvm_base_except
|
data/scripts/cli
CHANGED
@@ -23,7 +23,7 @@ __rvm_parse_args() {
|
|
23
23
|
# Otherwise this file gets big rather fast.
|
24
24
|
#echo "$@" >> $HOME/.rvm_history
|
25
25
|
|
26
|
-
if echo "$@" | grep -q 'trace' ; then echo "$@" ; __rvm_version ; fi
|
26
|
+
if echo "$@" | \grep -q 'trace' ; then echo "$@" ; __rvm_version ; fi
|
27
27
|
|
28
28
|
while [[ $# -gt 0 ]] ; do
|
29
29
|
rvm_token="$1" ; shift
|
@@ -80,7 +80,7 @@ __rvm_parse_args() {
|
|
80
80
|
rvm_use_flag=1
|
81
81
|
rvm_ruby_args="$@" ; shift
|
82
82
|
rvm_gemset_name="$1" ; shift
|
83
|
-
if [[ ! -z "$(echo $rvm_gemset_name | grep $rvm_gemset_separator)" ]] ; then
|
83
|
+
if [[ ! -z "$(echo $rvm_gemset_name | \grep $rvm_gemset_separator)" ]] ; then
|
84
84
|
rvm_ruby_string=$(echo $rvm_gemset_name | sed 's/\(.*\)'${rvm_gemset_separator}'.*/\1/')
|
85
85
|
rvm_gemset_name=$(echo $rvm_gemset_name | sed 's/.*'${rvm_gemset_separator}'\(.*\)/\1/')
|
86
86
|
if [[ "$rvm_ruby_string" != "$rvm_gemset_name" ]] ; then
|
@@ -92,7 +92,7 @@ __rvm_parse_args() {
|
|
92
92
|
rvm_delete_flag=1
|
93
93
|
rvm_ruby_args="$@" ; shift
|
94
94
|
rvm_gemset_name="$1"; shift
|
95
|
-
if [[ ! -z "$(echo $rvm_gemset_name | grep $rvm_gemset_separator)" ]] ; then
|
95
|
+
if [[ ! -z "$(echo $rvm_gemset_name | \grep $rvm_gemset_separator)" ]] ; then
|
96
96
|
rvm_ruby_string=$(echo $rvm_gemset_name | sed 's/\(.*\)'${rvm_gemset_separator}'.*/\1/')
|
97
97
|
rvm_gemset_name=$(echo $rvm_gemset_name | sed 's/.*'${rvm_gemset_separator}'\(.*\)/\1/')
|
98
98
|
if [[ "$rvm_ruby_string" != "$rvm_gemset_name" ]] ; then
|
@@ -139,8 +139,14 @@ __rvm_parse_args() {
|
|
139
139
|
;;
|
140
140
|
|
141
141
|
load-rvmrc)
|
142
|
-
rvm_action="
|
143
|
-
rvm_ruby_args="$
|
142
|
+
rvm_action="rvmrc"
|
143
|
+
rvm_ruby_args="'load' $(__rvm_quote_args "$@")"
|
144
|
+
rvm_parse_break=1
|
145
|
+
;;
|
146
|
+
|
147
|
+
rvmrc)
|
148
|
+
rvm_action="rvmrc"
|
149
|
+
rvm_ruby_args="$(__rvm_quote_args "$@")"
|
144
150
|
rvm_parse_break=1
|
145
151
|
;;
|
146
152
|
|
@@ -318,7 +324,7 @@ __rvm_parse_args() {
|
|
318
324
|
|
319
325
|
reboot|damnit|wtf|argh|BOOM|boom|wth) $rvm_action="reboot" ;;
|
320
326
|
|
321
|
-
--self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--export|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--import|--rvmrc|--sticky|--create|--
|
327
|
+
--self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--export|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--import|--rvmrc|--sticky|--create|--gems|--docs)
|
322
328
|
export rvm_$(echo $rvm_token | sed 's#-##g')_flag=1
|
323
329
|
;;
|
324
330
|
|
@@ -545,11 +551,10 @@ rvm() {
|
|
545
551
|
__rvm_run_script "$rvm_action"
|
546
552
|
result=$?
|
547
553
|
;;
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
result=$?
|
554
|
+
|
555
|
+
rvmrc)
|
556
|
+
eval "__rvm_rvmrc_tools $rvm_ruby_args"
|
557
|
+
result="$?"
|
553
558
|
;;
|
554
559
|
|
555
560
|
gemset)
|
data/scripts/completion
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# bash completion for Ruby Version Manager (RVM)
|
2
2
|
|
3
|
-
__rvm_comp()
|
3
|
+
__rvm_comp()
|
4
4
|
{
|
5
5
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
6
6
|
COMPREPLY=($(compgen -W "$1" -- "$cur"))
|
@@ -30,7 +30,7 @@ __rvm_rubies ()
|
|
30
30
|
|
31
31
|
__rvm_gemsets ()
|
32
32
|
{
|
33
|
-
echo "$(rvm gemset list | grep -v gemset 2>/dev/null)"
|
33
|
+
echo "$(rvm gemset list | \grep -v gemset 2>/dev/null)"
|
34
34
|
}
|
35
35
|
|
36
36
|
_rvm_commands ()
|
data/scripts/docs
CHANGED
@@ -48,7 +48,7 @@ generate_rdoc() {
|
|
48
48
|
\rm -rf "$rvm_docs_path/$rvm_docs_ruby_string/$rvm_docs_type/"
|
49
49
|
$rvm_scripts_path/log "info" "Generating rdoc documentation, be aware that this could take a *long* time, and depends heavily on your system resources..."
|
50
50
|
$rvm_scripts_path/log "info" "( Errors will be logged to $rvm_log_path/$rvm_docs_ruby_string/docs.error.log )"
|
51
|
-
if gem list | grep -q ^hanna ; then
|
51
|
+
if gem list | \grep -q ^hanna ; then
|
52
52
|
hanna -o $rvm_docs_path/$rvm_docs_ruby_string/$rvm_docs_type --inline-source --line-numbers --fmt=html > /dev/null 2>> $rvm_log_path/$rvm_docs_ruby_string/docs.error.log
|
53
53
|
else
|
54
54
|
rdoc -a -o $rvm_docs_path/$rvm_docs_ruby_string/$rvm_docs_type > /dev/null 2>> $rvm_log_path/$rvm_docs_ruby_string/docs.error.log
|
@@ -30,14 +30,14 @@ contents_of_environment_file() {
|
|
30
30
|
}
|
31
31
|
|
32
32
|
convert_to_shell() {
|
33
|
-
convert_path_to_fish "$(contents_of_environment_file | grep '^export PATH=')"
|
33
|
+
convert_path_to_fish "$(contents_of_environment_file | \grep '^export PATH=')"
|
34
34
|
while read -r shell_line; do
|
35
|
-
if echo "$shell_line" | grep -q '^unset '; then
|
35
|
+
if echo "$shell_line" | \grep -q '^unset '; then
|
36
36
|
echo "$shell_line" | convert_unset_to_fish
|
37
37
|
else
|
38
38
|
echo "$shell_line" | convert_exports_to_fish
|
39
39
|
fi
|
40
|
-
done < <(contents_of_environment_file | grep -v '^export [^=]*$' | grep -v '^export PATH=')
|
40
|
+
done < <(contents_of_environment_file | \grep -v '^export [^=]*$' | \grep -v '^export PATH=')
|
41
41
|
unset shell_line
|
42
42
|
}
|
43
43
|
|
@@ -57,4 +57,4 @@ if [[ "$(__rvm_environment_identifier)" != "$environment_name" ]]; then
|
|
57
57
|
__rvm_become "$environment_name" || exit 1
|
58
58
|
fi
|
59
59
|
|
60
|
-
convert_to_shell
|
60
|
+
convert_to_shell
|
data/scripts/gemsets
CHANGED
@@ -16,7 +16,7 @@ usage() {
|
|
16
16
|
gemset_update() {
|
17
17
|
if [[ -z "$rvm_ruby_strings" ]]; then
|
18
18
|
$rvm_scripts_path/log "info" "Running gem update for all rubies and gemsets."
|
19
|
-
rvm_ruby_strings="$(\ls "$rvm_gems_path" | grep -v '^\(doc\|cache\|@\|system\)' | \tr '\n' ',')"
|
19
|
+
rvm_ruby_strings="$(\ls "$rvm_gems_path" | \grep -v '^\(doc\|cache\|@\|system\)' | \tr '\n' ',')"
|
20
20
|
else
|
21
21
|
$rvm_scripts_path/log "info" "Running gem update for the specified rubies."
|
22
22
|
fi
|
@@ -375,7 +375,7 @@ gem_install() {
|
|
375
375
|
# Output the user's current gem directory.
|
376
376
|
gemset_info() {
|
377
377
|
if [[ "$rvm_user_flag" -eq 1 ]] ; then
|
378
|
-
echo $(rvm system ; gem env | grep "\- $HOME" | awk '{print $NF}')
|
378
|
+
echo $(rvm system ; gem env | \grep "\- $HOME" | awk '{print $NF}')
|
379
379
|
elif [[ "$rvm_system_flag" -eq 1 ]] ; then
|
380
380
|
echo $(rvm system ; gem env $action system)
|
381
381
|
elif [[ ! -z "$rvm_ruby_string" ]] ; then
|
data/scripts/info
CHANGED
@@ -85,7 +85,7 @@ info_debug() {
|
|
85
85
|
|
86
86
|
for file_name in $(echo $rc_files) ; do
|
87
87
|
if [[ -s "$file_name" ]] ; then
|
88
|
-
rvm_info="$rvm_info\n$( "$file_name:\n$(grep 'rvm' $file_name 2>/dev/null)" )"
|
88
|
+
rvm_info="$rvm_info\n$( "$file_name:\n$(\grep 'rvm' $file_name 2>/dev/null)" )"
|
89
89
|
fi
|
90
90
|
done
|
91
91
|
|
data/scripts/install
CHANGED
@@ -47,7 +47,7 @@ spinner() {
|
|
47
47
|
command -v perl > /dev/null 2>&1 && perl -e 'sleep 0.5'
|
48
48
|
}
|
49
49
|
|
50
|
-
if echo "$*" | grep -q 'trace' ; then echo "$*" ; env | grep '^rvm_' ; set -x ; fi
|
50
|
+
if echo "$*" | \grep -q 'trace' ; then echo "$*" ; env | \grep '^rvm_' ; set -x ; fi
|
51
51
|
|
52
52
|
while [[ $# -gt 0 ]] ; do
|
53
53
|
token="$1" ; shift
|
@@ -72,7 +72,7 @@ if [[ -z "$rvm_path" ]] ; then rvm_path="${rvm_prefix}rvm" ; fi
|
|
72
72
|
|
73
73
|
source scripts/initialize
|
74
74
|
|
75
|
-
if grep -q 'scripts/rvm' $HOME/.bash* 2>/dev/null || grep -q 'scripts/rvm' $HOME/.zsh* 2>/dev/null; then
|
75
|
+
if \grep -q 'scripts/rvm' $HOME/.bash* 2>/dev/null || \grep -q 'scripts/rvm' $HOME/.zsh* 2>/dev/null; then
|
76
76
|
if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then
|
77
77
|
export upgrade_flag=1
|
78
78
|
else
|
@@ -178,12 +178,12 @@ if [[ -n "$rvm_auto_flag" ]] ; then
|
|
178
178
|
for rcfile in $(echo $rvm_rc_files) ; do
|
179
179
|
if [[ ! -f $rcfile ]] ; then \touch $rcfile ; fi
|
180
180
|
if [[ -s "$HOME/.profile" ]] ; then
|
181
|
-
if ! grep -q '.profile' "$rcfile" ; then
|
181
|
+
if ! \grep -q '.profile' "$rcfile" ; then
|
182
182
|
echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
|
183
183
|
printf "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
|
184
184
|
fi
|
185
185
|
fi
|
186
|
-
if ! grep -q "scripts\/rvm" "$rcfile" ; then
|
186
|
+
if ! \grep -q "scripts\/rvm" "$rcfile" ; then
|
187
187
|
echo " Adding 'if [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi' to $rcfile."
|
188
188
|
printf "\n# rvm-install added:\nif [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi\n" >> $rcfile
|
189
189
|
fi
|
@@ -275,7 +275,7 @@ done
|
|
275
275
|
|
276
276
|
# Move from legacy defaults to the new, alias based system.
|
277
277
|
if [[ -s "$rvm_config_path/default" ]]; then
|
278
|
-
original_version="$(basename "$(grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")"
|
278
|
+
original_version="$(basename "$(\grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")"
|
279
279
|
if [[ -n "$original_version" ]]; then
|
280
280
|
$rvm_scripts_path/alias create default "$original_version" &> /dev/null
|
281
281
|
fi
|
@@ -335,7 +335,7 @@ else
|
|
335
335
|
printf "\n placing all non-interactive items in the .bashrc, including the 'source' line above"
|
336
336
|
printf "\n3) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
|
337
337
|
fi
|
338
|
-
if [[ -s "$HOME/.bashrc" ]] && grep -q '&& return' "$HOME/.bashrc" ; then
|
338
|
+
if [[ -s "$HOME/.bashrc" ]] && \grep -q '&& return' "$HOME/.bashrc" ; then
|
339
339
|
printf "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc."
|
340
340
|
printf "\n This means that if you see '[ -z \"\$PS1\" ] && return' then you must change this line to:"
|
341
341
|
printf "\n if [[ -n \"\$PS1\" ]] ; then"
|
data/scripts/list
CHANGED
@@ -35,7 +35,7 @@ list_gemsets() {
|
|
35
35
|
done ; unset version
|
36
36
|
|
37
37
|
if [[ -f "$rvm_config_path/default" ]] && [[ -s $rvm_config_path/default ]] ; then
|
38
|
-
version=$(grep 'MY_RUBY_HOME' $rvm_config_path/default | head -n1 | awk -F"'" '{print $2}' | xargs basename --)
|
38
|
+
version=$(\grep 'MY_RUBY_HOME' $rvm_config_path/default | head -n1 | awk -F"'" '{print $2}' | xargs basename --)
|
39
39
|
if [[ ! -z "$version" ]] ; then
|
40
40
|
printf "\n\nDefault Ruby (for new shells)\n"
|
41
41
|
string="[ $(file $rvm_rubies_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | \tr "\n" ' ')]"
|
@@ -81,7 +81,7 @@ list_strings() {
|
|
81
81
|
# This is meant to be used with scripting.
|
82
82
|
list_gemset_strings() {
|
83
83
|
local all_rubies="$(list_strings)"
|
84
|
-
for gemset in $(\ls $rvm_gems_path/ 2>/dev/null | xargs -n1 basename -- | grep -v '^\(@\|doc$\|cache$\|system$\)' | sort); do
|
84
|
+
for gemset in $(\ls $rvm_gems_path/ 2>/dev/null | xargs -n1 basename -- | \grep -v '^\(@\|doc$\|cache$\|system$\)' | sort); do
|
85
85
|
local ruby_name="$(echo "$gemset" | awk -F$rvm_gemset_separator '{print $1}')"
|
86
86
|
[[ "$all_rubies" != *"$ruby_name"* ]] && continue
|
87
87
|
echo "$gemset"
|
@@ -111,12 +111,12 @@ list_rubies_strings() {
|
|
111
111
|
}
|
112
112
|
|
113
113
|
list_rubies() {
|
114
|
-
|
114
|
+
|
115
115
|
if [[ "$1" = "strings" ]]; then
|
116
116
|
list_rubies_strings
|
117
117
|
return 0
|
118
118
|
fi
|
119
|
-
|
119
|
+
|
120
120
|
echo
|
121
121
|
|
122
122
|
current_ruby="$(__rvm_environment_identifier | awk -F"$rvm_gemset_separator" '{print $1}')"
|
@@ -140,7 +140,7 @@ list_rubies() {
|
|
140
140
|
done ; unset version
|
141
141
|
|
142
142
|
if [[ -f "$rvm_config_path/default" ]] && [[ -s $rvm_config_path/default ]] ; then
|
143
|
-
version=$(grep 'MY_RUBY_HOME' $rvm_config_path/default | head -n 1 | awk -F"'" '{print $2}' | xargs basename --)
|
143
|
+
version=$(\grep 'MY_RUBY_HOME' $rvm_config_path/default | head -n 1 | awk -F"'" '{print $2}' | xargs basename --)
|
144
144
|
if [[ ! -z "$version" ]] ; then
|
145
145
|
printf "\n\nDefault Ruby (for new shells)\n"
|
146
146
|
string="[ $(file $rvm_rubies_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | \tr "\n" ' ')]"
|
data/scripts/maglev
CHANGED
@@ -88,7 +88,7 @@ case "$system" in
|
|
88
88
|
Solaris-x86)
|
89
89
|
# TODO: figure memory needs for Solaris-x86
|
90
90
|
# Investigate project.max-shm-memory
|
91
|
-
totalMemMB="`/usr/sbin/prtconf | grep Memory | cut -f3 -d' '`"
|
91
|
+
totalMemMB="`/usr/sbin/prtconf | \grep Memory | cut -f3 -d' '`"
|
92
92
|
totalMem=$(($totalMemMB * 1048576))
|
93
93
|
shmmax=$(($totalMem / 4))
|
94
94
|
shmall=$(($shmmax / 4096))
|
@@ -144,7 +144,7 @@ fi
|
|
144
144
|
|
145
145
|
# At this point, shared memory settings contain the values we want,
|
146
146
|
# put them in sysctl.conf so they are preserved.
|
147
|
-
if [[ ! -f /etc/sysctl.conf ]] || [[ "$(grep -sc "kern.*.shm" /etc/sysctl.conf)" -eq 0 ]] ; then
|
147
|
+
if [[ ! -f /etc/sysctl.conf ]] || [[ "$(\grep -sc "kern.*.shm" /etc/sysctl.conf)" -eq 0 ]] ; then
|
148
148
|
case "$system" in
|
149
149
|
Linux)
|
150
150
|
echo "# kernel.shm* settings added by MagLev installation" > /tmp/sysctl.conf.$$
|
@@ -177,17 +177,17 @@ if [[ ! -f /etc/sysctl.conf ]] || [[ "$(grep -sc "kern.*.shm" /etc/sysctl.conf)"
|
|
177
177
|
else
|
178
178
|
$rvm_scripts_path/log "info" "The following shared memory settings already exist in /etc/sysctl.conf"
|
179
179
|
echo "To change them, remove the following lines from /etc/sysctl.conf and rerun this script"
|
180
|
-
grep "kern.*.shm" /etc/sysctl.conf
|
180
|
+
\grep "kern.*.shm" /etc/sysctl.conf
|
181
181
|
fi
|
182
182
|
|
183
183
|
# Now setup for NetLDI in case we ever need it.
|
184
184
|
$rvm_scripts_path/log "info" "Setting up GemStone netldi service port"
|
185
|
-
if [[ $(grep -sc "^gs64ldi" /etc/services) -eq 0 ]]; then
|
185
|
+
if [[ $(\grep -sc "^gs64ldi" /etc/services) -eq 0 ]]; then
|
186
186
|
echo '[[Info]] Adding "gs64ldi 50378/tcp" to /etc/services'
|
187
187
|
sudo bash -c 'echo "gs64ldi 50378/tcp # Gemstone netldi" >> /etc/services'
|
188
188
|
else
|
189
189
|
$rvm_scripts_path/log "info" "GemStone netldi service port is already set in /etc/services"
|
190
190
|
echo "To change it, remove the following line from /etc/services and rerun this script"
|
191
|
-
grep "^gs64ldi" /etc/services
|
191
|
+
\grep "^gs64ldi" /etc/services
|
192
192
|
fi
|
193
193
|
|
data/scripts/manage
CHANGED
@@ -43,7 +43,7 @@ __rvm_apply_patches() {
|
|
43
43
|
for patch_name in $(__rvm_current_patch_names | __rvm_strip); do
|
44
44
|
patch_level="1"
|
45
45
|
# If set, extract the patch level from the patch name.
|
46
|
-
if echo "$patch_name" | grep -q "$patch_level_seperator"; then
|
46
|
+
if echo "$patch_name" | \grep -q "$patch_level_seperator"; then
|
47
47
|
patch_level="$(echo "$patch_name" | awk -F"$patch_level_seperator" '{print $2}')"
|
48
48
|
patch_name="$(echo "$patch_name" | awk -F"$patch_level_seperator" '{print $1}')"
|
49
49
|
fi
|
@@ -63,7 +63,12 @@ __rvm_apply_patches() {
|
|
63
63
|
}
|
64
64
|
|
65
65
|
__rvm_install_source() {
|
66
|
-
|
66
|
+
[[ -z "$rvm_ruby_selected_flag" ]] && __rvm_select
|
67
|
+
|
68
|
+
if [[ "$rvm_ruby_string" = "ruby-1.9.2-head" ]] ; then
|
69
|
+
# Ensure we have a base ruby.
|
70
|
+
__rvm_ensure_has_18_compat_ruby || return 1
|
71
|
+
fi
|
67
72
|
|
68
73
|
$rvm_scripts_path/log "info" "Installing Ruby from source to: $rvm_ruby_home"
|
69
74
|
__rvm_pushpop "$rvm_src_path"
|
@@ -109,11 +114,21 @@ __rvm_install_source() {
|
|
109
114
|
__rvm_db "${rvm_ruby_interpreter}_configure_flags" "db_configure_flags"
|
110
115
|
fi
|
111
116
|
|
117
|
+
# On 1.9.2, we manually set the --with-baseruby option
|
118
|
+
# to point to an expanded path.
|
119
|
+
if [[ "$rvm_ruby_string" = "ruby-1.9.2-head" ]] ; then
|
120
|
+
local compatible_baseruby="$rvm_wrappers_path/$(__rvm_18_compat_ruby)/ruby"
|
121
|
+
if [[ -x "$compatible_baseruby" ]] ; then
|
122
|
+
configure_parameters="--with-baseruby=$compatible_baseruby"
|
123
|
+
fi
|
124
|
+
fi
|
125
|
+
|
112
126
|
local configure_command="./configure --prefix=$rvm_ruby_home $db_configure_flags $rvm_ruby_configure_flags $configure_parameters"
|
113
127
|
__rvm_run "configure" "$configure_command" "Configuring $rvm_ruby_string, this may take a while depending on your cpu(s)..."
|
128
|
+
unset configure_parameters db_configure_flags
|
114
129
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
115
130
|
$rvm_scripts_path/log "error" "There has been an error while running configure. Aborting the installation." ; __rvm_pushpop ; return $result
|
116
|
-
fi
|
131
|
+
fi
|
117
132
|
else
|
118
133
|
$rvm_scripts_path/log "error" "Skipping configure step, 'configure' does not exist, did autoconf not run successfully?"
|
119
134
|
fi
|
@@ -470,7 +485,7 @@ RubyWrapper
|
|
470
485
|
|
471
486
|
if [[ -n "$rvm_head_flag" ]] ; then
|
472
487
|
builtin cd $rvm_ruby_src_path
|
473
|
-
rvm_gemstone_package_file="GemStone-$(grep ^GEMSTONE version.txt | cut -f2 -d-).$(uname -sm | \tr ' ' '-')"
|
488
|
+
rvm_gemstone_package_file="GemStone-$(\grep ^GEMSTONE version.txt | cut -f2 -d-).$(uname -sm | \tr ' ' '-')"
|
474
489
|
rvm_gemstone_url="${rvm_gemstone_url:-"$maglev_url/${rvm_gemstone_package_file}.${rvm_archive_extension}"}"
|
475
490
|
fi
|
476
491
|
|
@@ -731,12 +746,16 @@ __rvm_fetch_from_github() {
|
|
731
746
|
}
|
732
747
|
|
733
748
|
__rvm_fetch_ruby() {
|
734
|
-
|
749
|
+
[[ -z "$rvm_ruby_selected_flag" ]] && __rvm_select
|
735
750
|
|
736
|
-
if [[ -z "$rvm_head_flag"
|
751
|
+
if [[ -z "$rvm_head_flag" && -z "$rvm_ruby_tag" && -z "$rvm_ruby_revision" ]] ; then
|
737
752
|
rvm_ruby_package_name="${rvm_ruby_package_name:-"$rvm_ruby_string"}"
|
738
753
|
rvm_ruby_package_file="${rvm_ruby_package_file:-"$rvm_ruby_package_name"}"
|
739
|
-
|
754
|
+
if [[ "ruby" = "$rvm_ruby_interpreter" ]]; then
|
755
|
+
rvm_archive_extension="${rvm_archive_extension:-tar.bz2}"
|
756
|
+
else
|
757
|
+
rvm_archive_extension="${rvm_archive_extension:-tar.gz}"
|
758
|
+
fi
|
740
759
|
|
741
760
|
if [[ ! -s "$rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension" ]] ; then
|
742
761
|
if [[ "ruby" = "$rvm_ruby_interpreter" ]] ; then
|
@@ -772,6 +791,11 @@ __rvm_fetch_ruby() {
|
|
772
791
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
773
792
|
$rvm_scripts_path/log "error" "There has been an error while trying to extract $rvm_ruby_package_file. Aborting the installation." ; __rvm_pushpop ; return $result
|
774
793
|
fi
|
794
|
+
elif [[ "tar.bz2" = "$rvm_archive_extension" ]] ; then
|
795
|
+
__rvm_run "extract" "cat $rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension | bunzip2 | tar xf - -C /tmp/rvm_src_$$" "Extracting $rvm_ruby_package_file ..."
|
796
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
797
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
798
|
+
fi
|
775
799
|
fi
|
776
800
|
|
777
801
|
mv "/tmp/rvm_src_$$/$(\cd /tmp/rvm_src_$$ ; \ls)" "$rvm_ruby_src_path" ; \rm -rf "/tmp/rvm_src_$$"
|
@@ -1062,7 +1086,7 @@ __rvm_rubygems_setup() {
|
|
1062
1086
|
directory_name="$rvm_ruby_home/lib/ruby/gems"
|
1063
1087
|
version_number="${rvm_release_version}.${rvm_major_version}"
|
1064
1088
|
if [[ "$version_number" == "." ]]; then
|
1065
|
-
version_number="$(\ls "$directory_name" | grep '^[[:digit:]].[[:digit:]]\(.[[:digit:]]\)\?' | head -n1)"
|
1089
|
+
version_number="$(\ls "$directory_name" | \grep '^[[:digit:]].[[:digit:]]\(.[[:digit:]]\)\?' | head -n1)"
|
1066
1090
|
if [[ -n "$version_number" ]]; then
|
1067
1091
|
ruby_lib_gem_path="${directory_name}/${version_number}"
|
1068
1092
|
else
|
data/scripts/package
CHANGED
@@ -145,15 +145,15 @@ libxml2() {
|
|
145
145
|
}
|
146
146
|
|
147
147
|
glib() {
|
148
|
+
pkgconfig
|
149
|
+
gettext
|
148
150
|
package="glib" ; version="2.23.1" ; archive_format="tar.gz"
|
149
|
-
configure="CC=\"cc -L$rvm_usr_path/lib\" ./configure --prefix=$rvm_usr_path"
|
151
|
+
configure="CC=\"cc -L$rvm_usr_path/lib -I$rvm_usr_path/include\" PKG_CONFIG=\"$rvm_usr_path/bin/pkg-config\" ./configure --prefix=$rvm_usr_path"
|
150
152
|
|
151
153
|
install_package
|
152
154
|
}
|
153
155
|
|
154
156
|
mono() {
|
155
|
-
gettext
|
156
|
-
pkgconfig
|
157
157
|
glib
|
158
158
|
|
159
159
|
__rvm_mono_env
|
data/scripts/rvm
CHANGED
@@ -12,7 +12,7 @@ if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
|
|
12
12
|
if [[ -z "$rvm_ignore_rvmrc" ]]; then
|
13
13
|
for rvmrc in /etc/rvmrc $HOME/.rvmrc ; do
|
14
14
|
if [[ -f "$rvmrc" ]] ; then
|
15
|
-
if grep -q '^\s*rvm .*$' $rvmrc ; then
|
15
|
+
if \grep -q '^\s*rvm .*$' $rvmrc ; then
|
16
16
|
printf "\nError: $rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
|
17
17
|
return 1
|
18
18
|
else
|
@@ -40,7 +40,7 @@ if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
|
|
40
40
|
fi
|
41
41
|
|
42
42
|
# Fix rvm_prefix changes.
|
43
|
-
echo "$rvm_prefix" | grep -vq '\(\/\|\.\)$' && [[ -d "$rvm_prefix/rvm/scripts" ]]
|
43
|
+
echo "$rvm_prefix" | \grep -vq '\(\/\|\.\)$' && [[ -d "$rvm_prefix/rvm/scripts" ]]
|
44
44
|
rvm_prefix_needs_trailing_slash="$?"
|
45
45
|
if [[ "$rvm_prefix" = "/usr/local" || "$rvm_prefix_needs_trailing_slash" = "0" ]]; then
|
46
46
|
rvm_prefix="$rvm_prefix/"
|
@@ -68,7 +68,7 @@ if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
|
|
68
68
|
|
69
69
|
alias rvm-restart="source '${rvm_path}/scripts/rvm'"
|
70
70
|
|
71
|
-
if ! command -v ruby >/dev/null 2>&1 || command -v ruby | grep -v rvm >/dev/null ; then
|
71
|
+
if ! command -v ruby >/dev/null 2>&1 || command -v ruby | \grep -v rvm >/dev/null ; then
|
72
72
|
[[ -s "$rvm_environments_path/default" ]] && source "$rvm_environments_path/default"
|
73
73
|
fi
|
74
74
|
else
|
data/scripts/rvm-install
CHANGED
@@ -47,7 +47,7 @@ spinner() {
|
|
47
47
|
command -v perl > /dev/null 2>&1 && perl -e 'sleep 0.5'
|
48
48
|
}
|
49
49
|
|
50
|
-
if echo "$*" | grep -q 'trace' ; then echo "$*" ; env | grep '^rvm_' ; set -x ; fi
|
50
|
+
if echo "$*" | \grep -q 'trace' ; then echo "$*" ; env | \grep '^rvm_' ; set -x ; fi
|
51
51
|
|
52
52
|
while [[ $# -gt 0 ]] ; do
|
53
53
|
token="$1" ; shift
|
@@ -72,7 +72,7 @@ if [[ -z "$rvm_path" ]] ; then rvm_path="${rvm_prefix}rvm" ; fi
|
|
72
72
|
|
73
73
|
source scripts/initialize
|
74
74
|
|
75
|
-
if grep -q 'scripts/rvm' $HOME/.bash* 2>/dev/null || grep -q 'scripts/rvm' $HOME/.zsh* 2>/dev/null; then
|
75
|
+
if \grep -q 'scripts/rvm' $HOME/.bash* 2>/dev/null || \grep -q 'scripts/rvm' $HOME/.zsh* 2>/dev/null; then
|
76
76
|
if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then
|
77
77
|
export upgrade_flag=1
|
78
78
|
else
|
@@ -178,12 +178,12 @@ if [[ -n "$rvm_auto_flag" ]] ; then
|
|
178
178
|
for rcfile in $(echo $rvm_rc_files) ; do
|
179
179
|
if [[ ! -f $rcfile ]] ; then \touch $rcfile ; fi
|
180
180
|
if [[ -s "$HOME/.profile" ]] ; then
|
181
|
-
if ! grep -q '.profile' "$rcfile" ; then
|
181
|
+
if ! \grep -q '.profile' "$rcfile" ; then
|
182
182
|
echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
|
183
183
|
printf "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
|
184
184
|
fi
|
185
185
|
fi
|
186
|
-
if ! grep -q "scripts\/rvm" "$rcfile" ; then
|
186
|
+
if ! \grep -q "scripts\/rvm" "$rcfile" ; then
|
187
187
|
echo " Adding 'if [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi' to $rcfile."
|
188
188
|
printf "\n# rvm-install added:\nif [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi\n" >> $rcfile
|
189
189
|
fi
|
@@ -275,7 +275,7 @@ done
|
|
275
275
|
|
276
276
|
# Move from legacy defaults to the new, alias based system.
|
277
277
|
if [[ -s "$rvm_config_path/default" ]]; then
|
278
|
-
original_version="$(basename "$(grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")"
|
278
|
+
original_version="$(basename "$(\grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")"
|
279
279
|
if [[ -n "$original_version" ]]; then
|
280
280
|
$rvm_scripts_path/alias create default "$original_version" &> /dev/null
|
281
281
|
fi
|
@@ -335,7 +335,7 @@ else
|
|
335
335
|
printf "\n placing all non-interactive items in the .bashrc, including the 'source' line above"
|
336
336
|
printf "\n3) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
|
337
337
|
fi
|
338
|
-
if [[ -s "$HOME/.bashrc" ]] && grep -q '&& return' "$HOME/.bashrc" ; then
|
338
|
+
if [[ -s "$HOME/.bashrc" ]] && \grep -q '&& return' "$HOME/.bashrc" ; then
|
339
339
|
printf "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc."
|
340
340
|
printf "\n This means that if you see '[ -z \"\$PS1\" ] && return' then you must change this line to:"
|
341
341
|
printf "\n if [[ -n \"\$PS1\" ]] ; then"
|
data/scripts/selector
CHANGED
@@ -4,10 +4,10 @@
|
|
4
4
|
__rvm_select() {
|
5
5
|
if [[ -z "$rvm_ruby_string" ]] ; then
|
6
6
|
rvm_ruby_string="${rvm_ruby_interpreter}"
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
[[ -n "$rvm_ruby_version" ]] && rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_version"
|
8
|
+
[[ -n "$rvm_ruby_patch_level" ]] && rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_patch_level"
|
9
|
+
[[ -n "$rvm_ruby_revision" ]] && rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_revision"
|
10
|
+
[[ -n "$rvm_ruby_name" ]] && rvm_ruby_name="$rvm_ruby_string-n$rvm_ruby_name"
|
11
11
|
fi
|
12
12
|
|
13
13
|
__rvm_ruby_string
|
@@ -147,10 +147,13 @@ __rvm_select() {
|
|
147
147
|
;;
|
148
148
|
|
149
149
|
ruby)
|
150
|
-
if [[ -z "$rvm_ruby_version"
|
150
|
+
if [[ -z "$rvm_ruby_version" && -z "$rvm_head_flag" ]]; then
|
151
151
|
$rvm_scripts_path/log "fail" "Unknown ruby version: $rvm_ruby_version"
|
152
152
|
else
|
153
153
|
rvm_ruby_repo_url="${rvm_ruby_repo_url:-"$(__rvm_db "ruby_repo_url")"}"
|
154
|
+
if [[ -z "$rvm_head_flag" ]]; then
|
155
|
+
rvm_archive_extension="tar.bz2"
|
156
|
+
fi
|
154
157
|
fi
|
155
158
|
;;
|
156
159
|
|
@@ -229,7 +232,7 @@ __rvm_use() {
|
|
229
232
|
new_path="$(echo $PATH | \tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)"
|
230
233
|
new_path="$rvm_bin_path:$new_path"
|
231
234
|
if [[ -s $rvm_config_path/system ]] ; then
|
232
|
-
grep "MY_RUBY_HOME='$rvm_rubies_path" "$rvm_config_path/system" > /dev/null
|
235
|
+
\grep "MY_RUBY_HOME='$rvm_rubies_path" "$rvm_config_path/system" > /dev/null
|
233
236
|
if [[ $? -eq 0 ]] ; then
|
234
237
|
[[ -f "$rvm_config_path/system" ]] && \rm -f $rvm_config_path/system # 'system' should *not* point to an rvm ruby.
|
235
238
|
else
|
@@ -338,6 +341,8 @@ __rvm_use() {
|
|
338
341
|
fi
|
339
342
|
fi
|
340
343
|
|
344
|
+
# Rehash executable locations, e.g. to force the shell to recognize new items in the path.
|
345
|
+
builtin hash -r
|
341
346
|
rvm_hook="after_use" ; source $rvm_scripts_path/hook
|
342
347
|
}
|
343
348
|
|
@@ -559,7 +564,7 @@ __rvm_gemset_select() {
|
|
559
564
|
|
560
565
|
# Ensure that the ruby gem home exists.
|
561
566
|
\mkdir -p "$rvm_ruby_gem_home"
|
562
|
-
if [[ -n "$rvm_ruby_gem_home" ]] && echo "$rvm_ruby_gem_home" | grep -q 'rvm'; then
|
567
|
+
if [[ -n "$rvm_ruby_gem_home" ]] && echo "$rvm_ruby_gem_home" | \grep -q 'rvm'; then
|
563
568
|
if __rvm_using_gemset_globalcache && [[ ! -L "$rvm_ruby_gem_home/cache" ]]; then
|
564
569
|
mv "$rvm_ruby_gem_home/cache/"*.gem "$rvm_gems_cache_path/" 2>/dev/null
|
565
570
|
\rm -rf "$rvm_ruby_gem_home/cache"
|
data/scripts/set
CHANGED
@@ -162,7 +162,7 @@ action="$1";
|
|
162
162
|
[[ "$#" -gt 0 ]] && shift
|
163
163
|
args="$*"
|
164
164
|
|
165
|
-
if [[ "$action" == "ruby" ]] && echo "$args" | grep -q "^'--[^[:space:]]*'$" ; then
|
165
|
+
if [[ "$action" == "ruby" ]] && echo "$args" | \grep -q "^'--[^[:space:]]*'$" ; then
|
166
166
|
$rvm_scripts_path/log "warn" "You called rvm ruby with the arguments $args which look like use options."
|
167
167
|
$rvm_scripts_path/log "warn" "Please note that 'rvm ruby' invokes set operations instead."
|
168
168
|
fi
|
data/scripts/snapshot
CHANGED
@@ -63,8 +63,8 @@ snapshot_save() {
|
|
63
63
|
comm -2 -3 "$snapshot_ruby_name_file" "$snapshot_alias_name_file" > "$snapshot_installable_file"
|
64
64
|
\rm -rf "$snapshot_ruby_name_file" "$snapshot_alias_name_file"
|
65
65
|
|
66
|
-
local snapshot_primary_ruby="$(cat "$snapshot_installable_file" | grep '^\(ree\|ruby-1.8.7\)' | grep -v '-head$' | sort -r | head -n1)"
|
67
|
-
local snapshot_ruby_order="$snapshot_primary_ruby $(cat "$snapshot_installable_file" | grep -v "$snapshot_primary_ruby")"
|
66
|
+
local snapshot_primary_ruby="$(cat "$snapshot_installable_file" | \grep '^\(ree\|ruby-1.8.7\)' | \grep -v '-head$' | sort -r | head -n1)"
|
67
|
+
local snapshot_ruby_order="$snapshot_primary_ruby $(cat "$snapshot_installable_file" | \grep -v "$snapshot_primary_ruby")"
|
68
68
|
for snapshot_ruby_name in $snapshot_ruby_order ; do
|
69
69
|
snapshot_install_command="$(__rvm_recorded_install_command "$snapshot_ruby_name")"
|
70
70
|
if [[ -n "$snapshot_install_command" ]]; then
|
@@ -139,7 +139,7 @@ snapshot_load() {
|
|
139
139
|
export rvm_create_flag=1
|
140
140
|
$rvm_scripts_path/log "info" "Setting up gemsets"
|
141
141
|
__rvm_pushpop "$snapshot_temp_path/gems"
|
142
|
-
for snapshot_gemset in $(\ls | grep '\.gems$' | sed 's/.gems$//'); do
|
142
|
+
for snapshot_gemset in $(\ls | \grep '\.gems$' | sed 's/.gems$//'); do
|
143
143
|
__rvm_become "$snapshot_gemset"
|
144
144
|
result="$?"
|
145
145
|
__error_on_result "$result" "Error becoming '$snapshot_gemset'" && return "$result"
|
data/scripts/update
CHANGED
@@ -47,7 +47,7 @@ spinner() {
|
|
47
47
|
command -v perl > /dev/null 2>&1 && perl -e 'sleep 0.5'
|
48
48
|
}
|
49
49
|
|
50
|
-
if echo "$*" | grep -q 'trace' ; then echo "$*" ; env | grep '^rvm_' ; set -x ; fi
|
50
|
+
if echo "$*" | \grep -q 'trace' ; then echo "$*" ; env | \grep '^rvm_' ; set -x ; fi
|
51
51
|
|
52
52
|
while [[ $# -gt 0 ]] ; do
|
53
53
|
token="$1" ; shift
|
@@ -72,7 +72,7 @@ if [[ -z "$rvm_path" ]] ; then rvm_path="${rvm_prefix}rvm" ; fi
|
|
72
72
|
|
73
73
|
source scripts/initialize
|
74
74
|
|
75
|
-
if grep -q 'scripts/rvm' $HOME/.bash* 2>/dev/null || grep -q 'scripts/rvm' $HOME/.zsh* 2>/dev/null; then
|
75
|
+
if \grep -q 'scripts/rvm' $HOME/.bash* 2>/dev/null || \grep -q 'scripts/rvm' $HOME/.zsh* 2>/dev/null; then
|
76
76
|
if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then
|
77
77
|
export upgrade_flag=1
|
78
78
|
else
|
@@ -178,12 +178,12 @@ if [[ -n "$rvm_auto_flag" ]] ; then
|
|
178
178
|
for rcfile in $(echo $rvm_rc_files) ; do
|
179
179
|
if [[ ! -f $rcfile ]] ; then \touch $rcfile ; fi
|
180
180
|
if [[ -s "$HOME/.profile" ]] ; then
|
181
|
-
if ! grep -q '.profile' "$rcfile" ; then
|
181
|
+
if ! \grep -q '.profile' "$rcfile" ; then
|
182
182
|
echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
|
183
183
|
printf "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
|
184
184
|
fi
|
185
185
|
fi
|
186
|
-
if ! grep -q "scripts\/rvm" "$rcfile" ; then
|
186
|
+
if ! \grep -q "scripts\/rvm" "$rcfile" ; then
|
187
187
|
echo " Adding 'if [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi' to $rcfile."
|
188
188
|
printf "\n# rvm-install added:\nif [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi\n" >> $rcfile
|
189
189
|
fi
|
@@ -275,7 +275,7 @@ done
|
|
275
275
|
|
276
276
|
# Move from legacy defaults to the new, alias based system.
|
277
277
|
if [[ -s "$rvm_config_path/default" ]]; then
|
278
|
-
original_version="$(basename "$(grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")"
|
278
|
+
original_version="$(basename "$(\grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")"
|
279
279
|
if [[ -n "$original_version" ]]; then
|
280
280
|
$rvm_scripts_path/alias create default "$original_version" &> /dev/null
|
281
281
|
fi
|
@@ -335,7 +335,7 @@ else
|
|
335
335
|
printf "\n placing all non-interactive items in the .bashrc, including the 'source' line above"
|
336
336
|
printf "\n3) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
|
337
337
|
fi
|
338
|
-
if [[ -s "$HOME/.bashrc" ]] && grep -q '&& return' "$HOME/.bashrc" ; then
|
338
|
+
if [[ -s "$HOME/.bashrc" ]] && \grep -q '&& return' "$HOME/.bashrc" ; then
|
339
339
|
printf "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc."
|
340
340
|
printf "\n This means that if you see '[ -z \"\$PS1\" ] && return' then you must change this line to:"
|
341
341
|
printf "\n if [[ -n \"\$PS1\" ]] ; then"
|
data/scripts/upgrade
CHANGED
@@ -13,7 +13,7 @@ confirm() {
|
|
13
13
|
printf "$1 (Y/n): "
|
14
14
|
local confirmation_response
|
15
15
|
read -r confirmation_response
|
16
|
-
[[ -z "$confirmation_response" ]] || echo "$confirmation_response" | grep -qi '^y'
|
16
|
+
[[ -z "$confirmation_response" ]] || echo "$confirmation_response" | \grep -qi '^y'
|
17
17
|
}
|
18
18
|
|
19
19
|
die_with_error() {
|
@@ -33,30 +33,30 @@ expand_existing_ruby() {
|
|
33
33
|
echo "$ruby_name"
|
34
34
|
return 0
|
35
35
|
fi
|
36
|
-
done < <($rvm_scripts_path/list strings | tr ' ' '\n' | sort -ur | grep "^$prefix" | grep -v '-head$' | head -n1)
|
36
|
+
done < <($rvm_scripts_path/list strings | tr ' ' '\n' | sort -ur | \grep "^$prefix" | \grep -v '-head$' | head -n1)
|
37
37
|
return 1
|
38
38
|
}
|
39
39
|
|
40
40
|
upgrade_ruby() {
|
41
41
|
[[ -z "$source_ruby" ]] && die_with_error "Unable to find a source ruby. Please manually provide one."
|
42
|
-
|
42
|
+
|
43
43
|
expanded_source="$(expand_ruby_name "$source_ruby")"
|
44
44
|
[[ -z "$expanded_source" ]] && die_with_error "The source ruby was not a valid ruby string."
|
45
|
-
|
45
|
+
|
46
46
|
confirm "Are you sure you wish to upgrade from $expanded_source to $expanded_destination?" || die_with_error "Cancelling upgrade."
|
47
|
-
|
47
|
+
|
48
48
|
if [[ ! -d "$rvm_rubies_path/$expanded_destination" ]]; then
|
49
49
|
$rvm_scripts_path/log "info" "Installing new ruby $expanded_destination"
|
50
50
|
$rvm_bin_path/rvm install "$expanded_destination"
|
51
51
|
result="$?"
|
52
52
|
[[ "$result" -gt 0 ]] && die_with_error "Unable to install ruby $expanded_destination. Please install it manually to continue." "$result"
|
53
53
|
fi
|
54
|
-
|
54
|
+
|
55
55
|
$rvm_scripts_path/log "info" "Migrating gems from $expanded_source to $expanded_destination"
|
56
56
|
$rvm_scripts_path/migrate "$expanded_source" "$expanded_destination"
|
57
57
|
result="$?"
|
58
58
|
[[ "$result" -gt 0 ]] && die_with_error "Error migrating gems." "$result"
|
59
|
-
|
59
|
+
|
60
60
|
$rvm_scripts_path/log "info" "Upgrade complete!"
|
61
61
|
}
|
62
62
|
|
@@ -68,4 +68,4 @@ expanded_destination="$(expand_ruby_name "$destination_ruby")"
|
|
68
68
|
|
69
69
|
source_ruby="${1:-"$(expand_existing_ruby "$destination_ruby")"}"
|
70
70
|
|
71
|
-
upgrade_ruby
|
71
|
+
upgrade_ruby
|
data/scripts/utility
CHANGED
@@ -5,7 +5,7 @@ __rvm_setup() {
|
|
5
5
|
if [[ -n "$ZSH_VERSION" ]] ; then
|
6
6
|
__shell_array_start=1
|
7
7
|
# Set clobber for zsh users, for compatibility with bash's append operator ( >> file ) behavior
|
8
|
-
setopt | grep -qs '^noclobber$'
|
8
|
+
setopt | \grep -qs '^noclobber$'
|
9
9
|
rvm_zsh_clobber=$?
|
10
10
|
setopt clobber
|
11
11
|
else
|
@@ -88,12 +88,12 @@ __rvm_db() {
|
|
88
88
|
unset key value variable
|
89
89
|
}
|
90
90
|
|
91
|
-
is_a_function() { type $1 | head -n 1 | grep -q "function" ; }
|
91
|
+
is_a_function() { type $1 | head -n 1 | \grep -q "function" ; }
|
92
92
|
|
93
93
|
__rvm_quote_args() {
|
94
94
|
local quoted_string=""
|
95
95
|
for quoted_argument in "$@"; do
|
96
|
-
if printf "%s" "$quoted_argument" | grep -vq "^[[:alnum:]]$"; then
|
96
|
+
if printf "%s" "$quoted_argument" | \grep -vq "^[[:alnum:]]$"; then
|
97
97
|
quoted_string="$quoted_string '$(printf "%s" "$quoted_argument" | sed "s/'/\'\\\'\'/g")'"
|
98
98
|
else
|
99
99
|
quoted_string="$quoted_string $quoted_argument"
|
@@ -160,7 +160,7 @@ __rvm_clean_path() {
|
|
160
160
|
|
161
161
|
# Clean all rvm items out of the current working path.
|
162
162
|
__rvm_remove_rvm_from_path() {
|
163
|
-
PATH=$(echo $PATH | \tr -s ':' '\n' | grep -v "\.rvm" | \tr -s '\n' ':' | sed 's#:$##')
|
163
|
+
PATH=$(echo $PATH | \tr -s ':' '\n' | \grep -v "\.rvm" | \tr -s '\n' ':' | sed 's#:$##')
|
164
164
|
export PATH
|
165
165
|
}
|
166
166
|
|
@@ -305,7 +305,7 @@ __rvm_load_rvmrc() {
|
|
305
305
|
[[ -z "$rvm_ignore_rvmrc" ]] && return
|
306
306
|
for rvmrc in /etc/rvmrc $HOME/.rvmrc ; do
|
307
307
|
if [[ -f "$rvmrc" ]] ; then
|
308
|
-
if grep -q '^\s*rvm .*$' $rvmrc ; then
|
308
|
+
if \grep -q '^\s*rvm .*$' $rvmrc ; then
|
309
309
|
$rvm_scripts_path/log "error" "$rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
|
310
310
|
return 1
|
311
311
|
else
|
@@ -422,7 +422,7 @@ __rvm_initialize() {
|
|
422
422
|
|
423
423
|
__rvm_clean_path
|
424
424
|
|
425
|
-
if echo "$PATH" | grep -q 'rvm\/bin:' ; then
|
425
|
+
if echo "$PATH" | \grep -q 'rvm\/bin:' ; then
|
426
426
|
PATH="${rvm_bin_path}:$PATH"
|
427
427
|
export PATH
|
428
428
|
fi
|
@@ -626,7 +626,7 @@ __rvm_strip() {
|
|
626
626
|
}
|
627
627
|
|
628
628
|
__rvm_using_gemset_globalcache() {
|
629
|
-
$rvm_scripts_path/db "$rvm_config_path/user" "use_gemset_globalcache" | grep -q '^true$'
|
629
|
+
$rvm_scripts_path/db "$rvm_config_path/user" "use_gemset_globalcache" | \grep -q '^true$'
|
630
630
|
}
|
631
631
|
|
632
632
|
__rvm_current_gemcache_dir() {
|
@@ -658,6 +658,118 @@ __rvm_load_env_file() {
|
|
658
658
|
fi
|
659
659
|
}
|
660
660
|
|
661
|
+
__rvm_md5_for() {
|
662
|
+
if command -v md5 > /dev/null; then
|
663
|
+
echo "$1" | md5
|
664
|
+
else
|
665
|
+
echo "$1" | md5sum | awk '{print $1}'
|
666
|
+
fi
|
667
|
+
}
|
668
|
+
|
669
|
+
__rvm_rvmrc_key() {
|
670
|
+
__rvm_md5_for "$1"
|
671
|
+
}
|
672
|
+
|
673
|
+
__rvm_reset_rvmrc_trust() {
|
674
|
+
touch "$rvm_config_path/rvmrcs"
|
675
|
+
$rvm_scripts_path/db "$rvm_config_path/rvmrcs" "$(__rvm_rvmrc_key "$1")" "delete" >/dev/null 2>&1
|
676
|
+
}
|
677
|
+
|
678
|
+
__rvm_trust_rvmrc() {
|
679
|
+
touch "$rvm_config_path/rvmrcs"
|
680
|
+
__rvm_reset_rvmrc_trust "$1"
|
681
|
+
$rvm_scripts_path/db "$rvm_config_path/rvmrcs" "$(__rvm_rvmrc_key "$1")" "1" >/dev/null 2>&1
|
682
|
+
}
|
683
|
+
|
684
|
+
__rvm_untrust_rvmrc() {
|
685
|
+
touch "$rvm_config_path/rvmrcs"
|
686
|
+
__rvm_reset_rvmrc_trust "$1"
|
687
|
+
$rvm_scripts_path/db "$rvm_config_path/rvmrcs" "$(__rvm_rvmrc_key "$1")" "0" >/dev/null 2>&1
|
688
|
+
}
|
689
|
+
|
690
|
+
__rvm_rvmrc_stored_trust() {
|
691
|
+
touch "$rvm_config_path/rvmrcs"
|
692
|
+
$rvm_scripts_path/db "$rvm_config_path/rvmrcs" "$(__rvm_rvmrc_key "$1")"
|
693
|
+
}
|
694
|
+
|
695
|
+
__rvm_rvmrc_tools() {
|
696
|
+
local rvmrc_action="$1"
|
697
|
+
[[ $# -gt 0 ]] && shift
|
698
|
+
local rvmrc_path="$(builtin cd "${1:-$PWD}" >/dev/null 2>&1; pwd)/.rvmrc"
|
699
|
+
case "$rvmrc_action" in
|
700
|
+
reset)
|
701
|
+
__rvm_reset_rvmrc_trust "$rvmrc_path"
|
702
|
+
echo "Reset trust for $rvmrc_path"
|
703
|
+
;;
|
704
|
+
trust)
|
705
|
+
__rvm_trust_rvmrc "$rvmrc_path"
|
706
|
+
echo "Marked $rvmrc_path as trusted"
|
707
|
+
;;
|
708
|
+
untrust)
|
709
|
+
__rvm_untrust_rvmrc "$rvmrc_path"
|
710
|
+
echo "Marked $rvmrc_path as untrusted"
|
711
|
+
;;
|
712
|
+
trusted)
|
713
|
+
local trusted_value="$(__rvm_rvmrc_stored_trust "$rvmrc_path")"
|
714
|
+
if [[ "$trusted_value" = "1" ]]; then
|
715
|
+
echo "The rvmrc at '$rvmrc_path' is currently trusted."
|
716
|
+
elif [[ "$trusted_value" = "0" ]]; then
|
717
|
+
echo "The rvmrc at '$rvmrc_path' is currently untrusted."
|
718
|
+
else
|
719
|
+
echo "The trustiworthiness of '$rvmrc_path' is currently unknown."
|
720
|
+
fi
|
721
|
+
;;
|
722
|
+
load)
|
723
|
+
rvm_trust_rvmrcs=1 __rvm_project_rvmrc "$(dirname "$rvmrc_path")"
|
724
|
+
;;
|
725
|
+
*)
|
726
|
+
echo "Usage: rvm rvmrc {trust,untrust,trusted,load,reset}"
|
727
|
+
return 1
|
728
|
+
;;
|
729
|
+
esac
|
730
|
+
}
|
731
|
+
|
732
|
+
__rvm_check_rvmrc_trustworthiness() {
|
733
|
+
# Trust when they have the flag... of doom!
|
734
|
+
[[ -z "$1" || "$rvm_trust_rvmrcs" = "1" ]] && return
|
735
|
+
value="$(__rvm_rvmrc_stored_trust "$1")"
|
736
|
+
if [[ -z "$value" ]] ; then
|
737
|
+
__rvm_ask_to_trust "$1"
|
738
|
+
else
|
739
|
+
[[ "$value" = "1" ]]
|
740
|
+
fi
|
741
|
+
}
|
742
|
+
|
743
|
+
__rvm_ask_to_trust() {
|
744
|
+
echo "Changing into a directory with an untrusted .rvmrc"
|
745
|
+
echo "Do you wish to trust the rvmrc in this directory? It contains:"
|
746
|
+
echo "---"
|
747
|
+
echo ""
|
748
|
+
cat "$1"
|
749
|
+
echo ""
|
750
|
+
echo "---"
|
751
|
+
echo "So, do you wish to trust it? (y for yes, n for no)"
|
752
|
+
local trusted=""
|
753
|
+
while [[ -z "$trusted" ]] ; do
|
754
|
+
printf ">> "
|
755
|
+
read -r value
|
756
|
+
value="$(echo "$value" | tr '[[:upper:]]' '[[:lower:]]' | __rvm_strip)"
|
757
|
+
if [[ "$value" = "y"* ]]; then
|
758
|
+
trusted=1
|
759
|
+
elif [[ "$value" = "n"* ]]; then
|
760
|
+
trusted=0
|
761
|
+
fi
|
762
|
+
done
|
763
|
+
unset value
|
764
|
+
if [[ "$trusted" == "1" ]] ; then
|
765
|
+
__rvm_trust_rvmrc "$1"
|
766
|
+
return 0
|
767
|
+
else
|
768
|
+
__rvm_untrust_rvmrc "$1"
|
769
|
+
return 1
|
770
|
+
fi
|
771
|
+
}
|
772
|
+
|
661
773
|
# Checks the rvmrc for the given directory. Note that if
|
662
774
|
# argument is passed, it will be used instead of pwd.
|
663
775
|
__rvm_project_rvmrc() {
|
@@ -677,9 +789,11 @@ __rvm_project_rvmrc() {
|
|
677
789
|
else
|
678
790
|
if [[ -f "$cwd/.rvmrc" ]] ; then
|
679
791
|
if [[ "$rvm_rvmrc_cwd" != "$cwd" ]] ; then
|
680
|
-
|
681
|
-
|
682
|
-
|
792
|
+
if __rvm_check_rvmrc_trustworthiness "$cwd/.rvmrc" ; then
|
793
|
+
rvm_previous_environment="$(__rvm_environment_identifier)"
|
794
|
+
rvm_rvmrc_cwd="$cwd"
|
795
|
+
source "$cwd/.rvmrc"
|
796
|
+
fi
|
683
797
|
fi
|
684
798
|
break
|
685
799
|
else
|
@@ -696,7 +810,7 @@ __rvm_record_install() {
|
|
696
810
|
local rvm_install_command="$(echo "$recorded_ruby_name $rvm_install_arguments" | __rvm_strip)"
|
697
811
|
\touch "$rvm_install_record_file"
|
698
812
|
\rm -f "$rvm_install_record_file.tmp"
|
699
|
-
cat "$rvm_install_record_file" | grep -v "^$recorded_ruby_name " > "$rvm_install_record_file.tmp"
|
813
|
+
cat "$rvm_install_record_file" | \grep -v "^$recorded_ruby_name " > "$rvm_install_record_file.tmp"
|
700
814
|
echo "$rvm_install_command" >> "$rvm_install_record_file.tmp"
|
701
815
|
\rm -f "$rvm_install_record_file"
|
702
816
|
mv "$rvm_install_record_file.tmp" "$rvm_install_record_file"
|
@@ -707,7 +821,7 @@ __rvm_remove_install_record() {
|
|
707
821
|
local rvm_install_record_file="$rvm_config_path/installs"
|
708
822
|
if [[ -s "$rvm_install_record_file" ]]; then
|
709
823
|
mv "$rvm_install_record_file" "$rvm_install_record_file.tmp"
|
710
|
-
cat "$rvm_install_record_file.tmp" | grep -v "^$recorded_ruby_name " > "$rvm_install_record_file"
|
824
|
+
cat "$rvm_install_record_file.tmp" | \grep -v "^$recorded_ruby_name " > "$rvm_install_record_file"
|
711
825
|
\rm -f "$rvm_install_record_file.tmp"
|
712
826
|
fi
|
713
827
|
}
|
@@ -716,8 +830,8 @@ __rvm_recorded_install_command() {
|
|
716
830
|
local recorded_ruby_name="$($rvm_scripts_path/tools strings "$1" | awk -F"$rvm_gemset_separator" '{print $1}')"
|
717
831
|
[[ -z "$recorded_ruby_name" ]] && return 1
|
718
832
|
local recorded_ruby_match="^$recorded_ruby_name "
|
719
|
-
if [[ -s "$rvm_config_path/installs" ]] && grep -q "$recorded_ruby_match" "$rvm_config_path/installs" ; then
|
720
|
-
cat "$rvm_config_path/installs" | grep "$recorded_ruby_match" | head -n1
|
833
|
+
if [[ -s "$rvm_config_path/installs" ]] && \grep -q "$recorded_ruby_match" "$rvm_config_path/installs" ; then
|
834
|
+
cat "$rvm_config_path/installs" | \grep "$recorded_ruby_match" | head -n1
|
721
835
|
else
|
722
836
|
return 1
|
723
837
|
fi
|
@@ -725,7 +839,7 @@ __rvm_recorded_install_command() {
|
|
725
839
|
|
726
840
|
__rvm_environment_identifier() {
|
727
841
|
ruby_string="$(command -v ruby)"
|
728
|
-
if [ -n "$ruby_string" ] && echo "$ruby_string" | grep -q -F "$rvm_rubies_path"; then
|
842
|
+
if [ -n "$ruby_string" ] && echo "$ruby_string" | \grep -q -F "$rvm_rubies_path"; then
|
729
843
|
echo "$GEM_HOME" | xargs basename
|
730
844
|
else
|
731
845
|
echo "system"
|
@@ -736,18 +850,20 @@ __rvm_environment_identifier() {
|
|
736
850
|
__rvm_expand_ruby_string() {
|
737
851
|
if [[ -z "$1" || "$1" = "all" ]]; then
|
738
852
|
$rvm_scripts_path/list strings | tr ' ' "\n" | __rvm_strip
|
739
|
-
elif [[ "$1" = "all
|
853
|
+
elif [[ "$1" = "all-gemsets" ]]; then
|
740
854
|
$rvm_scripts_path/list gemsets strings | __rvm_strip
|
741
|
-
elif [[ "$1"
|
855
|
+
elif [[ "$1" = "default-with-rvmrc" || "$1" = "rvmrc" ]]; then
|
742
856
|
$rvm_scripts_path/tools path-identifier "$(pwd)"
|
743
|
-
elif [[ "$1" == "all-rubies" || "$1"
|
857
|
+
elif [[ "$1" == "all-rubies" || "$1" = "rubies" ]]; then
|
744
858
|
$rvm_scripts_path/list rubies strings | __rvm_strip
|
745
|
-
elif [[ "$1" == "current" || "$1"
|
859
|
+
elif [[ "$1" == "current-ruby" || "$1" = "gemsets" ]]; then
|
746
860
|
local current_ruby="$(__rvm_environment_identifier | awk -F"$rvm_gemset_separator" '{print $1}')"
|
747
861
|
rvm_silence_logging=1 $rvm_scripts_path/gemsets list | sed "s/^/$current_ruby$rvm_gemset_separator/" | __rvm_strip
|
748
|
-
elif [[ "$1"
|
862
|
+
elif [[ "$1" = "current" ]]; then
|
863
|
+
__rvm_environment_identifier
|
864
|
+
elif [[ "$1" = "aliases" ]]; then
|
749
865
|
cat "$rvm_config_path/alias" | awk -F= '{print $1}' | __rvm_strip
|
750
866
|
else
|
751
867
|
echo "$1" | tr "," "\n" | __rvm_strip
|
752
868
|
fi
|
753
|
-
}
|
869
|
+
}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rvm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
|
-
- 0
|
8
7
|
- 1
|
9
|
-
-
|
10
|
-
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Wayne E. Seguin
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-22 00:00:00 -04:00
|
19
19
|
default_executable: rvm-install
|
20
20
|
dependencies: []
|
21
21
|
|