rvm 0.1.32 → 0.1.33
Sign up to get free protection for your applications and to get access to all the features.
- data/README +4 -0
- data/binscripts/rvm +1 -1
- data/binscripts/rvm-prompt +1 -1
- data/config/db +20 -10
- data/config/md5 +4 -4
- data/gemsets/default.gems +1 -0
- data/gemsets/global.gems +0 -0
- data/help/info +64 -0
- data/help/wrapper +41 -0
- data/install +62 -64
- data/lib/VERSION.yml +1 -1
- data/rvm.gemspec +39 -30
- data/scripts/alias +103 -0
- data/scripts/cli +64 -23
- data/scripts/db +9 -2
- data/scripts/docs +57 -0
- data/scripts/env +48 -0
- data/scripts/fetch +1 -1
- data/scripts/gemsets +14 -14
- data/scripts/help +30 -0
- data/scripts/info +142 -0
- data/scripts/initialize +4 -2
- data/scripts/install +62 -64
- data/scripts/list +102 -0
- data/scripts/log +12 -12
- data/scripts/manage +71 -38
- data/scripts/notes +35 -34
- data/scripts/package +4 -4
- data/scripts/rvm +5 -9
- data/scripts/rvm-install +62 -64
- data/scripts/selector +44 -63
- data/scripts/set +8 -8
- data/scripts/update +62 -64
- data/scripts/utility +51 -250
- data/scripts/wrapper +66 -0
- metadata +42 -30
- data/scripts/symlink +0 -18
data/scripts/selector
CHANGED
@@ -194,6 +194,7 @@ __rvm_select() {
|
|
194
194
|
|
195
195
|
if [[ ! -z "$rvm_ruby_interpreter" ]] && [[ "system" != "$rvm_ruby_interpreter" ]] && [[ "default" != "$rvm_ruby_interpreter" ]] ; then
|
196
196
|
if [[ ! -z "$rvm_ruby_version" ]] ; then
|
197
|
+
rvm_release_version=$(echo $rvm_ruby_version | awk -F'.' '{ print $1 }')
|
197
198
|
rvm_major_version=$(echo $rvm_ruby_version | awk -F'.' '{ print $2 }')
|
198
199
|
rvm_minor_version=$(echo $rvm_ruby_version | awk -F'.' '{ print $3 }')
|
199
200
|
fi
|
@@ -205,6 +206,7 @@ __rvm_select() {
|
|
205
206
|
rvm_ruby_binary="$rvm_ruby_home/bin/ruby"
|
206
207
|
rvm_ruby_irbrc="$rvm_ruby_home/.irbrc"
|
207
208
|
rvm_ruby_gem_home="${rvm_gems_path}/${rvm_ruby_string}"
|
209
|
+
rvm_ruby_gem_path="${rvm_ruby_gem_home}:${rvm_ruby_gem_home}@global"
|
208
210
|
|
209
211
|
if [[ "maglev" = "$rvm_ruby_interpreter" ]] ; then
|
210
212
|
export MAGLEV_HOME="$rvm_ruby_home"
|
@@ -213,13 +215,14 @@ __rvm_select() {
|
|
213
215
|
|
214
216
|
if [[ ! -z "$rvm_gemset_name" ]] ; then
|
215
217
|
rvm_ruby_gem_home="${rvm_ruby_gem_home}${rvm_gemset_separator}${rvm_gemset_name}"
|
218
|
+
rvm_ruby_gem_path="${rvm_ruby_gem_home}:${rvm_gems_path}/${rvm_ruby_string}${rvm_gemset_separator}global"
|
216
219
|
fi
|
217
220
|
|
218
221
|
rvm_ruby_selected_flag=1
|
219
222
|
|
220
223
|
mkdir -p $rvm_ruby_log_path
|
221
224
|
|
222
|
-
export rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_url rvm_ruby_patch_level rvm_ruby_configure rvm_ruby_configure_flags rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_gemset_name rvm_gems_path rvm_ruby_gem_home rvm_path rvm_src_path rvm_bin_path rvm_ruby_binary rvm_ruby_home rvm_log_path rvm_ruby_log_path rvm_src_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string
|
225
|
+
export rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_url rvm_ruby_patch_level rvm_ruby_configure rvm_ruby_configure_flags rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_release_version rvm_major_version rvm_minor_version rvm_gemset_name rvm_gems_path rvm_ruby_gem_home rvm_path rvm_src_path rvm_bin_path rvm_ruby_binary rvm_ruby_home rvm_log_path rvm_ruby_log_path rvm_src_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string
|
223
226
|
else
|
224
227
|
rvm_ruby_interpreter="${rvm_ruby_interpreter:-system}"
|
225
228
|
fi
|
@@ -228,27 +231,9 @@ __rvm_select() {
|
|
228
231
|
|
229
232
|
__rvm_use() {
|
230
233
|
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select $* ; fi
|
231
|
-
if [[ -z "$rvm_ruby_interpreter" ]] ; then rvm_ruby_interpreter="
|
234
|
+
if [[ -z "$rvm_ruby_interpreter" ]] ; then rvm_ruby_interpreter="system" ; fi
|
232
235
|
|
233
|
-
if [[ "
|
234
|
-
|
235
|
-
new_path="$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)"
|
236
|
-
new_path="$rvm_bin_path:$new_path"
|
237
|
-
|
238
|
-
if [[ -s $rvm_config_path/default ]] ; then
|
239
|
-
unset new_path
|
240
|
-
source $rvm_config_path/default
|
241
|
-
if [[ ! -z "$rvm_verbose_flag" ]] ; then
|
242
|
-
$rvm_scripts_path/log "info" "Now using default ruby."
|
243
|
-
fi
|
244
|
-
else
|
245
|
-
rvm_ruby_interpreter="system"
|
246
|
-
$rvm_scripts_path/log "warn" "no default rvm specified, defaulting to pre-rvm system."
|
247
|
-
unset GEM_HOME GEM_PATH BUNDLE_PATH MY_RUBY_HOME RUBY_VERSION IRBRC
|
248
|
-
if [[ -s $rvm_config_path/system ]] ; then source $rvm_config_path/system ; fi
|
249
|
-
fi
|
250
|
-
|
251
|
-
elif [[ "system" = "$rvm_ruby_interpreter" ]] ; then
|
236
|
+
if [[ "system" = "$rvm_ruby_interpreter" ]] ; then
|
252
237
|
|
253
238
|
unset GEM_HOME GEM_PATH BUNDLE_PATH MY_RUBY_HOME RUBY_VERSION IRBRC
|
254
239
|
new_path="$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)"
|
@@ -263,8 +248,8 @@ __rvm_use() {
|
|
263
248
|
fi
|
264
249
|
|
265
250
|
if [[ "root" = "$(whoami)" ]] ; then
|
266
|
-
for binary in
|
267
|
-
rm -f $
|
251
|
+
for binary in ruby gem irb ri rdoc rake erb testrb ; do
|
252
|
+
rm -f "$rvm_bin_path/$binary"
|
268
253
|
done
|
269
254
|
fi
|
270
255
|
|
@@ -296,6 +281,9 @@ __rvm_use() {
|
|
296
281
|
fi
|
297
282
|
fi
|
298
283
|
|
284
|
+
# Ensure the environment file for the selected ruby exists.
|
285
|
+
__rvm_ensure_has_enviroment_files
|
286
|
+
|
299
287
|
if [[ ! -z "$rvm_verbose_flag" ]] ; then
|
300
288
|
$rvm_scripts_path/log "info" "Using $(basename $GEM_HOME | tr '-' ' ' | sed 's/'${rvm_gemset_separator}'/ with gemset /')"
|
301
289
|
fi
|
@@ -306,46 +294,37 @@ __rvm_use() {
|
|
306
294
|
|
307
295
|
if [[ ! -z "$rvm_default_flag" ]] && [[ "default" != "$rvm_ruby_interpreter" ]] ; then
|
308
296
|
if [[ "root" = "$(whoami)" ]] ; then
|
309
|
-
|
310
|
-
|
311
|
-
ln -nfs $rvm_ruby_home/bin/$binary $rvm_symlink_path/$binary
|
312
|
-
rm -f $rvm_symlink_path/passenger_ruby
|
313
|
-
ln -nfs $rvm_bin_path/$rvm_ruby_string $rvm_symlink_path/passenger_ruby
|
314
|
-
done
|
297
|
+
# By not providing the name it uses the base ruby binary names.
|
298
|
+
$rvm_scripts_path/wrapper $rvm_ruby_string
|
315
299
|
fi
|
316
|
-
|
300
|
+
local environment_id="$(__rvm_environment_identifier)"
|
317
301
|
if [[ "system" = "$rvm_ruby_interpreter" ]] ; then
|
302
|
+
$rvm_scripts_path/alias delete default &> /dev/null
|
318
303
|
rm -f $rvm_config_path/default
|
319
304
|
rm -f $rvm_bin_path/default*
|
305
|
+
rm -f $rvm_environments_path/default
|
306
|
+
rm -f $rvm_wrappers_path/default
|
320
307
|
else
|
321
308
|
RUBY_VERSION="$($rvm_ruby_home/bin/ruby -v | sed 's#^\(.*\) (.*$#\1#')"
|
322
309
|
export GEM_HOME GEM_PATH BUNDLE_PATH MY_RUBY_HOME RUBY_VERSION
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
eval value=\$${variable}
|
329
|
-
if [[ ! -z "$value" ]] ; then
|
330
|
-
echo "export ${variable}='$value'" >> $rvm_config_path/default
|
331
|
-
else
|
332
|
-
echo "unset ${variable}" >> $rvm_config_path/default
|
333
|
-
fi
|
334
|
-
done ; unset variable value
|
335
|
-
|
336
|
-
if [[ ! -z "$rvm_default_flag" ]] ; then $rvm_scripts_path/symlink "default" ; fi
|
310
|
+
# Delete + then create the default alias.
|
311
|
+
$rvm_scripts_path/alias delete default &> /dev/null
|
312
|
+
$rvm_scripts_path/alias create default "$environment_id" >& /dev/null
|
313
|
+
ln -nfs $rvm_environments_path/$environment_id $rvm_environments_path/default
|
314
|
+
ln -nfs $rvm_wrappers_path/$environment_id $rvm_wrappers_path/default
|
337
315
|
fi
|
316
|
+
fi ; unset rvm_default_flag
|
317
|
+
|
318
|
+
if [[ ! -z "$rvm_wrapper_name" ]] ; then
|
319
|
+
$rvm_scripts_path/wrapper "$rvm_ruby_string" "$rvm_wrapper_name" > /dev/null 2>&1
|
320
|
+
unset rvm_wrapper_name
|
338
321
|
fi
|
339
|
-
unset rvm_default_flag
|
340
322
|
|
341
|
-
if [[ ! -z "$
|
342
|
-
|
343
|
-
if [[ ! -z "$
|
344
|
-
if [[ ! -z "$
|
345
|
-
|
346
|
-
if [[ ! -z "$rvm_ruby_string" ]] ; then export rvm_ruby_string ; fi
|
347
|
-
if [[ ! -z "$rvm_gemset_name" ]] ; then export rvm_gemset_name ; fi
|
348
|
-
if [[ ! -z "$new_path" ]] ; then export PATH="$new_path" ; unset new_path ; fi
|
323
|
+
if [[ ! -z "$rvm_rvmrc_flag" ]] ; then __rvm_set_rvmrc ; fi
|
324
|
+
# Export ruby string and gem set me for extrnal scripts to take advantage of them.
|
325
|
+
if [[ ! -z "$rvm_ruby_string" ]] ; then export rvm_ruby_string ; fi
|
326
|
+
if [[ ! -z "$rvm_gemset_name" ]] ; then export rvm_gemset_name ; fi
|
327
|
+
if [[ ! -z "$new_path" ]] ; then export PATH="$new_path" ; unset new_path ; fi
|
349
328
|
|
350
329
|
if [[ "maglev" = "$rvm_ruby_interpreter" ]] ; then
|
351
330
|
export MAGLEV_HOME="$rvm_ruby_home"
|
@@ -369,27 +348,29 @@ __rvm_ruby_string() {
|
|
369
348
|
# * rvm_ruby_tag
|
370
349
|
# * rvm_ruby_patch
|
371
350
|
|
351
|
+
# Alias'd rubies
|
352
|
+
if [[ -z "$rvm_expanding_aliases" ]]; then
|
353
|
+
rvm_ruby_string="${rvm_ruby_string:-"default"}"
|
354
|
+
expanded_alias_name="$($rvm_scripts_path/alias show "$rvm_ruby_string" 2>/dev/null)"
|
355
|
+
if [[ -n "$expanded_alias_name" ]]; then
|
356
|
+
rvm_ruby_string="$expanded_alias_name"
|
357
|
+
elif [[ "$rvm_ruby_string" = default ]]; then
|
358
|
+
# Default is not a known value. Instead, we need to therefore set it to system.
|
359
|
+
rvm_ruby_string="system"
|
360
|
+
fi
|
361
|
+
fi
|
362
|
+
|
372
363
|
set_name=$(echo "$rvm_ruby_string" | awk -F${rvm_gemset_separator} '{print $2}')
|
373
364
|
if [[ ! -z "$set_name" ]] ; then rvm_gemset_name="$set_name" ; fi
|
374
365
|
ruby_string=$(echo "$rvm_ruby_string" | awk -F${rvm_gemset_separator} '{print $1}')
|
375
366
|
|
376
367
|
__rvm_unset_ruby_variables
|
377
368
|
|
378
|
-
# Alias'd rubies
|
379
|
-
if [[ -z "$alias_name" ]] ; then
|
380
|
-
value="$($rvm_scripts_path/db "$rvm_config_path/alias" "$ruby_string" 2>/dev/null)"
|
381
|
-
if [[ ! -z "$value" ]] ; then ruby_string="$value" ; fi
|
382
|
-
fi
|
383
|
-
|
384
369
|
for string in $(echo $ruby_string | tr '-' ' ') ; do
|
385
370
|
if [[ "head" = "$string" ]] ; then
|
386
371
|
rvm_ruby_revision="head"
|
387
372
|
unset rvm_ruby_patch_level rvm_ruby_revision rvm_ruby_tag
|
388
373
|
export rvm_head_flag=1
|
389
|
-
elif [[ "default" = "$string" ]] ; then
|
390
|
-
rvm_ruby_interpreter="default"
|
391
|
-
unset rvm_ruby_patch_level rvm_ruby_tag rvm_head_flag rvm_ruby_revision rvm_ruby_version rvm_gemset_name
|
392
|
-
return
|
393
374
|
elif [[ "system" = "$string" ]] ; then
|
394
375
|
rvm_ruby_interpreter="system"
|
395
376
|
unset rvm_ruby_patch_level rvm_ruby_tag rvm_head_flag rvm_ruby_revision rvm_ruby_version rvm_gemset_name
|
data/scripts/set
CHANGED
@@ -37,7 +37,7 @@ __rvm_ruby_do() {
|
|
37
37
|
|
38
38
|
if [[ ! -z "$rvm_ruby_mode" ]] ; then
|
39
39
|
rvm_ruby_string="${rvm_ruby_string}-${rvm_ruby_mode}"
|
40
|
-
rvm_ruby_mode="--$(echo $rvm_ruby_mode | sed 's/^m//')"
|
40
|
+
rvm_ruby_mode="--$(echo "$rvm_ruby_mode" | sed 's/^m//')"
|
41
41
|
fi
|
42
42
|
|
43
43
|
load_path="$(dirname $(command -v $binary) 2>/dev/null):$rvm_ruby_load_path"
|
@@ -63,7 +63,7 @@ __rvm_ruby_do() {
|
|
63
63
|
eval "$rvm_command" >> ./log/$rvm_ruby_string/$action.log 2>> ./log/$rvm_ruby_string/$action.error.log
|
64
64
|
else
|
65
65
|
if [[ "$rvm_verbose_flag" != "0" ]] ; then
|
66
|
-
$rvm_scripts_path/log "info" "$rvm_ruby_string: $($rvm_ruby_home/bin/ruby -v $rvm_ruby_mode | tr "\n" ' ')"
|
66
|
+
$rvm_scripts_path/log "info" "$rvm_ruby_string: $($rvm_ruby_home/bin/ruby -v $rvm_ruby_mode | tr "\n" ' ')\n"
|
67
67
|
fi
|
68
68
|
eval "$rvm_command"
|
69
69
|
fi
|
@@ -93,7 +93,7 @@ __rvm_summary() {
|
|
93
93
|
fi
|
94
94
|
total=${#rubies[*]}
|
95
95
|
if [[ ! -z "$ZSH_VERSION" ]] ; then array_start=1 ; else array_start=0 ; fi
|
96
|
-
|
96
|
+
printf "$summary" | tee -a log/summary.log
|
97
97
|
return ${#errors[*]}
|
98
98
|
}
|
99
99
|
|
@@ -114,7 +114,7 @@ __rvm_yaml() {
|
|
114
114
|
yaml="$yaml\n \"${rubies[$index]}\": ${statuses[$index]}"
|
115
115
|
done ; unset index array_start
|
116
116
|
mkdir -p log
|
117
|
-
|
117
|
+
printf "$yaml" | tee -a log/summary.yaml
|
118
118
|
|
119
119
|
return ${#errors[*]}
|
120
120
|
}
|
@@ -122,9 +122,9 @@ __rvm_yaml() {
|
|
122
122
|
# Output the summary in a json format.
|
123
123
|
__rvm_json() {
|
124
124
|
json="{"
|
125
|
-
json="$json\n \"totals\": { \"rubies\": ${#rubies[*]}, \"successes\": ${#successes[*]}, \"errors\": ${#errors[*]}},"
|
126
|
-
json="$json\n \"successful\": [
|
127
|
-
json="$json\n \"errors\": [
|
125
|
+
json="$json\n \"totals\": { \"rubies\": ${#rubies[*]}, \"successes\": ${#successes[*]}, \"errors\": ${#errors[*]} },"
|
126
|
+
json="$json\n \"successful\": [$(echo \"${successes[*]}\" | sed 's# #", "#g' | sed 's#\"\"##')],"
|
127
|
+
json="$json\n \"errors\": [$(echo \"${errors[*]}\" | sed 's# #", "#g' | sed 's#\"\"##')],"
|
128
128
|
json="$json\n \"rubies\": {"
|
129
129
|
|
130
130
|
total=${#rubies[*]}
|
@@ -139,7 +139,7 @@ __rvm_json() {
|
|
139
139
|
json="$json\n }\n}"
|
140
140
|
|
141
141
|
mkdir -p log
|
142
|
-
|
142
|
+
printf "$json" | tee -a log/summary.json
|
143
143
|
|
144
144
|
return ${#errors[*]}
|
145
145
|
}
|
data/scripts/update
CHANGED
@@ -11,7 +11,7 @@ source scripts/version
|
|
11
11
|
source scripts/utility
|
12
12
|
|
13
13
|
usage() {
|
14
|
-
|
14
|
+
printf "
|
15
15
|
Usage:
|
16
16
|
${0} [options]
|
17
17
|
|
@@ -27,7 +27,7 @@ spinner_counter=0
|
|
27
27
|
spinner() {
|
28
28
|
array=('/' '-' '\\' '|' '/' '-' '\\' '|')
|
29
29
|
index=$((($spinner_counter % 8)))
|
30
|
-
|
30
|
+
printf "\r${array[$index]}"
|
31
31
|
let "spinner_counter=spinner_counter+1"
|
32
32
|
command -v perl > /dev/null 2>&1 && perl -e 'sleep 0.5'
|
33
33
|
}
|
@@ -86,19 +86,17 @@ rvm_scripts_path="${rvm_scripts_path:-"$rvm_path/scripts"}"
|
|
86
86
|
rvm_config_path="${rvm_config_path:-"$rvm_path/config"}"
|
87
87
|
rvm_hooks_path="${rvm_hooks_path:-"$rvm_path/hooks"}"
|
88
88
|
rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}"
|
89
|
-
rvm_symlink_path="${rvm_symlink_path:-$rvm_prefix/bin}"
|
90
89
|
|
91
90
|
export rvm_gemset_separator="@" # TODO: Remove this after a while.
|
92
91
|
|
93
|
-
|
94
|
-
|
95
|
-
|
92
|
+
printf "\n$(tput setaf 2)RVM:$(tput sgr0) shell scripts which allow management of multiple ruby interpreters and environments."
|
93
|
+
printf "\n$(tput setaf 2)RTFM: $(tput sgr0) http://rvm.beginrescueend.com/"
|
94
|
+
printf "\n$(tput setaf 2)HELP: $(tput sgr0) http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)"
|
96
95
|
|
97
|
-
echo -e "\n********************************************************************************"
|
98
96
|
if [[ "$upgrade_flag" -eq 1 ]] ;then
|
99
|
-
|
97
|
+
printf "\n\n Upgrading the RVM installation in $rvm_path/"
|
100
98
|
else
|
101
|
-
|
99
|
+
printf "\n\n Installing rvm to $rvm_path/"
|
102
100
|
fi
|
103
101
|
|
104
102
|
spinner
|
@@ -150,19 +148,19 @@ chmod +x $rvm_bin_path/*
|
|
150
148
|
#
|
151
149
|
spinner
|
152
150
|
if [[ ! -z "$rvm_auto_flag" ]] ; then
|
153
|
-
|
151
|
+
printf "Checking rc files... ($rvm_rc_files)"
|
154
152
|
if [[ "$rvm_loaded_flag" != "1" ]] ; then
|
155
153
|
for rcfile in $(echo $rvm_rc_files) ; do
|
156
154
|
if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
|
157
155
|
if [[ -s "$HOME/.profile" ]] ; then
|
158
156
|
if ! grep -q '.profile' "$rcfile" ; then
|
159
157
|
echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
|
160
|
-
|
158
|
+
printf "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
|
161
159
|
fi
|
162
160
|
fi
|
163
161
|
if ! grep -q "scripts\/rvm" "$rcfile" ; then
|
164
162
|
echo " Adding 'if [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi' to $rcfile."
|
165
|
-
|
163
|
+
printf "\n# rvm-install added:\nif [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi\n" >> $rcfile
|
166
164
|
fi
|
167
165
|
done
|
168
166
|
fi
|
@@ -196,12 +194,12 @@ done
|
|
196
194
|
# Migrate old gemset directories to new gemset pattern.
|
197
195
|
#
|
198
196
|
spinner
|
199
|
-
|
197
|
+
printf "\r*" # Stop spinner.
|
200
198
|
|
201
199
|
for gemset in $rvm_path/gems/*\%* ; do
|
202
200
|
new_path=${gemset/\%/${rvm_gemset_separator}}
|
203
201
|
if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
|
204
|
-
|
202
|
+
printf "\n Renaming $(basename $gemset) to $(basename $new_path) for new gemset separator."
|
205
203
|
mv $gemset $new_path
|
206
204
|
fi
|
207
205
|
done
|
@@ -209,22 +207,26 @@ done
|
|
209
207
|
for gemset in $rvm_path/gems/*\+* ; do
|
210
208
|
new_path=${gemset/\+/${rvm_gemset_separator}}
|
211
209
|
if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
|
212
|
-
|
210
|
+
printf "\n Renaming $(basename $gemset) to $(basename $new_path) for new gemset separator."
|
213
211
|
mv $gemset $new_path
|
214
212
|
fi
|
215
213
|
done
|
216
214
|
for gemset in $rvm_path/gems/*\@ ; do
|
217
215
|
new_path=$(echo $gemset | sed -e 's#\@$##')
|
218
216
|
if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
|
219
|
-
|
217
|
+
printf "\n Fixing: $(basename $gemset) to $(basename $new_path) for new gemset separator."
|
220
218
|
mv $gemset $new_path
|
221
219
|
fi
|
222
220
|
done
|
223
221
|
|
224
|
-
#
|
225
|
-
if [[ -s $rvm_config_path/default ]]
|
226
|
-
|
227
|
-
|
222
|
+
# Move from legacy defaults to the new, alias based system.
|
223
|
+
if [[ -s "$rvm_config_path/default" ]]; then
|
224
|
+
original_version="$(basename "$(grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")"
|
225
|
+
if [[ -n "$original_version" ]]; then
|
226
|
+
$rvm_scripts_path/alias create default "$original_version" &> /dev/null
|
227
|
+
fi
|
228
|
+
unset original_version
|
229
|
+
rm -rf "$rvm_config_path/default"
|
228
230
|
fi
|
229
231
|
|
230
232
|
#
|
@@ -232,64 +234,60 @@ fi
|
|
232
234
|
#
|
233
235
|
|
234
236
|
if [[ "root" = "$(whoami)" ]] ; then
|
235
|
-
|
236
|
-
mkdir -p $
|
237
|
-
|
238
|
-
|
239
|
-
chmod +x $rvm_symlink_path/rvm
|
240
|
-
chmod +x $rvm_symlink_path/rvmsudo
|
237
|
+
printf "\n Symlinking rvm to $rvm_bin_path/rvm ..."
|
238
|
+
mkdir -p $rvm_bin_path
|
239
|
+
chmod +x $rvm_bin_path/rvm
|
240
|
+
chmod +x $rvm_bin_path/rvmsudo
|
241
241
|
fi
|
242
242
|
|
243
243
|
if [[ "$upgrade_flag" -eq 0 ]] ; then
|
244
|
-
echo -e "\n********************************************************************************"
|
245
244
|
./scripts/notes
|
246
245
|
fi
|
247
246
|
|
248
|
-
echo -e "\n********************************************************************************"
|
249
247
|
name="$(awk -F= '/^[[:space:]]*name/{print $2}' ~/.gitconfig 2>/dev/null)"
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
echo -e "\n********************************************************************************"
|
248
|
+
printf "\n\n${name:-"$(whoami)"},\n"
|
249
|
+
printf "\nThank you for using rvm. I hope that it makes your work easier and more enjoyable."
|
250
|
+
printf "\nIf you have any questions, issues and/or ideas for improvement please hop in #rvm on irc.freenode.net and let me know."
|
251
|
+
printf "\nMy irc nickname is 'wayneeseguin' and I hang out from ~09:00-17:00EST and again from ~21:00EST-~00:00EST."
|
252
|
+
printf "\nIf I do not respond right away, please hang around after asking your question, I will respond as soon as I am back."
|
253
|
+
printf "\nBe sure to get head often as rvm development happens fast, you can do this by typing 'rvm update --head'."
|
254
|
+
printf "\n w$(tput setaf 2)⦿‿⦿$(tput sgr0)t!"
|
255
|
+
printf "\n ~ Wayne\n"
|
259
256
|
|
260
257
|
if [[ "$upgrade_flag" -eq 1 ]] ; then
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
258
|
+
printf "\n$(tput setaf 6)Upgrade Notes\n"
|
259
|
+
printf "\n * Gemset separator is '@' and will remain unless any rubies error using it."
|
260
|
+
printf "\n * If you encounter any issues with a ruby your best bet is to 'rvm remove X ; rvm install X' "
|
261
|
+
printf "\n * Do not forget that 'rvm notes' tells you OS dependency packages for installing rubies."
|
262
|
+
printf "\n$(tput sgr0)\n"
|
263
|
+
printf "\nUpgrade of RVM in $rvm_path/ is complete.\n\n"
|
266
264
|
else
|
267
265
|
if [[ "root" != "$(whoami)" ]] ; then
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
266
|
+
printf "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
|
267
|
+
printf "\n1) Place the folowing line at the end of your shell's loading files(.bashrc or .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
|
268
|
+
printf "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
|
269
|
+
printf "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
|
270
|
+
printf "\n This means that if you see '[ -z "$PS1" ] && return' then you must change this line to:"
|
271
|
+
printf "\n if [[ ! -z "$PS1" ]] ; then"
|
272
|
+
printf "\n ... original content that was below the && return line ..."
|
273
|
+
printf "\n fi # <= be sure to close the if."
|
274
|
+
printf "\n #EOF .bashrc"
|
275
|
+
printf "\n Be absolutely *sure* to REMOVE the '&& return'."
|
276
|
+
printf "\n If you wish to DRY up your config you can 'source ~/.bashrc' at the top of your .bash_profile."
|
277
|
+
printf "\n placing all non-interactive items in the .bashrc"
|
278
|
+
printf "\n3) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
|
281
279
|
fi
|
282
280
|
if [[ -s $HOME/.bashrc ]] && grep '&& return' $HOME/.bashrc ; then
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
281
|
+
printf "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc."
|
282
|
+
printf "\n This means that if you see '[ -z "\$PS1" ] && return' then you must change this line to:"
|
283
|
+
printf "\n if [[ -n "\$PS1" ]] ; then"
|
284
|
+
printf "\n ... original content that was below the && return line ..."
|
285
|
+
printf "\n fi # <= be sure to close the if."
|
286
|
+
printf "\n #EOF .bashrc"
|
287
|
+
printf "\nEven if you use zsh you should still adjust the .bashrc as above."
|
288
|
+
printf "\nIf you have any questions about this please visit #rvm on irc.freenode.net.\n"
|
291
289
|
fi
|
292
|
-
|
290
|
+
printf "\nInstallation of RVM to $rvm_path/ is complete.\n\n"
|
293
291
|
fi
|
294
292
|
|
295
293
|
exit 0
|