rvm 0.0.80 → 0.0.81

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.
@@ -6,36 +6,22 @@
6
6
  # http://gitub.com/wayneeseguin/rvm
7
7
  #
8
8
 
9
- if [[ -f "/etc/rvmrc" ]] ; then source "/etc/rvmrc" ; fi
9
+ if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
10
+ if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
11
+ if [[ -z "$rvm_path" ]] ; then unset rvm_path ; fi
10
12
 
11
13
  if [[ "root" = "$(whoami)" ]] ; then
12
- rvm_prefix_path="${rvm_prefix_path:-/usr/local/}"
14
+ rvm_path="${rvm_path:-/usr/local/rvm}"
13
15
  else
14
- if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
15
- if [[ -f "$HOME/.rvm/scripts/rvm" ]] ; then
16
- rvm_prefix_path="${rvm_prefix_path:-"$HOME/."}"
17
- elif [[ -f "/usr/local/rvm/scripts/rvm" ]] ; then
18
- rvm_scripts_path="${rvm_scripts_path:-"/usr/local/rvm"}"
19
- rvm_prefix_path="${rvm_prefix_path:-"$HOME/."}"
20
- else
21
- echo -e "\nERROR: rvm scripts directory was not found in either ~/.rvm/ or /usr/local/rvm\n"
22
- if [[ $# -gt 0 ]] ; then exit 0 ; else return 1 ; fi
23
- fi
16
+ rvm_path="${rvm_path:-$HOME/.rvm}"
24
17
  fi
25
18
 
26
- if [[ "${rvm_prefix_path#${rvm_prefix_path%?}}" = '.' ]] || [[ "${rvm_prefix_path#${rvm_prefix_path%?}}" = '/' ]] ; then
27
- rvm_path="${rvm_prefix_path}rvm"
28
- else
29
- rvm_path="${rvm_prefix_path}/rvm"
30
- fi
31
-
32
- rvm_scripts_path="${rvm_scripts_path:-$rvm_path}"
33
- source $rvm_scripts_path/scripts/color
34
- source $rvm_scripts_path/scripts/utility
35
- source $rvm_scripts_path/scripts/selector
36
- source $rvm_scripts_path/scripts/ruby-installer # TODO: Script not function.
37
- source $rvm_scripts_path/scripts/cli
38
- source $rvm_scripts_path/scripts/gems
19
+ source $rvm_path/scripts/initialize
20
+ source $rvm_path/scripts/utility
21
+ source $rvm_path/scripts/selector
22
+ source $rvm_path/scripts/ruby-installer # TODO: Script not function.
23
+ source $rvm_path/scripts/cli
24
+ source $rvm_path/scripts/gems
39
25
 
40
26
  rvm_loaded_flag=1 ; export rvm_loaded_flag
41
27
 
@@ -45,9 +31,9 @@ alias rvm-restart="source \"${rvm_path}/scripts/rvm\""
45
31
 
46
32
  if [[ -f "$rvm_path/default" ]] ; then source "$rvm_path/default" ; fi
47
33
 
48
- # Ok now we determine if we were called or sourced... under assumption of course ;)
49
- if [[ $# -gt 0 ]] && [[ -z "$(echo "$*" | awk '/completion-/')" ]] ; then rvm "$*" ; fi
50
-
51
34
  # Source a .rvmrc file in a directory after changing to it, if it exists.
52
35
  cd() { builtin cd "$@" ; if [[ -f .rvmrc ]] ; then source .rvmrc ; fi ; }
53
36
 
37
+ # Ok now we determine if we were called or sourced... under assumption of course ;)
38
+ if [[ $# -gt 0 ]] && [[ -z "$(echo "$*" | awk '/completion-/')" ]] ; then rvm "$*" ; fi
39
+
@@ -1,15 +1,19 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- rc_files="$HOME/.bash_profile $HOME/.bashrc $HOME/.zshrc"
4
- if [[ -f "/etc/rvmrc" ]] ; then source "/etc/rvmrc" ; fi
5
- if [[ "root" = "$(whoami)" ]] ; then
6
- rvm_path="${rvm_path:-/usr/local/rvm}"
7
- rc_files="$rc_files /etc/profile /etc/zshenv"
8
- else
9
- if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
10
- rvm_path="${rvm_path:-$HOME/.rvm}"
3
+ if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
4
+ if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
5
+ if [[ -z "$rvm_path" ]] ; then unset rvm_path ; fi
6
+
7
+ if [[ -z "$rvm_path" ]] ; then
8
+ if [[ "root" = "$(whoami)" ]] ; then
9
+ rvm_path="${rvm_path:-/usr/local/rvm}"
10
+ else
11
+ rvm_path="${rvm_path:-$HOME/.rvm}"
12
+ fi
11
13
  fi
12
14
 
15
+ source scripts/initialize
16
+
13
17
  #
14
18
  # Setup
15
19
  #
@@ -21,8 +25,8 @@ if [[ ! -d "$source_dir" ]] ; then unset source_dir ; fi
21
25
  source_dir="${source_dir:-$cwd}"
22
26
 
23
27
  # State what is required to use rvm
24
- echo -e "\n$(tput setaf 2)rvm$(tput sgr0)\n\n shell scripts that allows a user to manage multiple ruby versions in their own account."
25
- echo -e "\n Installing rvm to $rvm_path ..."
28
+ echo -e "\n$(tput setaf 2)rvm$(tput sgr0) - shell scripts that allows a user to manage multiple ruby versions in their own account."
29
+ echo -e "\n Installing to $rvm_path..."
26
30
  for dir_name in src scripts bin log archives config gems examples ; do
27
31
  mkdir -p "$rvm_path/$dir_name"
28
32
  done
@@ -47,15 +51,15 @@ ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
47
51
  #
48
52
  # RC Files
49
53
  #
50
- if [[ -z "$rvm_loaded_flag" ]] ; then
51
- for rcfile in $(echo $rc_files) ; do
52
- if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
53
- if [[ -z "$(awk '/\.rvm\/scripts\/rvm/' $rcfile)" ]] ; then
54
- echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
55
- echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
56
- fi
57
- done
58
- fi
54
+ for rcfile in $(echo $rvm_rc_files) ; do
55
+ if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
56
+ if [[ -z "$(awk "/$(echo "$rvm_path/scripts/rvm" | sed 's#/#\\/#g')/" $rcfile)" ]] ; then
57
+ echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] && [[ "\$rvm_loaded_flag" -le 0 ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
58
+ echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] && [[ "\$rvm_loaded_flag" != "1" ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
59
+ else
60
+ : # it exists... remove it and append at the end
61
+ fi
62
+ done
59
63
 
60
64
  if [[ "root" = "$(whoami)" ]] ; then
61
65
  ln -nfs $rvm_path/scripts/rvm /usr/local/bin/rvm
@@ -66,7 +70,7 @@ fi
66
70
  # System Checks
67
71
  #
68
72
  system="$(uname)"
69
- echo -e "\n $(tput setaf 3)NOTES: $(tput sgr0)\n"
73
+ echo -e "\n$(tput setaf 2)Notes: $(tput sgr0)\n"
70
74
  if [[ "Linux" = "$system" ]] ; then
71
75
  rvm_apt_get_binary="$(which aptitude 2> /dev/null)"
72
76
  rvm_emerge_binary="$(which emerge 2> /dev/null)"
@@ -74,44 +78,42 @@ if [[ "Linux" = "$system" ]] ; then
74
78
  rvm_yum_binary="$(which yum 2> /dev/null)"
75
79
 
76
80
  if [[ ! -z "$rvm_apt_get_binary" ]] ; then
77
- echo -e " $item For jRuby (if you wish to use it) you will need:"
78
- echo -e " $ aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
79
- echo -e " $item For ree (if you wish to use it) you will need:"
80
- echo -e " $ aptitude install libreadline5-dev libssl-dev bison"
81
- echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
82
- echo -e " $ aptitude install libxml2-dev"
81
+ echo -e " $item For JRuby (if you wish to use it) you will need:"
82
+ echo -e " $ aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
83
+ echo -e " $item For ree (if you wish to use it) you will need:"
84
+ echo -e " $ aptitude install libreadline5-dev libssl-dev bison"
85
+ echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
86
+ echo -e " $ aptitude install libxml2-dev"
83
87
 
84
88
  elif [[ ! -z "$rvm_emerge_binary" ]] ; then
85
- echo -e " $item For jRuby (if you wish to use it) you will need:"
86
- echo -e " $ emerge dev-java/sun-jdk dev-java/sun-jre-bin"
89
+ echo -e " $item For JRuby (if you wish to use it) you will need:"
90
+ echo -e " $ emerge dev-java/sun-jdk dev-java/sun-jre-bin"
87
91
 
88
92
  elif [[ ! -z "$rvm_pacman_binary" ]] ; then
89
- echo -e " $item For jRuby (if you wish to use it) you will need:"
90
- echo -e " $ pacman -Sy jdk jre"
93
+ echo -e " $item For JRuby (if you wish to use it) you will need:"
94
+ echo -e " $ pacman -Sy jdk jre"
91
95
 
92
96
  elif [[ ! -z "$rvm_yum_binary" ]] ; then
93
- echo -e " $item For ree (if you wish to use it) you will need:"
94
- echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
97
+ echo -e " $item For ree (if you wish to use it) you will need:"
98
+ echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
95
99
 
96
100
  else
97
- echo -e " $item For jRuby (if you wish to use it) you will need:"
98
- echo -e " The SUN java runtime environment and development kit."
101
+ echo -e " $item For JRuby (if you wish to use it) you will need:"
102
+ echo -e " The SUN java runtime environment and development kit."
99
103
  fi
100
104
  elif [[ "Darwin" = "$system" ]] ; then
101
- echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
102
- echo -e " $item If you intend on installing MacRuby you must install LLVM first."
105
+ echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
106
+ echo -e " $item If you intend on installing MacRuby you must install LLVM first."
103
107
  fi
104
108
 
105
- echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
106
- echo -e " $item if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
107
- echo -e " $item CLOSE THIS SHELL AND OPEN A NEW ONE in order to use rvm."
109
+ echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
110
+ echo -e " $item if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
111
+ echo -e " $item CLOSE THIS SHELL AND OPEN A NEW ONE in order to use rvm."
108
112
 
109
- echo -e "\n \033[0;33mRTFM: $(tput sgr0) http://rvm.beginrescueend.com/ \n"
113
+ echo -e "\n$(tput setaf 2)RTFM:\n $(tput sgr0) http://rvm.beginrescueend.com/ \n"
110
114
  echo -e "$(tput setaf 2)w⦿‿⦿t!$(tput sgr0)"
111
115
  echo -e "\n ~ Wayne\n"
112
116
 
113
- source $rvm_path/scripts/rvm
114
- rvm -v
115
- echo
117
+ $rvm_path/bin/rvm -v
116
118
 
117
119
  exit 0
@@ -18,14 +18,14 @@ __rvm_select() {
18
18
  if [[ "$rvm_head_flag" -eq 1 ]] ; then
19
19
  unset rvm_ruby_version rvm_ruby_tag
20
20
  rvm_ruby_revision="head"
21
- rvm_ruby_repo_url=${rvm_ruby_repo_url:-"$(__rvm_db "macruby_repo_url")"}
21
+ rvm_ruby_repo_url=${rvm_ruby_repo_url:-"$($rvm_scripts_path/db "$rvm_config_path/db" "macruby_repo_url")"}
22
22
  rvm_url="$rvm_ruby_repo_url"
23
23
  rvm_ruby_string="${rvm_ruby_interpreter}-head"
24
24
  elif [[ "nightly" = "$rvm_ruby_version" ]] ; then
25
25
  rvm_url="http://macruby.icoretech.org/latest"
26
26
  rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}"
27
27
  else
28
- rvm_ruby_version="${rvm_ruby_version:-"$(__rvm_db "macruby_version")"}"
28
+ rvm_ruby_version="${rvm_ruby_version:-"$($rvm_scripts_path/db "$rvm_config_path/db" "macruby_version")"}"
29
29
  rvm_ruby_package_name="${rvm_ruby_interpreter}_nightly-${rvm_ruby_version}"
30
30
  rvm_ruby_package_file="MacRuby%200.5%20beta%201.zip"
31
31
  rvm_url="http://www.macruby.org/files/MacRuby%200.5%20beta%201.zip"
@@ -34,7 +34,7 @@ __rvm_select() {
34
34
 
35
35
  unset rvm_ruby_patch_level
36
36
  else
37
- __rvm_log "fail" "MacRuby can only be installed on a Darwin OS."
37
+ $rvm_scripts_path/log "fail" "MacRuby can only be installed on a Darwin OS."
38
38
  fi
39
39
  ;;
40
40
 
@@ -42,7 +42,7 @@ __rvm_select() {
42
42
  rvm_ruby_interpreter="rbx"
43
43
  rvm_ruby_version="${rvm_ruby_version:-head}"
44
44
  unset rvm_ruby_patch_level
45
- rvm_ruby_repo_url=${rvm_rbx_repo_url:-"$(__rvm_db "rubinius_repo_url")"}
45
+ rvm_ruby_repo_url=${rvm_rbx_repo_url:-"$($rvm_scripts_path/db "$rvm_config_path/db" "rubinius_repo_url")"}
46
46
  rvm_ruby_string="rbx-head" # for now :)
47
47
  rvm_url=$rvm_ruby_repo_url
48
48
  rvm_ruby_configure=" true "
@@ -55,10 +55,10 @@ __rvm_select() {
55
55
  if [[ "$rvm_head_flag" -eq 1 ]] ; then
56
56
  rvm_ruby_version="head"
57
57
  rvm_ruby_string="jruby-head"
58
- rvm_ruby_repo_url="${rvm_ruby_repo_url:-$(__rvm_db "jruby_repo_url")}"
59
- rvm_url="${rvm_ruby_repo_url:-$(__rvm_db "jruby_repo_url")}"
58
+ rvm_ruby_repo_url="${rvm_ruby_repo_url:-$($rvm_scripts_path/db "$rvm_config_path/db" "jruby_repo_url")}"
59
+ rvm_url="${rvm_ruby_repo_url:-$($rvm_scripts_path/db "$rvm_config_path/db" "jruby_repo_url")}"
60
60
  else
61
- rvm_ruby_version="${rvm_ruby_version:-"$(__rvm_db "jruby_version")"}"
61
+ rvm_ruby_version="${rvm_ruby_version:-"$($rvm_scripts_path/db "$rvm_config_path/db" "jruby_version")"}"
62
62
  rvm_package_file="${rvm_ruby_interpreter}-bin-${rvm_ruby_version}"
63
63
  rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}"
64
64
  rvm_url="http://jruby.kenai.com/downloads/${rvm_ruby_version}/${rvm_package_file}.tar.gz"
@@ -69,7 +69,7 @@ __rvm_select() {
69
69
 
70
70
  ree)
71
71
  rvm_ruby_interpreter=ree
72
- rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "ree_version")"}
72
+ rvm_ruby_version=${rvm_ruby_version:-"$($rvm_scripts_path/db "$rvm_config_path/db" "ree_version")"}
73
73
  if [[ ! -z "$rvm_ruby_patch_level" ]] ; then
74
74
  rvm_ruby_patch_level="$(echo $rvm_ruby_patch_level | sed 's#^p##')"
75
75
  rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}-${rvm_ruby_patch_level}"
@@ -83,12 +83,12 @@ __rvm_select() {
83
83
  rvm_ruby_package_name="ree-$rvm_ruby_version-$rvm_ruby_revision"
84
84
  else
85
85
  rvm_ruby_package_file="ruby-enterprise-$rvm_ruby_version-$rvm_ruby_patch_level"
86
- rvm_url="${rvm_url:-$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_url")}/$rvm_ruby_package_file.tar.gz"
86
+ rvm_url="${rvm_url:-$($rvm_scripts_path/db "$rvm_config_path/db" "${rvm_ruby_interpreter}_${rvm_ruby_version}_url")}/$rvm_ruby_package_file.tar.gz"
87
87
  fi
88
88
  fi
89
89
 
90
- if ! match "$rvm_ruby_version" "^1\.8" ; then
91
- __rvm_log "fail" "Unknown Ruby Enterprise Edition version: $rvm_ruby_version"
90
+ if ! $rvm_scripts_path/match "$rvm_ruby_version" "^1\.8" ; then
91
+ $rvm_scripts_path/log "fail" "Unknown Ruby Enterprise Edition version: $rvm_ruby_version"
92
92
  fi
93
93
  ;;
94
94
 
@@ -97,19 +97,19 @@ __rvm_select() {
97
97
  rvm_ruby_version="head"
98
98
  rvm_ruby_string="mput-head"
99
99
  unset rvm_ruby_patch_level
100
- rvm_ruby_repo_url=${rvm_mput_repo_url:-"$(__rvm_db "shyouhei_repo_url")"}
100
+ rvm_ruby_repo_url=${rvm_mput_repo_url:-"$($rvm_scripts_path/db "$rvm_config_path/db" "shyouhei_repo_url")"}
101
101
  rvm_url=$rvm_ruby_repo_url
102
102
  unset rvm_ruby_configure rvm_ruby_make rvm_ruby_make_install
103
103
  ;;
104
104
 
105
105
  ruby)
106
- rvm_ruby_repo_url="${rvm_ruby_repo_url:-"$(__rvm_db "ruby_repo_url")"}"
107
- if [[ -z "$rvm_ruby_version" ]] ; then __rvm_log "fail" "Unknown ruby version: $rvm_ruby_version" ; fi
106
+ rvm_ruby_repo_url="${rvm_ruby_repo_url:-"$($rvm_scripts_path/db "$rvm_config_path/db" "ruby_repo_url")"}"
107
+ if [[ -z "$rvm_ruby_version" ]] ; then $rvm_scripts_path/log "fail" "Unknown ruby version: $rvm_ruby_version" ; fi
108
108
  ;;
109
109
 
110
110
  current)
111
111
  ruby_binary="$(which binary)"
112
- if match "$ruby_binary" "rvm" ; then
112
+ if $rvm_scripts_path/match "$ruby_binary" "rvm" ; then
113
113
  rvm_ruby_string="$(dirname "$ruby_binary" | xargs dirname | xargs basename)"
114
114
  else
115
115
  rvm_ruby_interpreter="system"
@@ -126,7 +126,7 @@ __rvm_select() {
126
126
  __rvm_select
127
127
  else
128
128
  if [[ -z "$rvm_ruby_string" ]] ; then
129
- __rvm_log "fail" "Ruby implementation '$rvm_ruby_interpreter' is not known."
129
+ $rvm_scripts_path/log "fail" "Ruby implementation '$rvm_ruby_interpreter' is not known."
130
130
  fi
131
131
  fi
132
132
  esac
@@ -173,11 +173,11 @@ __rvm_use() {
173
173
  source $rvm_path/default
174
174
 
175
175
  if [[ ! -z "$rvm_verbose_flag" ]] ; then
176
- __rvm_log "info" "Now using default ruby."
176
+ $rvm_scripts_path/log "info" "Now using default ruby."
177
177
  fi
178
178
  else
179
179
  rvm_ruby_interpreter="system"
180
- __rvm_log "warn" "no default rvm specified, defaulting to pre-rvm system."
180
+ $rvm_scripts_path/log "warn" "no default rvm specified, defaulting to pre-rvm system."
181
181
  unset GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC
182
182
  if [[ -s $rvm_path/system ]] ; then source $rvm_path/system ; fi
183
183
  fi
@@ -203,31 +203,34 @@ __rvm_use() {
203
203
  fi
204
204
 
205
205
  if [[ ! -z "$rvm_verbose_flag" ]] ; then
206
- __rvm_log "info" "Now using system ruby."
206
+ $rvm_scripts_path/log "info" "Now using system ruby."
207
207
  fi
208
208
 
209
209
  rvm_ruby_string="system"
210
210
 
211
211
  else
212
- GEM_HOME=$rvm_ruby_gem_home ; export GEM_HOME
213
- GEM_PATH=$rvm_ruby_gem_home ; export GEM_PATH
214
- MY_RUBY_HOME=$rvm_ruby_home ; export MY_RUBY_HOME
215
- RUBY_VERSION=$rvm_ruby_string ; export RUBY_VERSION
216
- IRBRC="$rvm_ruby_irbrc" ; export IRBRC
212
+ GEM_HOME=$rvm_ruby_gem_home
213
+ GEM_PATH=$rvm_ruby_gem_home
214
+ MY_RUBY_HOME=$rvm_ruby_home
215
+ RUBY_VERSION=$rvm_ruby_string
216
+ IRBRC="$rvm_ruby_irbrc"
217
+
218
+ export GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC
219
+
217
220
  if [[ -z "$IRBRC" ]] ; then unset IRBRC ; fi
218
221
 
219
222
  if [[ ! -d $MY_RUBY_HOME ]] ; then
220
- __rvm_log "warn" "$rvm_ruby_interpreter $rvm_ruby_string is not installed."
223
+ $rvm_scripts_path/log "warn" "$rvm_ruby_interpreter $rvm_ruby_string is not installed."
221
224
  if [[ ! -z "$rvm_install_on_use_flag" ]] ; then
222
225
  __rvm_install_ruby $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level
223
226
  else
224
- __rvm_log "info" "To install do: 'rvm install $rvm_ruby_string'"
227
+ $rvm_scripts_path/log "info" "To install do: 'rvm install $rvm_ruby_string'"
225
228
  return 1
226
229
  fi
227
230
  fi
228
231
 
229
232
  if [[ ! -z "$rvm_verbose_flag" ]] ; then
230
- __rvm_log "info" "Now using $(echo $rvm_ruby_string | tr '-' ' ')"
233
+ $rvm_scripts_path/log "info" "Now using $(echo $rvm_ruby_string | tr '-' ' ')"
231
234
  fi
232
235
 
233
236
  __rvm_irbrc
@@ -240,6 +243,8 @@ __rvm_use() {
240
243
  for binary in erb gem irb rake rdoc ri ruby testrb ; do
241
244
  rm -f /usr/local/bin/$binary
242
245
  ln -nfs $rvm_ruby_home/bin/$binary /usr/local/bin/$binary
246
+ rm -f /usr/local/bin/passenger_ruby
247
+ ln -nfs $rvm_bin_path/$rvm_ruby_string /usr/local/bin/passenger_ruby
243
248
  done
244
249
  fi
245
250
  fi
@@ -265,9 +270,10 @@ __rvm_use() {
265
270
  done ; unset variable value
266
271
 
267
272
  if [[ -s "$rvm_path/bin/$rvm_ruby_string" ]] ; then
268
- ln -fs "$rvm_path/bin/$rvm_ruby_string" "$rvm_path/bin/default-ruby" # So that people know what it's for :)
269
- ln -fs "$rvm_path/$rvm_ruby_string/bin/gem" "$rvm_path/bin/default-gem"
270
- ln -fs "$rvm_path/$rvm_ruby_string/bin/irb" "$rvm_path/bin/default-irb"
273
+ rm -f $rvm_path/bin/default*
274
+ ln -fs "$rvm_path/bin/$rvm_ruby_string" "$rvm_path/bin/default_ruby" # So that people know what it's for :)
275
+ ln -fs "$rvm_path/$rvm_ruby_string/bin/gem" "$rvm_path/bin/default_gem"
276
+ ln -fs "$rvm_path/$rvm_ruby_string/bin/irb" "$rvm_path/bin/default_irb"
271
277
  else
272
278
  rm -f $rvm_path/bin/default*
273
279
  fi
@@ -313,54 +319,60 @@ __rvm_ruby_string() {
313
319
  rvm_ruby_version="nightly"
314
320
  rvm_nightly_flag=1
315
321
  break
316
- elif match "$string" "^preview" ; then
322
+ elif $rvm_scripts_path/match "$string" "^preview" ; then
317
323
  rvm_ruby_patch_level="$string"
318
- elif match "$string" "^[0-9]\.[0-9]" ; then
324
+ elif $rvm_scripts_path/match "$string" "^[0-9]\.[0-9]" ; then
319
325
  if [[ "1.8" = "$string" ]] ; then string="1.8.6" ; fi
320
326
  if [[ "1.9" = "$string" ]] ; then string="1.9.1" ; fi
321
327
  rvm_ruby_version="$string"
322
328
  unset rvm_ruby_revision rvm_ruby_tag
323
- elif match "$string" "^p[0-9]" ; then
329
+ elif $rvm_scripts_path/match "$string" "^p[0-9]" ; then
324
330
  rvm_ruby_patch_level="$string"
325
- elif match "$string" "^[0-9][0-9]" ; then
331
+ elif $rvm_scripts_path/match "$string" "^[0-9][0-9]" ; then
326
332
  if [[ "ree" = "$rvm_ruby_interpreter" ]] ; then
327
333
  rvm_ruby_patch_level="$string"
328
334
  unset rvm_ruby_revision
329
335
  else
330
336
  rvm_ruby_revision="r$string"
331
337
  fi
332
- elif match "$string" "^r[0-9]" ; then
338
+ elif $rvm_scripts_path/match "$string" "^r[0-9]" ; then
333
339
  unset rvm_ruby_patch_level
334
340
  rvm_ruby_revision="$string"
335
- elif match "$string" "^s[0-9]" ; then
341
+ elif $rvm_scripts_path/match "$string" "^s[0-9]" ; then
336
342
  unset rvm_ruby_revision
337
343
  rvm_ruby_sha="$string"
338
- elif match "$string" "^t[v0-9]" ; then
344
+ elif $rvm_scripts_path/match "$string" "^t[v0-9]" ; then
339
345
  unset rvm_ruby_patch_level rvm_ruby_revision
340
346
  rvm_ruby_tag="$string"
341
- elif match "$string" "^[a-z][a-z]" ; then
347
+ elif $rvm_scripts_path/match "$string" "^m[0-9]" ; then
348
+ rvm_ruby_mode="$string"
349
+ elif $rvm_scripts_path/match "$string" "^[a-z][a-z]" ; then
342
350
  rvm_ruby_interpreter="$string"
343
351
  else
344
- __rvm_log "error" "Unknown ruby string component: '$string'"
352
+ $rvm_scripts_path/log "error" "Unknown ruby string component: '$string'"
345
353
  fi
346
354
  done
347
355
 
348
356
  # Unspecified interpreter
349
357
  if [[ -z "$rvm_ruby_interpreter" ]] ; then
350
- if match "$rvm_ruby_version" "^1\.[8-9]" ; then
358
+ if $rvm_scripts_path/match "$rvm_ruby_version" "^1\.[8-9]" ; then
351
359
  rvm_ruby_interpreter="ruby"
352
- elif match "$rvm_ruby_version" "^0.5" ; then
360
+ elif $rvm_scripts_path/match "$rvm_ruby_version" "^0.5" ; then
353
361
  rvm_ruby_interpreter="macruby"
354
- elif match "$rvm_ruby_version" "^1.[2-4]" ; then
362
+ elif $rvm_scripts_path/match "$rvm_ruby_version" "^1.[2-4]" ; then
355
363
  rvm_ruby_interpreter="jruby"
356
364
  fi
357
365
  fi
358
366
 
359
367
  # Unspecified version
360
368
  if [[ -z "$rvm_ruby_version" ]] ; then
361
- rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "${rvm_ruby_interpreter}_version")"}
369
+ rvm_ruby_version=${rvm_ruby_version:-"$($rvm_scripts_path/db "$rvm_config_path/db" "${rvm_ruby_interpreter}_version")"}
370
+ fi
371
+ if [[ -z "$rvm_ruby_version" ]] ; then
372
+ rvm_ruby_string="${rvm_ruby_interpreter}"
373
+ else
374
+ rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}"
362
375
  fi
363
- rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}"
364
376
 
365
377
  if [[ "$rvm_head_flag" -eq 1 ]] ; then
366
378
  rvm_ruby_string="${rvm_ruby_string}-head"
@@ -371,7 +383,7 @@ __rvm_ruby_string() {
371
383
  elif [[ ! -z "$rvm_ruby_patch_level" ]] ; then
372
384
  rvm_ruby_string="${rvm_ruby_string}-${rvm_ruby_patch_level}"
373
385
  else
374
- patch_level="$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_patch_level")"
386
+ patch_level="$($rvm_scripts_path/db "$rvm_config_path/db" "${rvm_ruby_interpreter}_${rvm_ruby_version}_patch_level")"
375
387
  if [[ ! -z "$patch_level" ]] ; then rvm_ruby_patch_level="p${patch_level}" ; fi
376
388
  if [[ ! -z "$rvm_ruby_patch_level" ]] ; then
377
389
  rvm_ruby_patch_level="$(echo $rvm_ruby_patch_level | sed 's#^pp#p#')"