rvm 1.0.4 → 1.0.5

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.
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env bash
2
+
3
+ source "$rvm_scripts_path/base"
4
+
5
+ rvm_ruby_gem_home="${rvm_ruby_gem_home:-$GEM_HOME}"
6
+
7
+ if [[ ! -d "$rvm_ruby_gem_home" ]] && command -v gem > /dev/null 2>&1; then rvm_ruby_gem_home="$(gem env home)" ; fi
8
+
9
+ usage() {
10
+ printf "
11
+
12
+ Usage:
13
+
14
+ rvm default [ruby] [environment_id]
15
+
16
+ Action:
17
+
18
+ {import,export,create,copy,empty,delete,name,dir,list,gemdir,install,pristine,clear,use,update,globalcache}
19
+
20
+ Description:
21
+
22
+ Commands for working with and manipulating gemsets within RVM.
23
+
24
+ Examples:
25
+ rvm default # *uses* the default ruby
26
+ rvm default 1.9.2 # Sets the 'global' default to 1.9.2
27
+ rvm default list 1.9.2 # displays the environment_id for the current 1.9.2 default
28
+ rvm default 1.9.2 1.9.2-p0 # sets the default for 'rvm 1.9.2' to p0
29
+ rvm default clear 1.9.2 # clears the set default for 1.9.2
30
+ rvm default clear # removes the current global default
31
+
32
+ "
33
+ }
34
+
35
+ default_list() {
36
+ :
37
+ }
38
+
39
+ default_clear() {
40
+ :
41
+ }
42
+
43
+
44
+ args=($*)
45
+ action="${args[0]}"
46
+ args=${args[@]:1}
47
+
48
+ if [[ "list" = "$action" ]] ; then
49
+ default_list
50
+
51
+ elif [[ "clear" = "$action" ]] ; then
52
+ default_clear
53
+
54
+ elif [[ "help" = "$action" ]] ; then
55
+ usage ; exit 0
56
+
57
+ else
58
+ usage ; exit 1
59
+ fi
60
+
61
+ exit $?
@@ -36,24 +36,26 @@ open_docs() {
36
36
 
37
37
  generate_ri() {
38
38
  # Generate ri docs
39
- __rvm_pushpop "$rvm_src_path/$rvm_docs_ruby_string/"
40
- "$rvm_scripts_path"/log "info" "Generating ri documentation, be aware that this could take a *long* time, and depends heavily on your system resources..."
41
- "$rvm_scripts_path"/log "info" "( Errors will be logged to $rvm_log_path/$rvm_docs_ruby_string/docs.error.log )"
42
- rdoc -a --ri --ri-site > /dev/null 2>> $rvm_log_path/$rvm_docs_ruby_string/docs.error.log
43
- __rvm_pushpop
39
+ (
40
+ builtin cd "$rvm_src_path/$rvm_docs_ruby_string/"
41
+ "$rvm_scripts_path"/log "info" "Generating ri documentation, be aware that this could take a *long* time, and depends heavily on your system resources..."
42
+ "$rvm_scripts_path"/log "info" "( Errors will be logged to $rvm_log_path/$rvm_docs_ruby_string/docs.error.log )"
43
+ rdoc -a --ri --ri-site > /dev/null 2>> $rvm_log_path/$rvm_docs_ruby_string/docs.error.log
44
+ )
44
45
  }
45
46
 
46
47
  generate_rdoc() {
47
- __rvm_pushpop "$rvm_src_path/$rvm_docs_ruby_string/"
48
- \rm -rf "$rvm_docs_path/$rvm_docs_ruby_string/$rvm_docs_type/"
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
- "$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
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
- else
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"
55
- fi
56
- __rvm_pushpop
48
+ (
49
+ builtin cd "$rvm_src_path/$rvm_docs_ruby_string/"
50
+ \rm -rf "$rvm_docs_path/$rvm_docs_ruby_string/$rvm_docs_type/"
51
+ "$rvm_scripts_path"/log "info" "Generating rdoc documentation, be aware that this could take a *long* time, and depends heavily on your system resources..."
52
+ "$rvm_scripts_path"/log "info" "( Errors will be logged to $rvm_log_path/$rvm_docs_ruby_string/docs.error.log )"
53
+ if gem list | \grep -q ^hanna ; then
54
+ 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"
55
+ else
56
+ 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"
57
+ fi
58
+ )
57
59
  }
58
60
 
59
61
  args=($*)
@@ -1,14 +1,16 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- if [[ "$rvm_trace_flag" -eq 2 ]] ; then set -x ; export rvm_trace_flag ; fi
4
-
5
- # Recursive loops, oh my!
6
- unset rvm_default_flag
3
+ unset rvm_default_flag # Recursive loops, oh my!
7
4
 
8
5
  source "$rvm_scripts_path/base"
9
6
 
10
7
  usage() {
11
- printf "Usage: rvm env [ruby_string] [--path]\n"
8
+ printf "
9
+ Usage:
10
+
11
+ rvm env [ruby_string] [--path]
12
+
13
+ "
12
14
  }
13
15
 
14
16
  args=($*)
@@ -8,7 +8,7 @@ result=0
8
8
  trap 'cleanup_download' 1 2 3 15
9
9
 
10
10
  cleanup_download() {
11
- [[ -f "$archive" ]] && \rm -rf "$archive"
11
+ [[ -f "$archive" ]] && rm -rf "$archive"
12
12
  }
13
13
 
14
14
  record_md5() {
@@ -45,22 +45,22 @@ else
45
45
  archive=$(basename "$url")
46
46
  fi
47
47
 
48
- if [[ ! -z "$rvm_debug_flag" ]] ; then "$rvm_scripts_path/log" "debug" "Fetching $archive" ; fi
48
+ if [[ ${rvm_debug_flag:-0} -gt 0 ]] ; then "$rvm_scripts_path/log" "debug" "Fetching $archive" ; fi
49
49
 
50
50
  # Check first if we have the correct archive
51
51
  archive_md5="$($rvm_scripts_path/db "$rvm_config_path/md5" "$archive" | head -n1)"
52
52
  if [[ -e "$archive" ]] && [[ ! -z "$archive_md5" ]] ; then
53
- if [[ ! -z "$rvm_debug_flag" ]] ; then "$rvm_scripts_path/log" "debug" "Found archive and its md5, testing correctness" ; fi
53
+ if [[ ${rvm_debug_flag:-0} -gt 0 ]] ; then "$rvm_scripts_path/log" "debug" "Found archive and its md5, testing correctness" ; fi
54
54
  if ! "$rvm_scripts_path"/md5 "${rvm_archives_path}/${archive}" "$archive_md5" ; then
55
- if [[ ! -z "$rvm_debug_flag" ]] ; then "$rvm_scripts_path/log" "debug" "Archive is bad, downloading" ; fi
55
+ if [[ ${rvm_debug_flag:-0} -gt 0 ]] ; then "$rvm_scripts_path/log" "debug" "Archive is bad, downloading" ; fi
56
56
  download=1
57
57
  else
58
- if [[ ! -z "$rvm_debug_flag" ]] ; then "$rvm_scripts_path/log" "debug" "Archive is good, not downloading" ; fi
58
+ if [[ ${rvm_debug_flag:-0} -gt 0 ]] ; then "$rvm_scripts_path/log" "debug" "Archive is good, not downloading" ; fi
59
59
  download=0
60
60
  result=0
61
61
  fi ; unset archive_md5
62
62
  else
63
- if [[ ! -z "$rvm_debug_flag" ]] ; then "$rvm_scripts_path/log" "debug" "No archive or no MD5, downloading" ; fi
63
+ if [[ ${rvm_debug_flag:-0} -gt 0 ]] ; then "$rvm_scripts_path/log" "debug" "No archive or no MD5, downloading" ; fi
64
64
  download=1
65
65
  fi
66
66
 
@@ -68,7 +68,7 @@ fi
68
68
  http_url="$(echo $url | sed -e 's/ftp:/http:/' -e 's/git:/http:/')"
69
69
 
70
70
  if [[ $download -gt 0 ]] ; then
71
- \rm -f $archive
71
+ rm -f $archive
72
72
  eval $fetch_command "$url"
73
73
  result=$?
74
74
  if [[ $result -gt 0 ]] ; then
@@ -79,11 +79,11 @@ if [[ $download -gt 0 ]] ; then
79
79
  try_http=1
80
80
  elif [[ $result -eq 18 ]] ; then
81
81
  "$rvm_scripts_path/log" "error" "Partial file. Only a part of the file was transferred. Removing partial and re-trying."
82
- \rm -f "$archive"
82
+ rm -f "$archive"
83
83
  retry=1
84
84
  elif [[ $result -eq 33 ]] ; then
85
- if [[ ! -z "$rvm_debug_flag" ]] ; then "$rvm_scripts_path/log" "debug" "Server does not support 'range' command, removing '$archive'" ; fi
86
- \rm -f "$archive"
85
+ if [[ ${rvm_debug_flag:-0} -gt 0 ]] ; then "$rvm_scripts_path/log" "debug" "Server does not support 'range' command, removing '$archive'" ; fi
86
+ rm -f "$archive"
87
87
  retry=1
88
88
  else
89
89
  "$rvm_scripts_path/log" "error" "There was an error, please check $rvm_ruby_log_path/*.error.log. Next we'll try to fetch via http."
@@ -199,35 +199,44 @@ gemset_empty() {
199
199
 
200
200
  # Migrate gemsets from ruby X to ruby Y
201
201
  gemset_copy() {
202
- local source_ruby="${gems_args/ */}"
203
- local destination_ruby="${gems_args/* /}"
202
+ local source_ruby="${args[1]:-""}"
203
+ local destination_ruby="${args[2]:-""}"
204
204
 
205
205
  if [[ -z "$destination_ruby" || -z "$source_ruby" ]] ; then
206
206
  "$rvm_scripts_path/log" "error" "Source and destination must be specified: 'rvm gemset copy X Y'"
207
207
  return 1
208
208
  fi
209
209
 
210
+ # TODO: Account for more possibilities:
211
+ # rvm gemset copy 1.9.2 @gemsetb # From 1.9.2 default to current ruby, 1.9.2 exists.
212
+ # rvm gemset copy @gemseta @gemsetb # Current ruby, gemseta exists.
213
+ # rvm gemset copy gemseta gemsetb # Currenty Ruby, gemseta exists.
214
+ # rvm gemset copy gemseta 1.8.7@gemsetb # Currenty Ruby@gemseta, current ruby@gemseta exists.
215
+
210
216
  local source_path="$(rvm_silence_logging=1 rvm "$source_ruby" gem env gemdir)"
211
217
  local destination_path="$(rvm_silence_logging=1 rvm "$destination_ruby" gem env gemdir)"
212
218
 
213
- if [[ -z "$source_path" ]]; then
214
- "$rvm_scripts_path/log" "error" "Unable to expand ruby '$source_ruby'"
219
+ if [[ -z "$source_path" || ! -d "$source_path" ]]; then
220
+ "$rvm_scripts_path/log" "error" "Unable to expand '$source_ruby' or directory does not exist."
215
221
  return 1
216
222
  fi
217
223
 
218
224
  if [[ -z "$destination_path" ]]; then
219
- "$rvm_scripts_path/log" "error" "Unable to expand ruby '$destination_ruby'"
225
+ "$rvm_scripts_path/log" "error" "Unable to expand '$destination_ruby'"
220
226
  return 1
221
227
  fi
222
228
 
223
229
  if [[ -d "$source_path" ]] ; then
224
- [[ ! -d "$destination_path" ]] && mkdir -p "$destination_path"
230
+
225
231
  "$rvm_scripts_path/log" "info" "Copying gemset from $source_ruby to $destination_ruby"
232
+
226
233
  for dir in bin doc gems specifications cache ; do
227
234
  mkdir -p "$destination_path/$dir"
228
235
  cp -Rf "$source_path/$dir" "$destination_path/"
229
236
  done
237
+
230
238
  "$rvm_scripts_path/log" "info" "Making gemset for $destination_ruby pristine."
239
+
231
240
  __rvm_run_with_env "gemset.pristine" "$destination_ruby" "rvm gemset pristine"
232
241
  else
233
242
  "$rvm_scripts_path/log" "error" "Gems directory does not exist for $source_path ($source_path)"
@@ -236,7 +245,7 @@ gemset_copy() {
236
245
  }
237
246
 
238
247
  gemset_export() {
239
- rvm_file_name="${rvm_file_name:-$gems_args}"
248
+ rvm_file_name="${rvm_file_name:-${gems_args// }}"
240
249
 
241
250
  if [[ ! -z "$rvm_ruby_gem_home" ]] ; then
242
251
  export GEM_HOME="$rvm_ruby_gem_home"
@@ -503,7 +512,7 @@ args=($*)
503
512
  action="${args[0]}"
504
513
  gems_args="$(echo ${args[@]:1}) " # Strip trailing / leading / extra spacing.
505
514
 
506
- export rvm_gemset_name="${args[1]}" # For wherever used.
515
+ export rvm_gemset_name="${args[1]:-""}" # For wherever used.
507
516
  rvm_sticky_flag=1
508
517
 
509
518
  if [[ "import" = "$action" ]] || [[ "load" = "$action" ]] ; then
@@ -5,7 +5,7 @@ declare rvm_hook=${rvm_hook:-""}
5
5
 
6
6
  if [[ -n "$rvm_hook" ]] ; then
7
7
  if [[ -s "$rvm_hooks_path/$rvm_hook" ]] ; then
8
- if [[ $rvm_verbose_flag -eq 1 ]] || [[ "$rvm_debug_flag" -eq 1 ]] ; then
8
+ if [[ ${rvm_verbose_flag:-0} -gt 0 || ${rvm_debug_flag:-0} -gt 0 ]] ; then
9
9
  "$rvm_scripts_path/log" "info" "running hook $rvm_hook"
10
10
  fi
11
11
  source "$rvm_hooks_path/$rvm_hook"
@@ -5,12 +5,14 @@ if [[ "$rvm_trace_flag" -eq 2 ]] ; then set -x ; export rvm_trace_flag ; fi
5
5
  source "$rvm_scripts_path/base"
6
6
  source "$rvm_scripts_path/version"
7
7
 
8
- rvm_ruby_gem_home="${rvm_ruby_gem_home:-$GEM_HOME}"
8
+ rvm_ruby_gem_home="${rvm_ruby_gem_home:-${GEM_HOME:-""}}"
9
9
 
10
10
  if [[ ! -d "$rvm_ruby_gem_home" ]] && command -v gem > /dev/null 2>&1; then
11
11
  rvm_ruby_gem_home="$(gem env home)"
12
12
  fi
13
13
 
14
+ rvm_info=""
15
+
14
16
  version_for() {
15
17
  local binary=$1
16
18
  if command -v "$binary" >/dev/null ; then
@@ -21,84 +23,101 @@ version_for() {
21
23
  }
22
24
 
23
25
  info_system() {
24
- rvm_info="$rvm_info\n system:\n uname: \"$(uname -a)\""
25
- rvm_info="$rvm_info\n bash: \"$(command -v bash) => $(version_for bash)\""
26
- rvm_info="$rvm_info\n zsh: \"$(command -v zsh) => $(version_for zsh)\""
27
- rvm_info="$rvm_info\n"
26
+ rvm_info="
27
+ system:
28
+ uname: \"$(uname -a)\"
29
+ bash: \"$(command -v bash) => $(version_for bash)\"
30
+ zsh: \"$(command -v zsh) => $(version_for zsh)\"
31
+ "
28
32
  }
29
33
 
30
34
  info_rvm() {
31
- rvm_info="$rvm_info\n rvm:"
32
- rvm_info="$rvm_info\n version: \"$(__rvm_version | \tr "\n" ' ' | __rvm_strip)\""
33
- rvm_info="$rvm_info\n"
35
+ rvm_info="
36
+ rvm:
37
+ version: \"$(__rvm_version | \tr "\n" ' ' | __rvm_strip)\"
38
+ "
39
+
34
40
  }
35
41
 
36
42
  info_ruby() {
37
43
  [[ "$(__rvm_environment_identifier)" == "system" ]] && return
38
44
  ruby=$(command -v ruby)
39
45
  if [[ $? -eq 0 ]] && [[ -x "$ruby" ]] ; then full_version="$($ruby -v)" ; fi
40
- rvm_info="$rvm_info\n ruby:"
41
- rvm_info="$rvm_info\n interpreter: \"$(printf "${full_version}" | awk '{print $1}')\""
42
- rvm_info="$rvm_info\n version: \"$(printf "${full_version}" | awk '{print $2}')\""
43
- rvm_info="$rvm_info\n date: \"$(printf "${full_version}" | sed 's/^.*(\([0-9]\{4\}\(-[0-9][0-9]\)\{2\}\).*$/\1/')\""
44
- rvm_info="$rvm_info\n platform: \"$(printf "${full_version}" | sed 's/^.*\[//' | sed 's/\].*$//')\""
45
- rvm_info="$rvm_info\n patchlevel: \"$(printf "${full_version}" | sed 's/^.*(//' | sed 's/).*$//')\""
46
- rvm_info="$rvm_info\n full_version: \"${full_version}\""
47
- rvm_info="$rvm_info\n"
46
+ rvm_info="
47
+ ruby:
48
+ interpreter: \"$(printf "${full_version}" | awk '{print $1}')\"
49
+ version: \"$(printf "${full_version}" | awk '{print $2}')\"
50
+ date: \"$(printf "${full_version}" | sed 's/^.*(\([0-9]\{4\}\(-[0-9][0-9]\)\{2\}\).*$/\1/')\"
51
+ platform: \"$(printf "${full_version}" | sed 's/^.*\[//' | sed 's/\].*$//')\"
52
+ patchlevel: \"$(printf "${full_version}" | sed 's/^.*(//' | sed 's/).*$//')\"
53
+ full_version: \"${full_version}\"
54
+ "
55
+
48
56
  }
49
57
 
50
58
  info_homes() {
51
- rvm_info="$rvm_info\n homes:"
52
- rvm_info="$rvm_info\n gem: \"${GEM_HOME:-"not set"}\""
53
- rvm_info="$rvm_info\n ruby: \"${MY_RUBY_HOME:-"not set"}\""
54
- rvm_info="$rvm_info\n"
59
+ rvm_info="
60
+ homes:
61
+ gem: \"${GEM_HOME:-"not set"}\"
62
+ ruby: \"${MY_RUBY_HOME:-"not set"}\"
63
+ "
55
64
  }
56
65
 
57
66
  info_binaries() {
58
- rvm_info="$rvm_info\n binaries:"
59
- rvm_info="$rvm_info\n ruby: \"$(command -v ruby)\""
60
- rvm_info="$rvm_info\n irb: \"$(command -v irb)\""
61
- rvm_info="$rvm_info\n gem: \"$(command -v gem)\""
62
- rvm_info="$rvm_info\n rake: \"$(command -v rake)\""
63
- rvm_info="$rvm_info\n"
67
+ rvm_info="
68
+ binaries:
69
+ ruby: \"$(command -v ruby)\"
70
+ irb: \"$(command -v irb)\"
71
+ gem: \"$(command -v gem)\"
72
+ rake: \"$(command -v rake)\"
73
+ "
64
74
  }
65
75
 
66
76
  info_environment() {
67
- rvm_info="$rvm_info\n environment:"
68
- rvm_info="$rvm_info\n PATH: \"$PATH\""
69
- rvm_info="$rvm_info\n GEM_HOME: \"$GEM_HOME\""
70
- rvm_info="$rvm_info\n GEM_PATH: \"$GEM_PATH\""
71
- rvm_info="$rvm_info\n BUNDLE_PATH: \"$BUNDLE_PATH\""
72
- rvm_info="$rvm_info\n MY_RUBY_HOME: \"$MY_RUBY_HOME\""
73
- rvm_info="$rvm_info\n IRBRC: \"$IRBRC\""
74
- rvm_info="$rvm_info\n RUBYOPT: \"$RUBYOPT\""
75
- rvm_info="$rvm_info\n gemset: \"$(printf "$GEM_HOME" | awk -F${rvm_gemset_separator:-'@'} '{print $2}')\"\n"
76
- if [[ ! -z "$MAGLEV_HOME" ]] ; then
77
+ rvm_info="
78
+ environment:
79
+ PATH: \"${PATH:-""}\"
80
+ GEM_HOME: \"${GEM_HOME:-""}\"
81
+ GEM_PATH: \"${GEM_PATH:-""}\"
82
+ BUNDLE_PATH: \"${BUNDLE_PATH:-""}\"
83
+ MY_RUBY_HOME: \"${MY_RUBY_HOME:-""}\"
84
+ IRBRC: \"${IRBRC:-""}\"
85
+ RUBYOPT: \"${RUBYOPT:-""}\"
86
+ gemset: \"$(printf "${GEM_HOME:-""}" | awk -F${rvm_gemset_separator:-'@'} '{print $2}')\"\n
87
+ "
88
+
89
+ if [[ -n "${MAGLEV_HOME:-""}" ]] ; then
77
90
  rvm_info="$rvm_info\n MAGLEV_HOME: \"$MAGLEV_HOME\""
78
91
  fi
92
+
79
93
  rvm_info="$rvm_info\n"
80
94
  }
81
95
 
82
96
  info_debug() {
83
- rvm_info=$(__rvm_version)
84
- rvm_info="$rvm_info\n$("$rvm_scripts_path/info" "$rvm_ruby_string" "" )"
85
- rvm_info="$rvm_info\nPATH:\n$(printf "$PATH" | awk -F":" '{print $1":"$2":"$3":"$4":"$5}' )"
86
- rvm_info="$rvm_info\nuname -a: $(uname -a)"
87
- rvm_info="$rvm_info\npermissions: $(\ls -la $rvm_path{,/rubies})"
97
+ rvm_info="
98
+
99
+ $(__rvm_version)
100
+ $("$rvm_scripts_path/info" "$rvm_ruby_string" "" )
101
+ PATH:\n$(printf "$PATH" | awk -F":" '{print $1":"$2":"$3":"$4":"$5}' )
102
+ uname -a: $(uname -a)
103
+ permissions: $(\ls -la $rvm_path{,/rubies})
104
+ "
88
105
 
89
106
  if [[ "Darwin" = "$(uname)" ]] ; then
90
- rvm_info="$rvm_info\nuname -r: $(uname -r)"
91
- rvm_info="$rvm_info\nuname -m: $(uname -m)"
92
- rvm_info="$rvm_info\nsw_vers: $(sw_vers | \tr "\n" ',')"
93
- rvm_info="$rvm_info\nARCHFLAGS: $ARCHFLAGS"
94
- rvm_info="$rvm_info\nLDFLAGS: $LDFLAGS"
95
- rvm_info="$rvm_info\nCFLAGS: $CFLAGS"
96
- rvm_info="$rvm_info\n/Developer/SDKs/*:$(/usr/bin/basename -a /Developer/SDKs/* | \tr "\n" ',')"
107
+ rvm_info="$rvm_info
108
+ uname -r: $(uname -r)
109
+ uname -m: $(uname -m)
110
+ sw_vers: $(sw_vers | \tr "\n" ',')
111
+ ARCHFLAGS: ${ARCHFLAGS:-""}
112
+ LDFLAGS: ${LDFLAGS:-""}
113
+ CFLAGS: ${CFLAGS:-""}
114
+ /Developer/SDKs/*:$(/usr/bin/basename -a /Developer/SDKs/* | \tr "\n" ',')
115
+ "
97
116
  fi
98
117
 
99
- for file_name in $(echo $rc_files) ; do
118
+ for file_name in "$HOME/.bashrc" "$HOME/.bash_profile" "$HOME/.zshenv" ; do
100
119
  if [[ -s "$file_name" ]] ; then
101
- rvm_info="$rvm_info\n$( "$file_name:\n$(\grep 'rvm' $file_name 2>/dev/null)" )"
120
+ rvm_info="$rvm_info\n$file_name:\n$(\grep 'rvm' $file_name 2>/dev/null || true)"
102
121
  fi
103
122
  done
104
123
 
@@ -114,12 +133,12 @@ info_debug() {
114
133
  fi
115
134
  done
116
135
 
117
- rvm_info="$rvm_info\ngem sources:\n$(gem sources | awk '/gems/')"
136
+ rvm_info="$rvm_info\ngem sources:\n$(gem sources | awk '/gems/')\n\n"
118
137
  }
119
138
 
120
139
  info_sections() {
121
140
  for section in $(printf "${sections//,/ }") ; do
122
- unset rvm_info ; "info_${section}" ; printf "$rvm_info"
141
+ rvm_info="" ; "info_${section}" ; printf "$rvm_info"
123
142
  done
124
143
  }
125
144
 
@@ -137,12 +156,12 @@ fi
137
156
  if [[ -z "${sections// /}" ]] ; then sections="$all_sections" ; fi
138
157
 
139
158
  if [[ -z "$ruby_strings" ]] ; then
140
- printf "$(__rvm_environment_identifier):\n"
159
+ printf "\n$(__rvm_environment_identifier):\n"
141
160
  info_sections
142
161
  else
143
162
  for ruby_string in $(printf ${ruby_strings//,/ }) ; do
144
163
  __rvm_become "$ruby_string"
145
- printf "$(__rvm_environment_identifier):\n"
164
+ printf "\n$(__rvm_environment_identifier):\n"
146
165
  info_sections
147
166
  done
148
167
  fi