rvm 1.0.11 → 1.0.13

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/scripts/selector CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  # __rvm_select implementation version patch_level
4
- __rvm_select() {
5
-
4
+ __rvm_select()
5
+ {
6
6
  # Set Variable Defaults
7
7
  export GEM_HOME GEM_PATH BUNDLE_PATH MY_RUBY_HOME RUBY_VERSION
8
8
 
@@ -233,7 +233,7 @@ __rvm_select() {
233
233
 
234
234
  rvm_ruby_gem_home="${rvm_gems_path:-"$rvm_path/gems"}/${rvm_ruby_string}"
235
235
 
236
- if [[ ! -z "$rvm_gemset_name" ]] ; then
236
+ if [[ -n "$rvm_gemset_name" ]] ; then
237
237
  rvm_ruby_gem_home="${rvm_ruby_gem_home}${rvm_gemset_separator:-"@"}${rvm_gemset_name}"
238
238
  rvm_ruby_gem_path="${rvm_ruby_gem_home}:${rvm_gems_path:-"$rvm_path/gems"}/${rvm_ruby_string}${rvm_gemset_separator:-"@"}global"
239
239
  fi
@@ -254,7 +254,8 @@ __rvm_select() {
254
254
  fi
255
255
  }
256
256
 
257
- __rvm_use() {
257
+ __rvm_use()
258
+ {
258
259
  local new_path binary full_binary_path rvm_ruby_gem_home
259
260
 
260
261
  #if [[ ${rvm_ruby_selected_flag:-0} -eq 0 ]] ; then __rvm_select "$@" ; fi
@@ -266,7 +267,7 @@ __rvm_use() {
266
267
 
267
268
  unset GEM_HOME GEM_PATH BUNDLE_PATH MY_RUBY_HOME RUBY_VERSION IRBRC
268
269
 
269
- new_path="${rvm_bin_path:-"$rvm_path/bin"}:$(__rvm_remove_rvm_from_path ; printf "$PATH")"
270
+ new_path="$(__rvm_remove_rvm_from_path ; printf "$PATH"):${rvm_bin_path:-"$rvm_path/bin"}"
270
271
 
271
272
  if [[ -s $rvm_path/config/system ]] ; then
272
273
 
@@ -338,9 +339,13 @@ __rvm_use() {
338
339
  fi
339
340
 
340
341
  # Export ruby string and gem set me for extrenal scripts to take advantage of them.
341
- if [[ -n "${rvm_ruby_string:-""}" ]] ; then export rvm_ruby_string ; fi
342
+ if [[ -n "${rvm_ruby_string:-""}" ]] ; then
343
+ export rvm_ruby_string
344
+ fi
342
345
 
343
- if [[ -n "${rvm_gemset_name:-""}" ]] ; then export rvm_gemset_name ; fi
346
+ if [[ -n "${rvm_gemset_name:-""}" ]] ; then
347
+ export rvm_gemset_name
348
+ fi
344
349
 
345
350
  if [[ -n "$new_path" ]]; then
346
351
  export PATH="$new_path"
@@ -409,7 +414,8 @@ __rvm_use() {
409
414
  return 0
410
415
  }
411
416
 
412
- __rvm_ruby_string() {
417
+ __rvm_ruby_string()
418
+ {
413
419
  # rvm_ruby_string may designate any of the following items:
414
420
  # * rvm_gemset_name
415
421
  # * rvm_ruby_interpreter
@@ -437,7 +443,7 @@ __rvm_ruby_string() {
437
443
  rvm_ruby_string="system"
438
444
  fi
439
445
  fi
440
-
446
+
441
447
  if echo "$rvm_ruby_string" | \grep -q "${rvm_gemset_separator:-"@"}" ; then
442
448
  rvm_gemset_name="${rvm_ruby_string/*${rvm_gemset_separator:-"@"}/}"
443
449
  rvm_ruby_string="${rvm_ruby_string/${rvm_gemset_separator:-"@"}*/}"
@@ -648,14 +654,13 @@ __rvm_ruby_string() {
648
654
 
649
655
  # Select a gemset based on CLI set options and environment.
650
656
  # This only sets 'rvm_ruby_gem_home'
651
- __rvm_gemset_select() {
652
-
657
+ __rvm_gemset_select()
658
+ {
653
659
  command -v gem > /dev/null
654
660
  if [[ $? -gt 0 ]] ; then return 0 ; fi # Stop if no 'gem' command is available.
655
661
 
656
662
  rvm_ruby_gem_home=${rvm_ruby_gem_home:-""}
657
663
  rvm_gemset_name=${rvm_gemset_name:-""}
658
- rvm_ruby_global_gems_path="${rvm_ruby_gem_home%%${rvm_gemset_separator:-"@"}*}${rvm_gemset_separator:-"@"}global"
659
664
 
660
665
  if [[ -z "${rvm_gemset_name:-""}" ]] ; then
661
666
 
@@ -672,7 +677,8 @@ __rvm_gemset_select() {
672
677
  fi
673
678
  fi
674
679
 
675
- if ! echo "${rvm_gemset_name:-""}" | grep -q "^[[:digit:]]\.[[:digit:]]" ; then
680
+ if [[ -n "${rvm_gemset_name:-""}" ]] &&
681
+ ! echo "${rvm_gemset_name:-""}" | grep -q "^[[:digit:]]\.[[:digit:]]" ; then
676
682
 
677
683
  rvm_ruby_gem_home="${rvm_gems_path:-"$rvm_path/gems"}/${rvm_ruby_string}${rvm_gemset_separator:-"@"}${rvm_gemset_name}"
678
684
 
@@ -729,9 +735,9 @@ __rvm_gemset_select() {
729
735
 
730
736
  if [[ -z "${rvm_ruby_gem_home:-""}" && -n "${rvm_ruby_string:-""}" ]] ; then
731
737
  rvm_ruby_gem_home="${rvm_gems_path:-"$rvm_path/gems"}/$rvm_ruby_string"
732
- rvm_ruby_global_gems_path="${rvm_ruby_gem_home%%${rvm_gemset_separator}*}${rvm_gemset_separator:-"@"}global"
733
738
  fi
734
739
 
740
+ rvm_ruby_global_gems_path="${rvm_ruby_gem_home%%${rvm_gemset_separator:-"@"}*}${rvm_gemset_separator:-"@"}global"
735
741
  rvm_ruby_gem_path="$rvm_ruby_gem_home:$rvm_ruby_global_gems_path"
736
742
 
737
743
  # Ensure that the ruby gem home exists.
@@ -748,9 +754,11 @@ __rvm_gemset_select() {
748
754
  }
749
755
 
750
756
  # Use a gemset specified by 'rvm_ruby_gem_home'
751
- __rvm_gemset_use() {
757
+ __rvm_gemset_use()
758
+ {
752
759
  if [[ -z "${rvm_gemset_name:-""}" ]] ; then
753
- "$rvm_path/scripts/log" "error" "Gemset was not given.\n Usage:\n rvm gemset use <gemsetname>\n"
760
+ "$rvm_path/scripts/log" "error" \
761
+ "Gemset was not given.\n Usage:\n rvm gemset use <gemsetname>\n"
754
762
  return 1
755
763
  fi
756
764
 
@@ -758,10 +766,12 @@ __rvm_gemset_use() {
758
766
 
759
767
  if [[ ! -d "$rvm_ruby_gem_home" ]] ; then
760
768
 
761
- if [[ ${rvm_gemset_create_on_use_flag:-0} -eq 1 || ${rvm_create_flag:-0} -eq 1 ]] ; then
769
+ if [[ ${rvm_gemset_create_on_use_flag:-0} -eq 1 \
770
+ || ${rvm_create_flag:-0} -eq 1 ]] ; then
762
771
  "$rvm_path/scripts/gemsets" create "$rvm_gemset_name"
763
772
  else
764
- "$rvm_path/scripts/log" "error" "Gemset '$rvm_gemset_name' does not exist, rvm gemset create '$rvm_gemset_name' first."
773
+ "$rvm_path/scripts/log" "error" \
774
+ "Gemset '$rvm_gemset_name' does not exist, rvm gemset create '$rvm_gemset_name' first."
765
775
  return 1
766
776
  fi
767
777
  fi
@@ -771,9 +781,12 @@ __rvm_gemset_use() {
771
781
  fi
772
782
 
773
783
  rvm_ruby_gem_home="${GEM_HOME//${rvm_gemset_separator:-"@"}*}${rvm_gemset_separator:-"@"}${rvm_gemset_name}"
784
+ rvm_ruby_global_gems_path="${rvm_ruby_gem_home%%${rvm_gemset_separator:-"@"}*}${rvm_gemset_separator:-"@"}global"
785
+
774
786
  GEM_HOME="$rvm_ruby_gem_home"
775
787
  BUNDLE_PATH="$rvm_ruby_gem_home"
776
788
  GEM_PATH="$rvm_ruby_gem_home:$rvm_ruby_global_gems_path"
789
+
777
790
  export rvm_ruby_gem_home GEM_HOME BUNDLE_PATH GEM_PATH
778
791
 
779
792
  __rvm_use # Now ensure the selection takes effect for the environment.
@@ -782,14 +795,23 @@ __rvm_gemset_use() {
782
795
  return 0
783
796
  }
784
797
 
785
- __rvm_gemset_clear() {
786
- rvm_gemset_name="" ; shift # TODO: Is this shift necessary???
798
+ __rvm_gemset_clear()
799
+ {
800
+ rvm_gemset_name=""
801
+
787
802
  rvm_ruby_gem_home="${GEM_HOME//${rvm_gemset_separator:-"@"}*}"
788
- rvm_ruby_global_gems_path="${rvm_ruby_gem_home%%${rvm_gemset_separator:-"@"}*}${rvm_gemset_separator:-"@"}global"
803
+
804
+ rvm_ruby_global_gems_path="${rvm_ruby_gem_home}${rvm_gemset_separator:-"@"}global"
805
+
789
806
  GEM_HOME=$rvm_ruby_gem_home
807
+
790
808
  BUNDLE_PATH="$rvm_ruby_gem_home"
809
+
791
810
  GEM_PATH="$rvm_ruby_gem_home:$rvm_ruby_global_gems_path"
811
+
792
812
  export rvm_ruby_gem_home rvm_ruby_global_gems_path GEM_HOME BUNDLE_PATH GEM_PATH
813
+
793
814
  __rvm_use # Now ensure the selection takes effect for the environment.
815
+
794
816
  }
795
817
 
data/scripts/set CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  source "$rvm_path/scripts/base"
4
4
 
5
- __rvm_attempt_single_exec() {
5
+ __rvm_attempt_single_exec()
6
+ {
6
7
  # Return if we have multiple rubies. or we're not running exec.
7
8
  if [[ "$action" = "exec" && ${#rvm_ruby_strings[@]} -lt 2 ]]; then
8
9
 
@@ -15,8 +16,8 @@ __rvm_attempt_single_exec() {
15
16
  }
16
17
 
17
18
  # Perform an action using one of a selected ruby's specified binaries.
18
- __rvm_ruby_do() {
19
-
19
+ __rvm_ruby_do()
20
+ {
20
21
  # Return on invalid rubies.
21
22
  __rvm_become "$current_set_ruby" || return 1
22
23
 
@@ -144,7 +145,8 @@ __rvm_ruby_do() {
144
145
  }
145
146
 
146
147
  # Output the summary in a human readable format.
147
- __rvm_summary() {
148
+ __rvm_summary()
149
+ {
148
150
  export successes errors statuses
149
151
 
150
152
  summary="\nSummary:\n\n"
@@ -172,8 +174,8 @@ __rvm_summary() {
172
174
  }
173
175
 
174
176
  # Output the summary in a yaml format.
175
- __rvm_yaml() {
176
-
177
+ __rvm_yaml()
178
+ {
177
179
  export successes errors statuses
178
180
 
179
181
  yaml="totals:\n rubies: ${#rubies[*]}\n successes: ${#successes[*]}\n errors: ${#errors[*]}\nsuccesses:"
@@ -210,8 +212,8 @@ __rvm_yaml() {
210
212
  }
211
213
 
212
214
  # Output the summary in a json format.
213
- __rvm_json() {
214
-
215
+ __rvm_json()
216
+ {
215
217
  local index array_start
216
218
 
217
219
  json="{
data/scripts/snapshot CHANGED
@@ -5,7 +5,8 @@ unset GREP_OPTIONS
5
5
 
6
6
  source "$rvm_path/scripts/base"
7
7
 
8
- __error_on_result() {
8
+ __error_on_result()
9
+ {
9
10
  if [[ "$1" -gt 0 ]]; then
10
11
  "$rvm_path/scripts/log" "fail" "$2 - Aborting now."
11
12
  return 0
@@ -14,8 +15,8 @@ __error_on_result() {
14
15
  fi
15
16
  }
16
17
 
17
- snapshot_save() {
18
-
18
+ snapshot_save()
19
+ {
19
20
  if [[ -z "$1" ]]; then
20
21
 
21
22
  printf "
@@ -138,7 +139,10 @@ snapshot_save() {
138
139
  "$rvm_path/scripts/log" "info" "Snapshot complete"
139
140
  }
140
141
 
141
- snapshot_load() {
142
+ snapshot_load()
143
+ {
144
+ local package_info
145
+
142
146
  if [[ -z "$1" ]]; then
143
147
  echo "Usage: rvm snapshot load name" >&2
144
148
  echo "Loads a snapshot from <name>.tar.gz in the current directory." >&2
@@ -176,13 +180,18 @@ snapshot_load() {
176
180
  done; unset snapshot_package
177
181
 
178
182
  "$rvm_path/scripts/log" "info" "Installing rubies"
183
+
179
184
  chmod +x "$snapshot_temp_path/install-rubies.sh"
185
+
180
186
  "$snapshot_temp_path/install-rubies.sh"
181
187
  result="$?"
188
+
182
189
  __error_on_result "$result" "Error importing rubies." && return "$result"
183
190
 
184
191
  export rvm_create_flag=1
192
+
185
193
  "$rvm_path/scripts/log" "info" "Setting up gemsets"
194
+
186
195
  (
187
196
  builtin cd "$snapshot_temp_path/gems"
188
197
 
@@ -213,6 +222,7 @@ snapshot_load() {
213
222
  )
214
223
 
215
224
  "$rvm_path/scripts/log" "info" "Restoring aliases"
225
+
216
226
  while read -r package_info; do
217
227
  # Note: this assumes an '=' int the input...
218
228
  local alias_name="${package_info/=*}"
@@ -225,7 +235,6 @@ snapshot_load() {
225
235
  __error_on_result "$result" "Error setting default to $alias_ruby" && return "$result"
226
236
  fi
227
237
  done < "$snapshot_temp_path/alias"
228
- unset package_info
229
238
 
230
239
  "$rvm_path/scripts/log" "info" "Cleaning up load process"
231
240
  \rm -rf "$snapshot_temp_path"
@@ -233,7 +242,8 @@ snapshot_load() {
233
242
  "$rvm_path/scripts/log" "info" "Loaded snapshot from $(basename "$snapshot_archive")"
234
243
  }
235
244
 
236
- snapshot_usage() {
245
+ snapshot_usage()
246
+ {
237
247
  echo "Usage: rvm snapshot {save,load} file" >&2
238
248
  return 1
239
249
  }
data/scripts/tools CHANGED
@@ -2,17 +2,20 @@
2
2
 
3
3
  source "$rvm_path/scripts/base"
4
4
 
5
- usage() {
5
+ usage()
6
+ {
6
7
  echo "Usage: rvm tools {identifier,path-identifier,strings}" 1>&2
7
8
  exit 1
8
9
  }
9
10
 
10
11
  # Return the identifier that's current in use.
11
- tools_identifier() {
12
+ tools_identifier()
13
+ {
12
14
  __rvm_environment_identifier
13
15
  }
14
16
 
15
- tools_path_identifier() {
17
+ tools_path_identifier()
18
+ {
16
19
  if [[ -z "$1" || ! -d "$1" ]]; then
17
20
  echo "Usage: rvm tools path-identifier 'path-to-check'"
18
21
  return 1
@@ -26,7 +29,8 @@ tools_path_identifier() {
26
29
  exit $rvmrc_result
27
30
  }
28
31
 
29
- tools_strings() {
32
+ tools_strings()
33
+ {
30
34
  for ruby_name in "$@"; do
31
35
  __rvm_unset_ruby_variables
32
36
  rvm_ruby_string="$ruby_name"
data/scripts/update CHANGED
@@ -1,10 +1,13 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  set -o errtrace
4
+ set -o errexit
5
+
4
6
  export PS4='+[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() $ }'
5
7
 
6
8
  if [[ -z "$rvm_selfcontained" ]]; then
7
- if [[ "root" = "$(whoami)" ]] || [[ -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
9
+ if [[ "root" = "$(whoami)" \
10
+ || -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
8
11
  export rvm_selfcontained=0
9
12
  else
10
13
  export rvm_selfcontained=1
@@ -15,34 +18,49 @@ unset rvm_auto_flag
15
18
 
16
19
  install_source_path="$(dirname "$0" | sed 's#\/scripts$##')"
17
20
 
18
- if [[ -d "$install_source_path/scripts" ]] && [[ -s "$install_source_path/scripts/utility" ]] ; then
21
+ if [[ -d "$install_source_path/scripts" \
22
+ && -s "$install_source_path/scripts/utility" ]] ; then
19
23
  builtin cd "$install_source_path"
20
24
  fi
21
25
 
22
26
  source scripts/version
23
27
  source scripts/utility
24
28
 
25
- usage() {
29
+ usage()
30
+ {
26
31
  printf "
27
32
  Usage:
33
+
28
34
  ${0} [options]
29
35
 
30
36
  options:
37
+
31
38
  --auto : Automatically update shell profile files.
39
+
32
40
  --prefix : Installation prefix directory.
41
+
33
42
  --help : Display help/usage (this) message
43
+
34
44
  --version : display rvm package version
45
+
35
46
  "
36
47
  }
37
48
 
38
- check_rubyopt_conditions() {
49
+ check_rubyopt_conditions()
50
+ {
39
51
  if [[ -n "${RUBYOPT:-""}" ]]; then
40
- printf "\n\nWARNING: You have RUBYOPT set in your current environment. This may interfere with normal rvm"
41
- printf "\n operation. If errors show up, please try unsetting RUBYOPT first.\n"
52
+ printf "
53
+
54
+ WARNING: You have RUBYOPT set in your current environment.
55
+ This may cause rubies to not work as you expect them to as it is not supported
56
+ by all of them If errors show up, please try unsetting RUBYOPT first.
57
+
58
+ "
42
59
  fi
43
60
  }
44
61
 
45
- andand_return_instructions() {
62
+ andand_return_instructions()
63
+ {
46
64
  printf "
47
65
  This means that if you see something like:
48
66
 
@@ -63,7 +81,8 @@ EOF - This marks the end of the .bashrc file
63
81
  "
64
82
  }
65
83
 
66
- installation_complete() {
84
+ installation_complete()
85
+ {
67
86
  printf "
68
87
  You must now complete the install by loading RVM in new shells.
69
88
 
@@ -91,7 +110,8 @@ installation_complete() {
91
110
  \n"
92
111
  }
93
112
 
94
- andand_return_warning() {
113
+ andand_return_warning()
114
+ {
95
115
  printf "
96
116
  WARNING: you have a 'return' statement in your ~/.bashrc
97
117
  This could cause some features of RVM to not work.
@@ -104,7 +124,8 @@ andand_return_warning() {
104
124
  \n"
105
125
  }
106
126
 
107
- thank_you() {
127
+ thank_you()
128
+ {
108
129
  printf "
109
130
  ${name:-"$(whoami)"},
110
131
 
@@ -135,7 +156,8 @@ or opening a new shell
135
156
  "
136
157
  }
137
158
 
138
- upgrade_notes() {
159
+ upgrade_notes()
160
+ {
139
161
  printf "
140
162
 
141
163
  Upgrade Notes
@@ -187,14 +209,23 @@ fi
187
209
 
188
210
  source scripts/initialize
189
211
 
190
- if grep -q 'scripts/rvm' "$HOME"/.bash* 2>/dev/null || grep -q 'scripts/rvm' "$HOME"/.zsh* 2>/dev/null; then
212
+ if grep -q 'scripts/rvm' "$HOME"/.bash* 2>/dev/null \
213
+ || grep -q 'scripts/rvm' "$HOME"/.zsh* 2>/dev/null ; then
214
+
191
215
  if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then
216
+
192
217
  export upgrade_flag=1
218
+
193
219
  else
220
+
194
221
  export upgrade_flag=0
222
+
195
223
  fi
224
+
196
225
  else
226
+
197
227
  export upgrade_flag=0
228
+
198
229
  fi
199
230
 
200
231
  __rvm_initialize
@@ -237,7 +268,17 @@ else
237
268
 
238
269
  fi
239
270
 
240
- directories=( "${rvm_archives_path:-"$rvm_path/archives"}" "${rvm_src_path:-"$rvm_path/src"}" "${rvm_log_path:-"$rvm_path/log"}" "$rvm_bin_path" "${rvm_gems_path:-"$rvm_path/gems"}" "${rvm_rubies_path:-"$rvm_path/rubies"}" "$rvm_path/config" "${rvm_tmp_path:-"$rvm_path/tmp"}" "$rvm_path/bin" )
271
+ directories=(
272
+ "${rvm_archives_path:-"$rvm_path/archives"}"
273
+ "${rvm_src_path:-"$rvm_path/src"}"
274
+ "${rvm_log_path:-"$rvm_path/log"}"
275
+ "$rvm_bin_path"
276
+ "${rvm_gems_path:-"$rvm_path/gems"}"
277
+ "${rvm_rubies_path:-"$rvm_path/rubies"}"
278
+ "$rvm_path/config"
279
+ "${rvm_tmp_path:-"$rvm_path/tmp"}"
280
+ "$rvm_path/bin"
281
+ )
241
282
 
242
283
  for directory in "${directories[@]}" ; do
243
284
 
@@ -277,7 +318,8 @@ for dir_name in config scripts examples lib hooks help patches; do
277
318
  done
278
319
 
279
320
  if [[ ! -s "$rvm_path/config/user" ]] ; then
280
- echo '# Users settings file, overrides db file settings and persists across installs.' >> "$rvm_path/config/user"
321
+ echo '# User settings, overrides db settings and persists across installs.' \
322
+ >> "$rvm_path/config/user"
281
323
  fi
282
324
 
283
325
  scripts=(monitor match log install color db fetch log set package)
@@ -321,9 +363,12 @@ if [[ ${rvm_auto_flag:-0} -eq 1 ]] ; then
321
363
 
322
364
  if ! grep -q '.profile' "$rcfile" ; then
323
365
 
324
- echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
366
+ echo " Adding profile sourcing line to $rcfile."
325
367
 
326
- printf "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> "$rcfile"
368
+ printf "
369
+ # rvm-install added line:
370
+ [[ -s \$HOME/.profile ]] && source \$HOME/.profile
371
+ " >> "$rcfile"
327
372
 
328
373
  fi
329
374
 
@@ -331,9 +376,12 @@ if [[ ${rvm_auto_flag:-0} -eq 1 ]] ; then
331
376
 
332
377
  if ! grep -q "scripts\/rvm" "$rcfile" ; then
333
378
 
334
- echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
379
+ echo " Adding rvm loading line to $rcfile."
335
380
 
336
- printf "\n# rvm-install added:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> "$rcfile"
381
+ printf "
382
+ # rvm-install added:
383
+ [[ -s \"$rvm_path/.rvm/scripts/rvm\" ]] && . \"$rvm_path/.rvm/scripts/rvm\"
384
+ " >> "$rcfile"
337
385
 
338
386
  fi
339
387
 
@@ -352,9 +400,10 @@ if [[ -d gemsets/ ]] ; then
352
400
 
353
401
  fi
354
402
 
355
- for gemset_file in $(builtin cd gemsets ; find \. -iname '*.gems' | sed 's/^\.\///') ; do
403
+ for gemset_file in $(find "$PWD/gemsets" -iname '*.gems' | sed 's/^\.\///') ; do
356
404
 
357
- destination="$rvm_path/gemsets/$gemset_file"
405
+ cwd="${PWD//\//\\/}\/gemsets\/"
406
+ destination="$rvm_path/gemsets/${gemset_file/$cwd}"
358
407
 
359
408
  destination_path="$(dirname "$destination")"
360
409
 
@@ -362,7 +411,7 @@ if [[ -d gemsets/ ]] ; then
362
411
 
363
412
  mkdir -p "$destination_path"
364
413
 
365
- cp "gemsets/$gemset_file" "$destination"
414
+ cp "$gemset_file" "$destination"
366
415
 
367
416
  fi
368
417
 
@@ -404,7 +453,8 @@ fi
404
453
  #
405
454
  mkdir -p "${rvm_rubies_path:-"$rvm_path/rubies"}/"
406
455
 
407
- for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
456
+ for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* \
457
+ $rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
408
458
 
409
459
  if [[ -d "$ruby" ]] ; then
410
460
 
@@ -416,7 +466,8 @@ for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-*
416
466
 
417
467
  if [[ -s "$new_path/bin/$file" ]] ; then
418
468
 
419
- sed -e '1,1s=.*=#!'"${new_path}/bin/ruby=" "${new_path}/bin/${file}" > "${new_path}/bin/${file}.new"
469
+ sed -e '1,1s=.*=#!'"${new_path}/bin/ruby=" "${new_path}/bin/${file}" \
470
+ > "${new_path}/bin/${file}.new"
420
471
 
421
472
  mv -f "$new_path/bin/$file.new" "$new_path/bin/$file"
422
473
 
@@ -481,7 +532,8 @@ done
481
532
  # Move from legacy defaults to the new, alias based system.
482
533
  if [[ -s "$rvm_path/config/default" ]]; then
483
534
 
484
- original_version="$(basename "$(grep GEM_HOME "$rvm_path/config/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator:-"@"}#")")"
535
+ original_version="$(basename "$(grep GEM_HOME "$rvm_path/config/default" \
536
+ | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator:-"@"}#")")"
485
537
 
486
538
  if [[ -n "$original_version" ]]; then
487
539
 
@@ -505,19 +557,24 @@ mkdir -p "${rvm_bin_path:-"$rvm_path/bin"}"
505
557
  files=(rvm rvmsudo rvm-shell rvm-auto-ruby)
506
558
  for file in "${files[@]}" ; do
507
559
 
508
- [[ -s "${rvm_bin_path:-"$rvm_path/bin"}/$file" ]] && chmod +x "${rvm_bin_path:-"$rvm_path/bin"}/$file"
560
+ if [[ -s "${rvm_bin_path:-"$rvm_path/bin"}/$file" ]] ; then
561
+
562
+ chmod +x "${rvm_bin_path:-"$rvm_path/bin"}/$file"
563
+
564
+ fi
509
565
 
510
566
  done
511
567
 
512
568
  printf "\n Copying manpages into place."
513
569
 
514
- files=($(builtin cd "$install_source_path/man" ; find . -maxdepth 1 -mindepth 1 -type f -print))
570
+ files=($(builtin cd "$install_source_path/man" ; \
571
+ find . -maxdepth 1 -mindepth 1 -type f -print))
515
572
 
516
573
  for file in "${files[@]//.\/}" ; do
517
574
 
518
- rm -rf "$rvm_man_path/$man_file"
575
+ rm -rf "$rvm_man_path/$file"
519
576
 
520
- cp -R "$install_source_path/man/$man_file" "$rvm_man_path/"
577
+ cp -R "$install_source_path/man/$file" "$rvm_man_path/"
521
578
 
522
579
  done
523
580
 
@@ -537,7 +594,7 @@ if [[ ${#files[@]} -gt 0 ]] ; then
537
594
  fi
538
595
 
539
596
  if [[ $upgrade_flag -eq 0 ]] ; then
540
- chmod +x ./script/notes # Sometimes things don't clone properly :/
597
+ chmod +x ./scripts/notes # Sometimes things don't clone properly :/
541
598
  ./scripts/notes
542
599
  fi
543
600
 
@@ -549,8 +606,6 @@ if [[ ${upgrade_flag:-0} -eq 1 ]] ; then
549
606
 
550
607
  check_rubyopt_conditions
551
608
 
552
- regenerate_wrappers
553
-
554
609
  printf "\nUpgrade of RVM in $rvm_path/ is complete.\n\n"
555
610
 
556
611
  else