rvm 1.0.9 → 1.0.10

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.
@@ -40,6 +40,15 @@ check_rubyopt_conditions() {
40
40
  fi
41
41
  }
42
42
 
43
+ # Regenerates a users wrappers as part of the update.
44
+ regenerate_wrappers() {
45
+ printf "\n"
46
+ if command -v __rvm_regenerate_wrappers >/dev/null; then
47
+ __rvm_regenerate_wrappers
48
+ fi
49
+ printf "\n"
50
+ }
51
+
43
52
  andand_return_instructions() {
44
53
  printf "
45
54
  This means that if you see something like:
@@ -493,6 +502,15 @@ for file in rvm rvmsudo rvm-shell rvm-auto-ruby ; do
493
502
 
494
503
  done
495
504
 
505
+ # Cleanup any .swp files that might have appeared.
506
+ files=($( find "$rvm_path/" -mindepth 1 -maxdepth 2 -iname '*.swp' -type f ))
507
+
508
+ for file in "${files[@]}" ; do
509
+
510
+ [[ -f "$file" ]] && rm -f "$file"
511
+
512
+ done
513
+
496
514
  printf "\n Copying manpages into place."
497
515
 
498
516
  files=($(builtin cd "$install_source_path/man" ; find . -maxdepth 1 -mindepth 1 -type f -print))
@@ -514,6 +532,8 @@ if [[ ${upgrade_flag:-0} -eq 1 ]] ; then
514
532
  upgrade_notes
515
533
 
516
534
  check_rubyopt_conditions
535
+
536
+ regenerate_wrappers
517
537
 
518
538
  printf "\nUpgrade of RVM in $rvm_path/ is complete.\n\n"
519
539
 
@@ -14,13 +14,16 @@ __rvm_setup() {
14
14
  }
15
15
 
16
16
  __rvm_teardown() {
17
+
17
18
  if [[ -n "${ZSH_VERSION:-""}" ]] ; then
18
19
 
19
- if [[ "$rvm_zsh_clobber" -eq 0 ]] ; then
20
+ if [[ ${rvm_zsh_clobber:-0} -eq 0 ]] ; then
20
21
 
21
22
  setopt noclobber
22
23
 
23
- fi ; unset rvm_zsh_clobber
24
+ fi
25
+
26
+ unset rvm_zsh_clobber
24
27
 
25
28
  else
26
29
  : # currently we are not doing any option setting for bash.
@@ -44,8 +47,7 @@ __rvm_teardown() {
44
47
 
45
48
  fi
46
49
 
47
- unset rvm_ruby_strings rvm_head_flag rvm_prior_cc next_token rvm_bin_path rvm_error_message rvm_gems_cache_path rvm_gems_path rvm_gemset_name rvm_interactive_flag rvm_man_path rvm_parse_break rvm_rc_files rvm_ruby_binary rvm_ruby_gem_home rvm_ruby_gem_path rvm_ruby_home rvm_ruby_interpreter rvm_ruby_irbrc rvm_ruby_log_path rvm_ruby_major_version rvm_ruby_minor_version rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_release_version rvm_ruby_repo_url rvm_ruby_revision rvm_ruby_selected_flag rvm_ruby_string rvm_ruby_tag rvm_ruby_version rvm_selfcontained rvm_token
48
-
50
+ unset rvm_ruby_strings rvm_head_flag rvm_prior_cc next_token rvm_bin_path rvm_error_message rvm_gems_cache_path rvm_gems_path rvm_gemset_name rvm_interactive_flag rvm_man_path rvm_parse_break rvm_rc_files rvm_ruby_binary rvm_ruby_gem_home rvm_ruby_gem_path rvm_ruby_home rvm_ruby_interpreter rvm_ruby_irbrc rvm_ruby_log_path rvm_ruby_major_version rvm_ruby_minor_version rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_release_version rvm_ruby_repo_url rvm_ruby_revision rvm_ruby_selected_flag rvm_ruby_tag rvm_ruby_version rvm_selfcontained rvm_token rvm_ruby_load_path rvm_path_flag rvm_ruby_require rvm_project_rvmrc_default rvm_action
49
51
 
50
52
  [[ ${rvm_dump_environment_flag:-0} -eq 1 ]] && __rvm_dump_environment
51
53
 
@@ -248,8 +250,8 @@ __rvm_run() {
248
250
 
249
251
  log="$path/$name.log"
250
252
 
251
- if [[ ! -d "$path" ]] ; then
252
- \mkdir -p "$path"
253
+ if [[ ! -d "${log%\/*}" ]] ; then
254
+ \mkdir -p "${log%\/*}"
253
255
  fi
254
256
 
255
257
  \touch "$log" "${log/%.log/.error.log}" # for zsh :(
@@ -405,18 +407,22 @@ __rvm_ensure_has_18_compat_ruby() {
405
407
  # Cleans up temp folders for a given prefix ($1),
406
408
  # typically the current process id.
407
409
  __rvm_cleanup_temp_for() {
410
+
408
411
  result=$? # Capture last command status
409
412
 
410
413
  [[ -z "${1:-""}" ]] && return 1
411
414
 
412
415
  if [[ -d "${rvm_tmp_path:-"$rvm_path/tmp"}/" ]]; then
416
+
413
417
  \rm -rf "${rvm_tmp_path:-"$rvm_path/tmp"}/$1"* >/dev/null 2>&1
418
+
414
419
  fi
415
420
 
416
421
  return $result
417
422
  }
418
423
 
419
424
  __rvm_set_rvmrc() {
425
+
420
426
  local flags
421
427
 
422
428
  if [[ "$HOME" != "$PWD" ]] ; then
@@ -436,7 +442,13 @@ __rvm_set_rvmrc() {
436
442
 
437
443
  local identifier=$(__rvm_environment_identifier)
438
444
 
439
- printf "if [[ -n \"\$rvm_path/environments\" && -s \"\$rvm_path/environments/$identifier\" ]] ; then\n \\. \"\$rvm_path/environments/$identifier\"\nelse\n rvm --create $flags \"$identifier\"\nfi" >> .rvmrc
445
+ printf "
446
+ if [[ -d \"\$rvm_path/environments\" && -s \"\$rvm_path/environments/$identifier\" ]] ; then
447
+ \\. \"\$rvm_path/environments/$identifier\"
448
+ else
449
+ rvm --create $flags \"$identifier\"
450
+ fi
451
+ " >> .rvmrc
440
452
 
441
453
  else
442
454
  "$rvm_path/scripts/log" "error" \
@@ -550,10 +562,17 @@ __rvm_conditionally_add_bin_path() {
550
562
 
551
563
  if echo "${PATH//:/ }" | \grep -vqF "${rvm_bin_path:-"$rvm_path/bin"} " ; then
552
564
 
553
- PATH="${rvm_bin_path:-"$rvm_path/bin"}:$PATH"
565
+ if [[ "${rvm_ruby_string:-"system"}" != "system" ]] ; then
554
566
 
555
- builtin hash -r
567
+ PATH="${rvm_bin_path:-"$rvm_path/bin"}:$PATH"
568
+
569
+ else
556
570
 
571
+ PATH="$PATH:${rvm_bin_path:-"$rvm_path/bin"}"
572
+
573
+ fi
574
+
575
+ builtin hash -r
557
576
  fi
558
577
 
559
578
  return 0
@@ -906,11 +925,11 @@ __rvm_become() {
906
925
  }
907
926
 
908
927
  __rvm_ensure_has_environment_files() {
909
- local environment_identifier file_name directory_name wrapper_identifier variable value
928
+ local environment_id file_name directory_name wrapper_identifier variable value
910
929
 
911
- environment_identifier="$(__rvm_environment_identifier)"
930
+ environment_id="$(__rvm_environment_identifier)"
912
931
 
913
- file_name="${rvm_path}/environments/$environment_identifier"
932
+ file_name="${rvm_path}/environments/$environment_id"
914
933
 
915
934
  if [[ ! -s "$file_name" ]] ; then
916
935
 
@@ -918,7 +937,7 @@ __rvm_ensure_has_environment_files() {
918
937
 
919
938
  echo "export PATH=\"${rvm_ruby_gem_home}/bin:${rvm_ruby_global_gems_path}/bin:${rvm_ruby_home}/bin:${rvm_bin_path:-"$rvm_path/bin"}:\$PATH\"" > "$file_name"
920
939
 
921
- for variable in RUBY_VERSION GEM_HOME GEM_PATH BUNDLE_PATH MY_RUBY_HOME IRBRC rvm_ruby_string rvm_gemset_name MAGLEV_HOME ; do
940
+ for variable in rvm_path RUBY_VERSION GEM_HOME GEM_PATH BUNDLE_PATH MY_RUBY_HOME IRBRC rvm_ruby_string rvm_gemset_name MAGLEV_HOME ; do
922
941
 
923
942
  eval "export $variable"
924
943
  eval "value=\${${variable}:-""}"
@@ -933,12 +952,12 @@ __rvm_ensure_has_environment_files() {
933
952
  fi
934
953
 
935
954
  # Next, ensure we have default wrapper files. Also, prevent it from recursing.
936
- if [[ ${rvm_creating_default_wrappers:-0} -eq 1 ]]; then
955
+ if [[ ${rvm_create_default_wrappers:-0} -eq 1 || ! -f "$rvm_path/wrappers/$environment_id/ruby" ]] ; then
937
956
 
938
957
  # We need to generate wrappers for both the default gemset and the global gemset.
939
- for wrapper_identifier in "$environment_identifier" "${environment_identifier}@global" ; do
958
+ for wrapper_identifier in "$environment_id" "${environment_id//@*/}@global" ; do
940
959
 
941
- rvm_creating_default_wrappers=1
960
+ rvm_create_default_wrappers=1
942
961
 
943
962
  directory_name="$rvm_path/wrappers/$wrapper_identifier"
944
963
 
@@ -947,8 +966,10 @@ __rvm_ensure_has_environment_files() {
947
966
 
948
967
  "$rvm_path/scripts/wrapper" "$wrapper_identifier" &> /dev/null
949
968
  fi
950
- rvm_creating_default_wrappers=0
969
+
951
970
  done
971
+
972
+ rvm_create_default_wrappers=0
952
973
  fi
953
974
 
954
975
  return 0
@@ -1290,41 +1311,70 @@ __rvm_environment_identifier() {
1290
1311
  string="${path//*gems\//}"
1291
1312
  string="${string//\/*/}"
1292
1313
 
1293
- echo "${string:-system}"
1314
+ printf "${string:-system}"
1294
1315
 
1295
1316
  return $?
1296
1317
  }
1297
1318
 
1298
1319
  __rvm_expand_ruby_string() {
1299
1320
 
1300
- local string="$1"
1321
+ local string current_ruby
1322
+
1323
+ string="$1"
1324
+
1325
+ if [[ -z "$string" ]] ; then
1301
1326
 
1302
- if [[ -z "$string" || "$string" = "all" ]]; then
1303
1327
  "$rvm_path/scripts/list" strings | tr ' ' "\n"
1304
1328
 
1305
- elif [[ "$string" = "all-gemsets" ]]; then
1306
- "$rvm_path/scripts/list" gemsets strings
1329
+ return $?
1307
1330
 
1308
- elif [[ "$string" = "default-with-rvmrc" || "$string" = "rvmrc" ]]; then
1309
- "$rvm_path/scripts/tools" path-identifier "$PWD"
1331
+ fi
1310
1332
 
1311
- elif [[ "$string" == "all-rubies" || "$string" = "rubies" ]]; then
1312
- "$rvm_path/scripts/list" rubies strings
1333
+ case "$string" in
1313
1334
 
1314
- elif [[ "$string" == "current-ruby" || "$string" = "gemsets" ]]; then
1315
- local current_ruby="$(__rvm_environment_identifier | awk -F"${rvm_gemset_separator:-"@"}" '{print $string}')"
1316
- rvm_silence_logging=1 "$rvm_path/scripts/gemsets" list | sed "s/^/$current_ruby${rvm_gemset_separator:-"@"}/"
1335
+ all)
1336
+ "$rvm_path/scripts/list" strings | tr ' ' "\n"
1337
+ ;;
1317
1338
 
1318
- elif [[ "$string" = "current" ]]; then
1319
- __rvm_environment_identifier
1339
+ all-gemsets)
1340
+ "$rvm_path/scripts/list" gemsets strings
1341
+ ;;
1320
1342
 
1321
- elif [[ "$string" = "aliases" ]]; then
1322
- awk -F= '{print $string}' < "$rvm_path/config/alias"
1343
+ default-with-rvmrc|rvmrc)
1344
+ "$rvm_path/scripts/tools" path-identifier "$PWD"
1345
+ ;;
1323
1346
 
1324
- else
1347
+ all-rubies|rubies)
1348
+ "$rvm_path/scripts/list" rubies strings
1349
+ ;;
1350
+
1351
+ current-ruby|gemsets)
1352
+ current_ruby="$(__rvm_environment_identifier | awk -F"${rvm_gemset_separator:-"@"}" '{print $string}')"
1353
+
1354
+ rvm_silence_logging=1 "$rvm_path/scripts/gemsets" list | sed "s/^/$current_ruby${rvm_gemset_separator:-"@"}/"
1355
+ ;;
1356
+
1357
+ current)
1358
+ __rvm_environment_identifier
1359
+ ;;
1360
+
1361
+ aliases)
1362
+ awk -F= '{print $string}' < "$rvm_path/config/alias"
1363
+ ;;
1364
+
1365
+ *)
1366
+ echo "$string" | tr "," "\n" | __rvm_strip
1367
+ ;;
1368
+
1369
+ esac
1325
1370
 
1326
- echo "$string" | tr "," "\n" | __rvm_strip
1327
- fi
1328
1371
  return $?
1329
1372
  }
1330
1373
 
1374
+ __rvm_regenerate_wrappers() {
1375
+ echo "Regenerating all wrappers..."
1376
+ while read -r wrapper_ruby_name; do
1377
+ __rvm_run "wrappers.regenerate" "\"$rvm_path/scripts/wrapper\" '$wrapper_ruby_name'"
1378
+ done < <(rvm list gemsets strings)
1379
+ unset wrapper_ruby_name
1380
+ }
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  default_flag="$rvm_default_flag"
4
+ rvm_bin_path="${rvm_bin_path:-"$rvm_path/bin"}"
4
5
 
5
6
  # Prevent recursion
6
7
  unset rvm_default_flag rvm_wrapper_name prefix
@@ -18,26 +19,31 @@ usage() {
18
19
  ruby, gem, rake, irb, rdoc, ri, testrb
19
20
 
20
21
  For more information, see 'rvm help wrapper'
21
- "
22
- }
23
22
 
24
- full_binary_name() {
25
- echo "$binary_name" | __rvm_strip
23
+ "
26
24
  }
27
25
 
28
26
  wrap() {
27
+
29
28
  if [[ -n "${file_name:-""}" ]] ;then
29
+
30
30
  mkdir -p "$(dirname "$file_name")"
31
31
 
32
32
  rm -f "$file_name"
33
33
 
34
+ if [[ "root" = "$USER" ]] ; then
35
+ path="${rvm_path:-"/usr/local/rvm"}"
36
+ else
37
+ path="\$HOME/.rvm"
38
+ fi
39
+
34
40
  printf "#!/usr/bin/env bash
35
41
 
36
- if [[ -s \"$rvm_path/environments/${environment_identifier}\" ]] ; then
37
- \\. \"$rvm_path/environments/${environment_identifier}\"
42
+ if [[ -s \"$path/environments/${environment_identifier}\" ]] ; then
43
+ \\. \"$path/environments/${environment_identifier}\"
38
44
  exec $binary_name \"\$@\"
39
45
  else
40
- echo \"ERROR: Missing RVM environment file: '$rvm_path/environments/${environment_identifier}'\"
46
+ echo \"ERROR: Missing RVM environment file: '$path/environments/${environment_identifier}'\"
41
47
  exit 1
42
48
  fi
43
49
  " > "$file_name"
@@ -45,9 +51,13 @@ fi
45
51
  if [[ -f "$file_name" ]] ; then chmod +x "$file_name" ; fi
46
52
 
47
53
  return 0
54
+
48
55
  else
56
+
49
57
  "$rvm_path/scripts/log" "error" "wrap() : file_name unset variable."
58
+
50
59
  return 1
60
+
51
61
  fi
52
62
  }
53
63
 
@@ -57,9 +67,9 @@ symlink_binary() {
57
67
  # we then symlink it into place.
58
68
  if wrap_binary && [[ -f "$file_name" ]]; then
59
69
 
60
- rm -f "${rvm_bin_path:-"$rvm_path/bin"}/${prefix}_${binary_name}"
70
+ rm -f "$rvm_bin_path/${prefix}_${binary_name}"
61
71
 
62
- ln -fs "$file_name" "${rvm_bin_path:-"$rvm_path/bin"}/${prefix}_${binary_name}"
72
+ ln -fs "$file_name" "$rvm_bin_path/${prefix}_${binary_name}"
63
73
 
64
74
  fi
65
75
  }
@@ -114,6 +124,12 @@ for binary_name in "${binaries[@]}"; do
114
124
 
115
125
  file_name="$rvm_path/wrappers/${environment_identifier}/${binary_name}"
116
126
 
127
+ if [[ ${rvm_default_flag:-0} -gt 0 ]] ; then
128
+
129
+ prefix="default"
130
+
131
+ fi
132
+
117
133
  if [[ -z "$prefix" ]] ; then
118
134
 
119
135
  override_check=1
@@ -125,11 +141,11 @@ for binary_name in "${binaries[@]}"; do
125
141
 
126
142
  if [[ "$binary_name" == "ruby" ]] ; then
127
143
 
128
- destination="${rvm_bin_path:-"$rvm_path/bin"}/$environment_identifier"
144
+ destination="$rvm_bin_path/$environment_identifier"
129
145
 
130
146
  else
131
147
 
132
- destination="${rvm_bin_path:-"$rvm_path/bin"}/${binary_name}-${environment_identifier}"
148
+ destination="$rvm_bin_path/${binary_name}-${environment_identifier}"
133
149
 
134
150
  fi
135
151
 
@@ -139,6 +155,7 @@ for binary_name in "${binaries[@]}"; do
139
155
 
140
156
  fi; unset destination
141
157
 
158
+
142
159
  elif [[ "$prefix" == "--no-prefix" ]]; then
143
160
 
144
161
  override_check=1
@@ -147,18 +164,24 @@ for binary_name in "${binaries[@]}"; do
147
164
 
148
165
  if [[ -f "$file_name" ]]; then
149
166
 
150
- destination="${rvm_bin_path:-"$rvm_path/bin"}/$binary_name"
167
+ destination="$rvm_bin_path/$binary_name"
151
168
 
152
169
  if [[ -s "$destination" ]] ; then
170
+
153
171
  rm -rf "$destination"
172
+
154
173
  fi
155
174
 
156
175
  ln -nsf "$file_name" "$destination"
157
- fi ; unset destination
176
+ fi
158
177
 
159
178
  else
179
+
160
180
  symlink_binary
181
+
161
182
  fi
183
+
184
+
162
185
  done
163
186
 
164
187
  exit $?
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: 5
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 9
10
- version: 1.0.9
9
+ - 10
10
+ version: 1.0.10
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-09-15 00:00:00 -04:00
18
+ date: 2010-09-18 00:00:00 -04:00
19
19
  default_executable: rvm-install
20
20
  dependencies: []
21
21
 
@@ -42,6 +42,7 @@ files:
42
42
  - config/md5
43
43
  - contrib/gemset_snapshot
44
44
  - contrib/install-system-wide
45
+ - contrib/r
45
46
  - examples/rvmrc
46
47
  - gemsets/default.gems
47
48
  - gemsets/global.gems
@@ -102,6 +103,7 @@ files:
102
103
  - lib/rvm/install_command_dumper.rb
103
104
  - lib/rvm/shell.rb
104
105
  - lib/rvm/shell/abstract_wrapper.rb
106
+ - lib/rvm/shell/calculate_rvm_path.sh
105
107
  - lib/rvm/shell/result.rb
106
108
  - lib/rvm/shell/shell_wrapper.sh
107
109
  - lib/rvm/shell/single_shot_wrapper.rb