rvm 0.1.44 → 0.1.45

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.
@@ -3,7 +3,7 @@
3
3
  if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; fi
4
4
 
5
5
  system="$(uname -s)"
6
- if [[ $system = "SunOS" ]] && [[ "$(uname -m)" = "i86pc" ]] ; then OS="Solaris-x86" ; fi
6
+ if [[ $system = "SunOS" ]] && [[ "$(uname -m)" = "i86pc" ]] ; then system="Solaris-x86" ; fi
7
7
  version="MagLev-${1}.${system}"
8
8
  gsname="GemStone-${1}.${system}"
9
9
  zipfile=${version}.zip
@@ -716,6 +716,11 @@ __rvm_fetch_from_github() {
716
716
  rm -rf "$rvm_ruby_repo_path"
717
717
  builtin cd "$rvm_home"
718
718
  __rvm_run "$1.repo" "git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_repo_path" "Cloning $rvm_ruby_repo_url"
719
+ result=$? ; if [[ "$result" -gt 0 ]] ; then
720
+ rvm_ruby_repo_http_url="$(echo $rvm_ruby_repo_url | sed -e 's/git:/http:/')"
721
+ $rvm_scripts_path/log "info" "Could not fetch $rvm_ruby_repo_url - trying $rvm_ruby_repo_http_url"
722
+ __rvm_run "$1.repo" "git clone --depth 1 $rvm_ruby_repo_http_url $rvm_ruby_repo_path" "Cloning $rvm_ruby_repo_http_url"
723
+ fi
719
724
  else
720
725
  local branch="${2:-"master"}"
721
726
  builtin cd "$rvm_ruby_repo_path"
@@ -803,10 +808,15 @@ __rvm_fetch_ruby() {
803
808
  fi
804
809
  else
805
810
  rm -rf "$rvm_ruby_repo_path"
811
+ rvm_ruby_repo_http_url="$(echo $rvm_ruby_repo_url | sed -e 's/git:/http:/')"
806
812
  $rvm_scripts_path/log "info" "Cloning from $rvm_ruby_repo_url, this may take a while depending on your connection..."
807
813
  git clone --depth 1 "$rvm_ruby_repo_url" "$rvm_ruby_repo_path"
808
814
  result=$? ; if [[ "$result" -gt 0 ]] ; then
809
- $rvm_scripts_path/log "error" "There has been an error while trying to fetch the repository. Aborting the installation." ; __rvm_pushpop ; return $result
815
+ $rvm_scripts_path/log "info" "cloning from $rvm_ruby_repo_url failed, now attempting to clone from $rvm_ruby_repo_http_url, this may take a while depending on your connection..."
816
+ git clone "$rvm_ruby_repo_http_url" "$rvm_ruby_repo_path"
817
+ result=$? ; if [[ "$result" -gt 0 ]] ; then
818
+ $rvm_scripts_path/log "error" "There has been an error while trying to fetch the repository. Aborting the installation." ; __rvm_pushpop ; return $result
819
+ fi
810
820
  fi
811
821
  fi
812
822
  else
@@ -1005,11 +1015,11 @@ __rvm_post_install() {
1005
1015
 
1006
1016
  if [[ -n "$rvm_ruby_aliases" ]]; then
1007
1017
  $rvm_scripts_path/log "info" "Setting up aliases for $rvm_ruby_string"
1008
- for ruby_alias in $rvm_ruby_aliases; do
1018
+ while read -r ruby_alias; do
1009
1019
  $rvm_scripts_path/log info "Aliasing $rvm_ruby_string to $ruby_alias"
1010
1020
  $rvm_scripts_path/alias delete "$ruby_alias" > /dev/null 2>&1
1011
1021
  $rvm_scripts_path/alias create "$ruby_alias" "$rvm_ruby_string" > /dev/null 2>&1
1012
- done
1022
+ done < <(echo "$rvm_ruby_string" | \tr ' ' '\n' | sort -u)
1013
1023
  unset rvm_ruby_aliases ruby_alias
1014
1024
  fi
1015
1025
  }
@@ -0,0 +1,117 @@
1
+ #!/usr/bin/env bash
2
+
3
+ unset GREP_OPTIONS
4
+
5
+ source "$rvm_scripts_path/base"
6
+
7
+ usage() {
8
+ echo "Usage: rvm migrate from to" >&2
9
+ echo "Moves all gemsets from one ruby to another." >&2
10
+ exit 1
11
+ }
12
+
13
+ confirm() {
14
+ printf "$1 (Y/n): "
15
+ local confirmation_response
16
+ read -r confirmation_response
17
+ [[ -z "$confirmation_response" ]] || echo "$confirmation_response" | grep -qi '^y'
18
+ }
19
+
20
+ die_with_error() {
21
+ $rvm_scripts_path/log "fail" "$1"
22
+ exit "${2:-1}"
23
+ }
24
+
25
+ expand_ruby_name() {
26
+ $rvm_scripts_path/tools strings "$1" | awk -F"$rvm_gemset_separator" '{print $1}'
27
+ }
28
+
29
+ migrate_rubies() {
30
+ expanded_source="$(expand_ruby_name "$source_ruby")"
31
+ expanded_destination="$(expand_ruby_name "$destination_ruby")"
32
+
33
+ if [[ -z "$expanded_source" ]]; then
34
+ die_with_error "Could not expand source ruby '$source_ruby'"
35
+ elif [[ -z "$expanded_destination" ]]; then
36
+ die_with_error "Could not expand destination ruby '$destination_ruby'"
37
+ elif [[ "$expanded_destination" = "$expanded_source" ]]; then
38
+ die_with_error "Source and Destination Ruby are the same ($expanded_destination)"
39
+ elif [[ ! -d "$rvm_rubies_path/$expanded_source" ]]; then
40
+ die_with_error "Ruby '$expanded_source' is not installed - please install it first."
41
+ elif [[ ! -d "$rvm_rubies_path/$expanded_destination" ]]; then
42
+ die_with_error "Ruby '$expanded_destination' is not installed - please install it first."
43
+ fi
44
+
45
+ echo "Are you sure you wish to MOVE gems from $expanded_source to $expanded_destination?"
46
+ confirm "This will overwrite existing gems in $expanded_destination and remove them from $expanded_source" || return 1
47
+
48
+ echo "Moving gemsets..."
49
+
50
+ while read -r origin_gemset; do
51
+ [[ "$origin_gemset" = "$expanded_source" || "$origin_gemset" = "$expanded_source$rvm_gemset_separator"* ]] || continue
52
+ gemset_name="$(echo "$origin_gemset" | awk -F"$rvm_gemset_separator" '{print $2}')"
53
+ destination_gemset="$expanded_destination"
54
+ if [[ -n "$gemset_name" ]]; then
55
+ destination_gemset="$destination_gemset$rvm_gemset_separator$gemset_name"
56
+ fi
57
+ echo "Moving $origin_gemset to $destination_gemset"
58
+
59
+ rm -rf "$rvm_gems_path/$destination_gemset"
60
+ result="$?"
61
+ [[ "$result" -gt "0" ]] && die_with_error "Unable to remove gem directory '$rvm_gems_path/$destination_gemset'" "$result"
62
+
63
+ mv "$rvm_gems_path/$origin_gemset" "$rvm_gems_path/$destination_gemset"
64
+ result="$?"
65
+ [[ "$result" -gt "0" ]] && die_with_error "Unable to move '$rvm_gems_path/$origin_gemset' to '$rvm_gems_path/$destination_gemset'" "$result"
66
+
67
+
68
+ echo "Making gemset $destination_gemset pristine."
69
+ __rvm_run_with_env "gemset.pristine" "$destination_gemset" "rvm gemset pristine"
70
+ done < <($rvm_scripts_path/list gemsets strings | grep "^$expanded_source")
71
+ unset origin_gemset destination_gemset gemset_name
72
+
73
+ if confirm 'Do you wish to move over aliases?' ; then
74
+ while read -r alias_pair; do
75
+ migrate_ruby_name="$(echo "$alias_pair" | awk -F= '{print $2}')"
76
+ migrate_alias_name="$(echo "$alias_pair" | awk -F= '{print $1}')"
77
+ if [[ "$migrate_ruby_name" = "$expanded_source" || "$migrate_ruby_name" = "$expanded_source$rvm_gemset_separator"* ]]; then
78
+ migrate_new_alias_name="${migrate_ruby_name/$expanded_source/$expanded_destination}"
79
+ echo "Updating alias $migrate_alias_name to point to $migrate_new_alias_name"
80
+ $rvm_scripts_path/alias delete "$migrate_alias_name" >/dev/null 2>&1
81
+ $rvm_scripts_path/alias create "$migrate_alias_name" "$migrate_new_alias_name" >/dev/null 2>&1
82
+ fi
83
+ done < "$rvm_config_path/alias"
84
+ unset migrate_ruby_name migrate_alias_name migrate_new_alias_name
85
+ fi
86
+
87
+ if confirm "Do you wish to move over wrappers?" ; then
88
+ origin_wrappers_path="$rvm_wrappers_path/$expanded_source"
89
+ for binary_name in $(\ls $rvm_bin_path) ; do
90
+ full_bin_path="$rvm_bin_path/$binary_name"
91
+ [[ ! -L "$full_bin_path" ]] && continue
92
+ expanded_symlink="$(readlink "$full_bin_path")"
93
+ [[ "$expanded_symlink" != "$origin_wrappers_path/"* ]] && continue
94
+ linked_binary_name="$(basename "$expanded_symlink")"
95
+ [[ "$binary_name" = "$linked_binary_name-$expanded_source" || "$binary_name" = "$expanded_source" ]] && continue
96
+ new_wrapper_destination="${expanded_symlink/$expanded_source/$expanded_destination}"
97
+ ln -sf "$new_wrapper_destination" "$full_bin_path"
98
+ done
99
+ unset origin_wrappers_path full_bin_path expanded_symlink linked_binary_name new_wrapper_destination
100
+ fi
101
+
102
+ if confirm "Do you also wish to completely remove $expanded_source (inc. archive)?" ; then
103
+ __rvm_run_with_env "rvm.remove" "$expanded_source" "rvm remove $expanded_source --archive --gems"
104
+ fi
105
+
106
+ echo "Successfully migrated $expanded_source to $expanded_destination"
107
+
108
+ }
109
+
110
+ if [[ -z "$1" || "$#" != 2 ]]; then
111
+ usage
112
+ fi
113
+
114
+ source_ruby="$1"; shift
115
+ destination_ruby="$1"; shift
116
+
117
+ migrate_rubies
@@ -27,7 +27,7 @@ repair_environments() {
27
27
  [[ -L "$rvm_environments_path/$environment_name" ]] && continue
28
28
  $rvm_scripts_path/log "info" "Regenerating environment file for '$environment_name'"
29
29
  [[ -f "$rvm_environments_path/$environment_name" ]] && rm -f "$rvm_environments_path/$environment_name"
30
- (source "$rvm_scripts_path/base"; __rvm_become "$environment_name"; __rvm_ensure_has_enviroment_files)
30
+ (source "$rvm_scripts_path/base"; __rvm_become "$environment_name"; __rvm_ensure_has_environment_files)
31
31
  done; unset environment_name
32
32
  }
33
33
 
@@ -23,60 +23,44 @@ if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
23
23
  fi
24
24
 
25
25
  # Set the default sandboxed value.
26
- if [[ -z "$rvm_sandboxed" ]]; then
26
+ if [[ -z "$rvm_selfcontained" ]]; then
27
27
  if [[ "root" = "$(whoami)" ]] || [[ -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
28
- rvm_sandboxed=0
28
+ rvm_selfcontained=0
29
29
  else
30
- rvm_sandboxed=1
30
+ rvm_selfcontained=1
31
31
  fi
32
32
  fi
33
33
 
34
34
  if [[ -z "$rvm_prefix" ]] ; then
35
- if [[ "$rvm_sandboxed" = "0" ]] ; then
36
- rvm_prefix="/usr/local"
35
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
36
+ rvm_prefix="/usr/local/"
37
37
  else
38
38
  rvm_prefix="$HOME/."
39
39
  fi
40
40
  fi
41
41
 
42
- if [[ -z "$rvm_path" ]] ; then
43
- unset rvm_path
44
- if [[ "$rvm_sandboxed" = "0" ]] ; then
45
- rvm_path="$rvm_prefix/rvm"
46
- else
47
- if [[ -d "$HOME/.rvm" ]] && [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
48
- rvm_path="$HOME/.rvm"
49
- elif [[ -d "$rvm_prefix/rvm" ]] && [[ -s "$rvm_prefix/rvm/scripts/rvm" ]] ; then
50
- rvm_path="$rvm_prefix/rvm"
51
- else
52
- rvm_path="$HOME/.rvm"
53
- fi
54
- fi
42
+ # Fix rvm_prefix changes.
43
+ echo "$rvm_prefix" | grep -vq '\(\/\|\.\)$' && [[ -d "$rvm_prefix/rvm/scripts" ]]
44
+ rvm_prefix_needs_trailing_slash="$?"
45
+ if [[ "$rvm_prefix" = "/usr/local" || "$rvm_prefix_needs_trailing_slash" = "0" ]]; then
46
+ rvm_prefix="$rvm_prefix/"
55
47
  fi
48
+ unset rvm_prefix_needs_trailing_slash
56
49
 
57
- if [[ -z "$rvm_scripts_path" ]] || [[ ! -d "$rvm_scripts_path" ]] ; then
58
- if [[ -d "$HOME/.rvm/scripts" ]] && [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
59
- rvm_scripts_path="$HOME/.rvm/scripts"
60
- elif [[ -d "$rvm_path/scripts" ]] && [[ -s "$rvm_path/scripts/rvm" ]]; then
61
- rvm_scripts_path="$rvm_path/scripts"
62
- else
63
- if [[ "$rvm_sandboxed" = "0" ]] ; then
64
- rvm_scripts_path="/usr/local/rvm"
65
- else
66
- rvm_scripts_path="$HOME/.rvm"
67
- fi
68
- fi
50
+ if [[ -z "$rvm_path" ]] ; then
51
+ rvm_path="${rvm_prefix}rvm"
69
52
  fi
53
+ rvm_scripts_path="${rvm_scripts_path:-"$rvm_path/scripts"}"
70
54
 
71
55
  if [[ -d "$rvm_path" ]] ; then
72
- source $rvm_scripts_path/array
73
- source $rvm_scripts_path/utility
74
- source $rvm_scripts_path/initialize
75
- source $rvm_scripts_path/version
76
- source $rvm_scripts_path/selector
77
- source $rvm_scripts_path/cli
78
- source $rvm_scripts_path/manpages
79
- source $rvm_scripts_path/cd
56
+ source "$rvm_scripts_path/array"
57
+ source "$rvm_scripts_path/utility"
58
+ source "$rvm_scripts_path/initialize"
59
+ source "$rvm_scripts_path/version"
60
+ source "$rvm_scripts_path/selector"
61
+ source "$rvm_scripts_path/cli"
62
+ source "$rvm_scripts_path/manpages"
63
+ source "$rvm_scripts_path/cd"
80
64
 
81
65
  rvm_loaded_flag=1
82
66
 
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- if [[ -z "$rvm_sandboxed" ]]; then
3
+ if [[ -z "$rvm_selfcontained" ]]; then
4
4
  if [[ "root" = "$(whoami)" ]] || [[ -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
5
- export rvm_sandboxed=0
5
+ export rvm_selfcontained=0
6
6
  else
7
- export rvm_sandboxed=1
7
+ export rvm_selfcontained=1
8
8
  fi
9
9
  fi
10
10
 
@@ -61,7 +61,7 @@ done
61
61
 
62
62
  if [[ -z "$rvm_prefix" ]] ; then
63
63
  __rvm_load_rvmrc
64
- if [[ "$rvm_sandboxed" = "0" ]] ; then
64
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
65
65
  rvm_prefix="${rvm_prefix:-"/usr/local/"}"
66
66
  else
67
67
  rvm_prefix="${rvm_prefix:-"$HOME/."}"
@@ -95,10 +95,14 @@ rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
95
95
  rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
96
96
  rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
97
97
 
98
- if [[ -z "$rvm_prefix" ]] && [[ "root" = "$(whoami)" ]] ; then
99
- rvm_bin_path="${rvm_bin_path:-"/usr/local/bin"}"
98
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
99
+ rvm_bin_path="${rvm_bin_path:-"$rvm_prefix/bin"}"
100
+ rvm_man_path="${rvm_man_path:-"$rvm_prefix/share/man"}"
101
+ rvm_rc_files="${rvm_rc_files:-"/etc/profile /etc/zshenv"}"
100
102
  else
103
+ rvm_man_path="${rvm_man_path:-"$rvm_path/man"}"
101
104
  rvm_bin_path="${rvm_bin_path:-"$rvm_path/bin"}"
105
+ rvm_rc_files="${rvm_rc_files:-"$HOME/.bash_profile $HOME/.bashrc $HOME/.zshenv"}"
102
106
  fi
103
107
 
104
108
  rvm_gems_path="${rvm_gems_path:-"$rvm_path/gems"}"
@@ -321,8 +325,8 @@ else
321
325
  printf "\n [[ -s \$HOME/.rvm/scripts/rvm ]] && source \$HOME/.rvm/scripts/rvm"
322
326
  printf "\n Please note that this must only occur once - so, you only need to add it the first time you install rvm."
323
327
  printf "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
324
- printf "\n This means that if you see '[ -z "\$PS1" ] && return' then you must change this line to:"
325
- printf "\n if [[ -n "\$PS1" ]] ; then"
328
+ printf "\n This means that if you see '[ -z \"\$PS1\" ] && return' then you must change this line to:"
329
+ printf "\n if [[ -n \"\$PS1\" ]] ; then"
326
330
  printf "\n ... original content that was below the && return line ..."
327
331
  printf "\n fi # <= be sure to close the if."
328
332
  printf "\n #EOF .bashrc"
@@ -331,10 +335,10 @@ else
331
335
  printf "\n placing all non-interactive items in the .bashrc, including the 'source' line above"
332
336
  printf "\n3) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
333
337
  fi
334
- if [[ -s $HOME/.bashrc ]] && grep -q '&& return' $HOME/.bashrc ; then
338
+ if [[ -s "$HOME/.bashrc" ]] && grep -q '&& return' "$HOME/.bashrc" ; then
335
339
  printf "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc."
336
- printf "\n This means that if you see '[ -z "\$PS1" ] && return' then you must change this line to:"
337
- printf "\n if [[ -n "\$PS1" ]] ; then"
340
+ printf "\n This means that if you see '[ -z \"\$PS1\" ] && return' then you must change this line to:"
341
+ printf "\n if [[ -n \"\$PS1\" ]] ; then"
338
342
  printf "\n ... original content that was below the && return line ..."
339
343
  printf "\n fi # <= be sure to close the if."
340
344
  printf "\n #EOF .bashrc"
@@ -219,7 +219,8 @@ __rvm_select() {
219
219
  }
220
220
 
221
221
  __rvm_use() {
222
- if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select $* ; fi
222
+
223
+ if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select "$@" ; fi
223
224
  if [[ -z "$rvm_ruby_interpreter" ]] ; then rvm_ruby_interpreter="system" ; fi
224
225
 
225
226
  if [[ "system" = "$rvm_ruby_interpreter" ]] ; then
@@ -237,7 +238,7 @@ __rvm_use() {
237
238
  fi
238
239
 
239
240
  # Check binaries, remove under the condition they're symlinks.
240
- if [[ "$rvm_sandboxed" = "0" ]] ; then
241
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
241
242
  for binary in ruby gem irb ri rdoc rake erb testrb ; do
242
243
  full_binary_path="$rvm_bin_path/$binary"
243
244
  [[ -L "$full_binary_path" ]] && rm -f "$full_binary_path"
@@ -273,7 +274,7 @@ __rvm_use() {
273
274
  fi
274
275
 
275
276
  # Ensure the environment file for the selected ruby exists.
276
- __rvm_ensure_has_enviroment_files
277
+ __rvm_ensure_has_environment_files
277
278
 
278
279
  if [[ ! -z "$rvm_verbose_flag" ]] ; then
279
280
  $rvm_scripts_path/log "info" "Using $(basename $GEM_HOME | \tr '-' ' ' | sed 's/'${rvm_gemset_separator}'/ with gemset /')"
@@ -284,15 +285,15 @@ __rvm_use() {
284
285
  fi
285
286
 
286
287
  # Export ruby string and gem set me for extrenal scripts to take advantage of them.
287
- if [[ ! -z "$rvm_ruby_string" ]] ; then export rvm_ruby_string ; fi
288
- if [[ ! -z "$rvm_gemset_name" ]] ; then export rvm_gemset_name ; fi
289
- if [[ ! -z "$new_path" ]] ; then export PATH="$new_path" ; unset new_path ; fi
290
- if [[ ! -z "$rvm_rvmrc_flag" ]] ; then __rvm_set_rvmrc ; fi
288
+ if [[ -n "$rvm_ruby_string" ]] ; then export rvm_ruby_string ; fi
289
+ if [[ -n "$rvm_gemset_name" ]] ; then export rvm_gemset_name ; fi
290
+ if [[ -n "$new_path" ]] ; then export PATH="$new_path" ; unset new_path ; fi
291
+ if [[ -n "$rvm_rvmrc_flag" ]] ; then __rvm_set_rvmrc ; fi
291
292
 
292
293
  environment_id="$(__rvm_environment_identifier)"
293
294
 
294
295
  if [[ ! -z "$rvm_default_flag" ]] && [[ "default" != "$rvm_ruby_interpreter" ]] ; then
295
- if [[ "$rvm_sandboxed" = "0" ]] ; then
296
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
296
297
  # Sets up the default wrappers.
297
298
  $rvm_scripts_path/wrapper "$rvm_ruby_string"
298
299
  fi
@@ -312,11 +313,18 @@ __rvm_use() {
312
313
  fi
313
314
  fi ; unset rvm_default_flag
314
315
 
315
- if [[ ! -z "$rvm_wrapper_name" ]] ; then
316
+ if [[ -n "$rvm_wrapper_name" ]] ; then
316
317
  $rvm_scripts_path/wrapper "$environment_id" "$rvm_wrapper_name" > /dev/null 2>&1
317
318
  unset rvm_wrapper_name
318
319
  fi
319
320
 
321
+ if [[ -n "$rvm_ruby_alias" ]]; then
322
+ $rvm_scripts_path/log "info" "Attempting to alias $environment_id to $rvm_ruby_alias"
323
+ $rvm_scripts_path/alias delete "$rvm_ruby_alias" > /dev/null 2>&1
324
+ rvm_alias_expanded=1 $rvm_scripts_path/alias create "$rvm_ruby_alias" "$environment_id" > /dev/null 2>&1
325
+ unset ruby_alias rvm_ruby_alias
326
+ fi
327
+
320
328
  unset environment_id
321
329
 
322
330
  if [[ "maglev" = "$rvm_ruby_interpreter" ]] ; then
@@ -352,10 +360,6 @@ __rvm_ruby_string() {
352
360
  fi
353
361
  fi
354
362
 
355
- # Preparation for alias tags
356
- rvm_ruby_alias=$(echo "$rvm_ruby_string" | awk -F+ '{print $2}')
357
- rvm_ruby_string=$(echo "$rvm_ruby_string" | awk -F+ '{print $1}')
358
-
359
363
  set_name=$(echo "$rvm_ruby_string" | awk -F${rvm_gemset_separator} '{print $2}')
360
364
  if [[ ! -z "$set_name" ]] ; then rvm_gemset_name="$set_name" ; fi
361
365
  ruby_string=$(echo "$rvm_ruby_string" | awk -F${rvm_gemset_separator} '{print $1}')
@@ -490,10 +494,6 @@ __rvm_gemset_select() {
490
494
 
491
495
  rvm_ruby_global_gems_path="$rvm_gems_path/${rvm_ruby_string}${rvm_gemset_separator}global"
492
496
 
493
- #if [[ -z "$(echo $rvm_ruby_gem_home | grep "$rvm_path")" ]] ; then
494
- # $rvm_scripts_path/log "warn" "Gemsets cannot be used with system ruby installs (yet)."
495
- #fi
496
-
497
497
  if [[ -z "$rvm_gemset_name" ]] ; then
498
498
  # No longer defaulting to 'sticky' gem sets.
499
499
  # Set 'rvm_sticky_flag=1' in ~/.rvmrc to enable.
@@ -570,9 +570,6 @@ __rvm_gemset_select() {
570
570
 
571
571
  # Use a gemset specified by 'rvm_ruby_gem_home'
572
572
  __rvm_gemset_use() {
573
- #if [[ -z "$(echo $rvm_ruby_gem_home | grep "rvm")" ]] ; then
574
- # $rvm_scripts_path/log "warn" "Gemsets cannot be used with system ruby installs (yet)."
575
- #fi
576
573
  if [[ -n "$rvm_ruby_gem_home" ]] ; then
577
574
  if [[ ! -d "$rvm_ruby_gem_home" ]] ; then
578
575
  if [[ "$rvm_gemset_create_on_use_flag" -eq 1 ]] || [[ "$rvm_create_flag" -eq 1 ]]; then
@@ -159,8 +159,7 @@ __rvm_json() {
159
159
 
160
160
  rubies=() ; successes=() ; errors=() ; statuses=()
161
161
 
162
- rvm_ruby_strings="${rvm_ruby_strings:-"$($rvm_scripts_path/list strings)"}"
163
- rvm_ruby_strings="$(echo "$rvm_ruby_strings" | \tr ',' ' ')"
162
+ rvm_ruby_strings="$(__rvm_expand_ruby_string "$rvm_ruby_strings")"
164
163
 
165
164
  # Check for a single ruby && exec if present.
166
165
  __rvm_attempt_single_exec
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- if [[ -z "$rvm_sandboxed" ]]; then
3
+ if [[ -z "$rvm_selfcontained" ]]; then
4
4
  if [[ "root" = "$(whoami)" ]] || [[ -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
5
- export rvm_sandboxed=0
5
+ export rvm_selfcontained=0
6
6
  else
7
- export rvm_sandboxed=1
7
+ export rvm_selfcontained=1
8
8
  fi
9
9
  fi
10
10
 
@@ -61,7 +61,7 @@ done
61
61
 
62
62
  if [[ -z "$rvm_prefix" ]] ; then
63
63
  __rvm_load_rvmrc
64
- if [[ "$rvm_sandboxed" = "0" ]] ; then
64
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
65
65
  rvm_prefix="${rvm_prefix:-"/usr/local/"}"
66
66
  else
67
67
  rvm_prefix="${rvm_prefix:-"$HOME/."}"
@@ -95,10 +95,14 @@ rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
95
95
  rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
96
96
  rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
97
97
 
98
- if [[ -z "$rvm_prefix" ]] && [[ "root" = "$(whoami)" ]] ; then
99
- rvm_bin_path="${rvm_bin_path:-"/usr/local/bin"}"
98
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
99
+ rvm_bin_path="${rvm_bin_path:-"$rvm_prefix/bin"}"
100
+ rvm_man_path="${rvm_man_path:-"$rvm_prefix/share/man"}"
101
+ rvm_rc_files="${rvm_rc_files:-"/etc/profile /etc/zshenv"}"
100
102
  else
103
+ rvm_man_path="${rvm_man_path:-"$rvm_path/man"}"
101
104
  rvm_bin_path="${rvm_bin_path:-"$rvm_path/bin"}"
105
+ rvm_rc_files="${rvm_rc_files:-"$HOME/.bash_profile $HOME/.bashrc $HOME/.zshenv"}"
102
106
  fi
103
107
 
104
108
  rvm_gems_path="${rvm_gems_path:-"$rvm_path/gems"}"
@@ -321,8 +325,8 @@ else
321
325
  printf "\n [[ -s \$HOME/.rvm/scripts/rvm ]] && source \$HOME/.rvm/scripts/rvm"
322
326
  printf "\n Please note that this must only occur once - so, you only need to add it the first time you install rvm."
323
327
  printf "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
324
- printf "\n This means that if you see '[ -z "\$PS1" ] && return' then you must change this line to:"
325
- printf "\n if [[ -n "\$PS1" ]] ; then"
328
+ printf "\n This means that if you see '[ -z \"\$PS1\" ] && return' then you must change this line to:"
329
+ printf "\n if [[ -n \"\$PS1\" ]] ; then"
326
330
  printf "\n ... original content that was below the && return line ..."
327
331
  printf "\n fi # <= be sure to close the if."
328
332
  printf "\n #EOF .bashrc"
@@ -331,10 +335,10 @@ else
331
335
  printf "\n placing all non-interactive items in the .bashrc, including the 'source' line above"
332
336
  printf "\n3) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
333
337
  fi
334
- if [[ -s $HOME/.bashrc ]] && grep -q '&& return' $HOME/.bashrc ; then
338
+ if [[ -s "$HOME/.bashrc" ]] && grep -q '&& return' "$HOME/.bashrc" ; then
335
339
  printf "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc."
336
- printf "\n This means that if you see '[ -z "\$PS1" ] && return' then you must change this line to:"
337
- printf "\n if [[ -n "\$PS1" ]] ; then"
340
+ printf "\n This means that if you see '[ -z \"\$PS1\" ] && return' then you must change this line to:"
341
+ printf "\n if [[ -n \"\$PS1\" ]] ; then"
338
342
  printf "\n ... original content that was below the && return line ..."
339
343
  printf "\n fi # <= be sure to close the if."
340
344
  printf "\n #EOF .bashrc"