wayneeseguin-rvm 0.0.25 → 0.0.27

Sign up to get free protection for your applications and to get access to all the features.
data/bin/rvm-install CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # Hot potato!!! Bash it!
4
- exec "bash -l -c 'cd #{File.dirname(File.dirname(__FILE__))} && ./scripts/rvm-install #{ARGV.join(' ')} && source ~/.rvm/scripts/rvm'"
4
+ %x["bash -l -c 'cd #{File.dirname(File.dirname(__FILE__))} && ./scripts/rvm-install #{ARGV.join(' ')} && source ~/.rvm/scripts/rvm'"]
5
5
 
data/bin/rvm-update CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # Hot potato!!! Bash it!
4
- exec "bash -l -c 'cd #{File.dirname(File.dirname(__FILE__))} && ./scripts/rvm-update #{ARGV.join(' ')} && source ~/.rvm/scripts/rvm'"
4
+ %x["bash -l -c 'cd #{File.dirname(File.dirname(__FILE__))} && ./scripts/rvm-update #{ARGV.join(' ')} && source ~/.rvm/scripts/rvm'"]
5
5
 
data/rvm.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.0.25"
8
+ s.version = "0.0.27"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Wayne E. Seguin"]
12
- s.date = %q{2009-08-30}
12
+ s.date = %q{2009-08-31}
13
13
  s.description = %q{Manages Ruby interpreter installations and switching between them.}
14
14
  s.email = %q{wayneeseguin@gmail.com}
15
15
  s.executables = ["rvm-install", "rvm-update"]
data/scripts/rvm CHANGED
@@ -7,32 +7,23 @@
7
7
  #
8
8
  # Functions
9
9
  #
10
- function rvm-meta {
10
+ function __rvm_meta {
11
11
  rvm_meta_author="Wayne E. Seguin"
12
12
  rvm_meta_author_email="wayneeseguin@gmail.com"
13
13
  rvm_meta_website="http://rvm.beginrescueend.com/"
14
- rvm_meta_version="0.0.25"
15
- rvm_meta_updated="2009.08.25"
14
+ rvm_meta_version="0.0.27"
15
+ rvm_meta_updated="2009.08.31"
16
16
  }
17
17
 
18
- function rvm-version { rvm-meta ; echo "rvm $rvm_meta_version ($rvm_meta_updated) [$rvm_meta_website]" ; }
18
+ function __rvm_version { __rvm_meta ; echo "rvm $rvm_meta_version ($rvm_meta_updated) [$rvm_meta_website]" ; }
19
19
 
20
- function rvm-usage {
20
+ function __rvm_usage {
21
21
 
22
- rvm-meta
22
+ __rvm_meta
23
23
 
24
24
  cat <<-Usage
25
25
 
26
- About:
27
-
28
- rvm ${rvm_meta_version} ${rvm_meta_website}
29
-
30
- by ${rvm_meta_author} (${rvm_meta_author_email})
31
-
32
- Installation:
33
-
34
- $ gem install rvm # Install the rvm gem
35
- $ rvm-install # Install rvm, adds hooks for bash & zsh
26
+ rvm ${rvm_meta_version} ${rvm_meta_website} by ${rvm_meta_author} (${rvm_meta_author_email})
36
27
 
37
28
  Usage:
38
29
 
@@ -53,15 +44,18 @@ function rvm-usage {
53
44
  reset - Remove default and current settings, exit the shell.
54
45
  (If you experience odd behavior try this first)
55
46
  reload - Reload rvm source itself (useful after changing rvm source)
47
+ rubydo - Used with -f to run a ruby file against specified or all rubies
56
48
  debug - Emit environment & configuration information for *current* ruby
49
+ implode - Removes all ruby installations it manages, everything in ~/.rvm
57
50
 
58
51
  Implementation:
59
52
 
60
53
  * ruby - MRI/YARV Ruby (The Standard), defaults to 1.8.6
61
54
  jruby - jRuby
55
+ rubinius - Rubinius
62
56
  ree - Ruby Enterprise Edition
63
- default - Resets to the default system ruby
64
- all - Used with install, installs all latest known versions
57
+ system - Use the system ruby (eg. pre-rvm state)
58
+ default - Use rvm set default ruby and system if it hasn't been set.
65
59
 
66
60
  Options:
67
61
 
@@ -72,15 +66,34 @@ function rvm-usage {
72
66
  -c|--configure - Options for source compile (default: --enable-shared)
73
67
  -a|--archives - Directory to place downladed files into (~/.rvm/archives/)
74
68
  -n|--nice - Niceness level (default: 0)
75
- -d|--debug - Toggle debug mode on for very verbose output.
76
69
  -m|--gem-set - Named gem set for switching between different gem sets
77
70
  --rm-gem-set - Removes a named gemset.
78
71
 
72
+ -l|--level - Specify a patch level to use
73
+ -t|--tag -
74
+ -r|--rev - Specify the repository revision # to use or 'head' for
75
+
76
+ -P|--prefix - Sets the prefix path for installs to be installed to
77
+ -B|--bin - Specifies the path for binaries to be placed
78
+ -S|--source - Specifies the src directory to use
79
+ -A|--archive - Specifies the archive directory to use (tabralls / zips)
80
+ -G|--gems - Specifies the root gem path to use
81
+ -C|--configure - Specifies any custom command line configure options
82
+ -M|--make - Specify a custom make command
83
+ -I|--make-install - " a custom make install command
84
+
85
+ -n|--nice - Specify a process niceness (for slow computers)
86
+ -f|--file - Specify a ruby file to run with 'rubydo' command
87
+ -h|--help - Emit this output and exit
88
+ -d|--default - Set the default Ruby to a specified version
89
+ -m|--gem-set - Use a named gem set instead of the default set.
90
+ --rm-gem-set - Remove a named gem set
91
+ --jit - Enable JIT for the Rubinius build
92
+ --debug - Toggle debug mode on for very verbose output.
93
+
79
94
  Resources:
80
95
 
81
- http://rvm.beginrescueend.com/notes/
82
- http://rvm.beginrescueend.com/examples/
83
- http://rvm.beginrescueend.com/todo/
96
+ http://rvm.beginrescueend.com/
84
97
  https://www.pivotaltracker.com/projects/26822
85
98
 
86
99
  Usage
@@ -88,7 +101,7 @@ Usage
88
101
  }
89
102
 
90
103
  # Logging functions based on level
91
- function rvm-log {
104
+ function __rvm_log {
92
105
 
93
106
  case "$1" in
94
107
  debug) shift ; echo -e "\n\033[0;35m <d> $* \033[0m" ;;
@@ -99,22 +112,22 @@ function rvm-log {
99
112
  esac
100
113
  }
101
114
 
102
- function rvm-clean-path {
115
+ function __rvm_clean-path {
103
116
  PATH=`echo $PATH | tr -s ':' '\n' | awk '!($0 in a){a[$0];print}' | tr -s '\n' ':'`
104
117
  PATH="${PATH%:}"
105
118
  export PATH
106
119
  }
107
120
 
108
- function rvm-remove-from-path {
121
+ function __rvm_remove-from-path {
109
122
  PATH=`echo $PATH | tr -s ':' '\n' | grep -v "\.rvm" | tr -s '\n' ':'`
110
123
  PATH="${PATH%:}"
111
124
  export PATH
112
125
  }
113
126
 
114
- function rvm-gi { gem install -q --no-rdoc --no-ri $* ; }
115
- function rvm-gems-install { for gem in $* ; do rvm-gi $gem ; done }
127
+ function __rvm_gi { gem install -q --no-rdoc --no-ri $* ; }
128
+ function __rvm_gems-install { for gem in $* ; do __rvm_gi $gem ; done }
116
129
 
117
- function rvm-set-defaults {
130
+ function __rvm_set-defaults {
118
131
 
119
132
  # TODO: Store defaults in "defaults/" dir.
120
133
  if [ ! -f $rvm_install_path/default ] ; then
@@ -128,16 +141,16 @@ function rvm-set-defaults {
128
141
  if [ -s $rvm_install_path/default_path ] ; then
129
142
  rvm_default_path=`cat $rvm_install_path/default_path`
130
143
  else
131
- rvm-clean-path # Clean the path the first time we compute default path.
132
- rvm-remove-from-path
144
+ __rvm_clean-path # Clean the path the first time we compute default path.
145
+ __rvm_remove-from-path
133
146
  echo $PATH > $rvm_install_path/default_path
134
147
  rvm_default_path=$PATH
135
148
  fi
136
149
 
137
- rvm_default_ps1=`rvm-cache rvm_default_ps1`
150
+ rvm_default_ps1=`__rvm_cache rvm_default_ps1`
138
151
  if [ -z "$rvm_default_ps1" ] ; then
139
152
  rvm_default_ps1=$PS1
140
- rvm-cache "rvm_default_ps1" "$rvm_default_ps1"
153
+ __rvm_cache "rvm_default_ps1" "$rvm_default_ps1"
141
154
  fi
142
155
 
143
156
  if [ -s $rvm_install_path/default_user_gem_path ] ; then
@@ -161,11 +174,11 @@ function rvm-set-defaults {
161
174
 
162
175
  }
163
176
 
164
- function rvm-initialize {
177
+ function __rvm_initialize {
165
178
 
166
179
  rvm_curl=`which curl`
167
180
  if [ $? -ne 0 ] ; then
168
- rvm-log "fail" "rvm expects that curl is available, which curl shows no curl :("
181
+ __rvm_log "fail" "rvm expects that curl is available, which curl shows no curl :("
169
182
  else
170
183
  rvm_curl="$rvm_curl -O -L -s -C - "
171
184
  fi
@@ -174,7 +187,7 @@ function rvm-initialize {
174
187
 
175
188
  # TODO: Sanitize user input, ensure that there is a / a the end...
176
189
  if [ "`whoami`" = "root" ] ; then
177
- rvm-log "fail" "root user support is not yet implemented."
190
+ __rvm_log "fail" "root user support is not yet implemented."
178
191
  #rvm_prefix_path=${rvm_prefix_path:-/usr/local/}
179
192
  else
180
193
  rvm_prefix_path=${rvm_prefix_path:-"$HOME/."}
@@ -192,6 +205,7 @@ function rvm-initialize {
192
205
  rvm_config_path=${rvm_config_path:-"${rvm_install_path}/config"}
193
206
 
194
207
  rvm_ruby_repo_url="${rvm_ruby_repo_url:-"http://svn.ruby-lang.org/repos/ruby"}"
208
+ # Rubinius sha1's will be available after RC1.
195
209
  rvm_rubinius_repo_url="${rvm_rubinius_repo_url:-"git://github.com/evanphx/rubinius.git"}"
196
210
  rvm_macruby_repo_url="${rvm_macruby_repo_url:-"http://svn.macosforge.org/repository/ruby/MacRuby"}"
197
211
  rvm_jruby_repo_url="${rvm_jruby_repo_url:-"git://kenai.com/jruby~main"}"
@@ -199,7 +213,7 @@ function rvm-initialize {
199
213
  if [ ! -z "$rvm_ruby_configure" ] ; then
200
214
  rvm_ruby_configure="$(echo $rvm_ruby_configure | tr ',-' ' -')"
201
215
  fi
202
- rvm-clean-path
216
+ __rvm_clean-path
203
217
  rvm_result=$(echo $PATH | grep 'rvm\/bin:')
204
218
  if [ -z $rvm_result ] ; then
205
219
  PATH=$rvm_bin_path:$PATH ; export PATH
@@ -208,7 +222,7 @@ function rvm-initialize {
208
222
  mkdir -p $rvm_source_path $rvm_install_path/bin $rvm_archives_path
209
223
  }
210
224
 
211
- function rvm-curl {
225
+ function __rvm_curl {
212
226
 
213
227
  pushd $rvm_archives_path > /dev/null
214
228
  eval $rvm_curl "$1"
@@ -216,11 +230,11 @@ function rvm-curl {
216
230
 
217
231
  }
218
232
 
219
- function rvm-install-source {
233
+ function __rvm_install-source {
220
234
 
221
- if [ -z "$rvm_selected" ] ; then rvm-select $* ; fi
235
+ if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
222
236
 
223
- rvm-log "info" "Installing Ruby from source to: $rvm_install_path/$rvm_ruby_package_name"
237
+ __rvm_log "info" "Installing Ruby from source to: $rvm_install_path/$rvm_ruby_package_name"
224
238
  mkdir -p $rvm_log_path/$rvm_ruby_package_name
225
239
 
226
240
  pushd $rvm_source_path > /dev/null
@@ -228,10 +242,10 @@ function rvm-install-source {
228
242
  if [ -z "$rvm_ruby_tag" -a -z "$rvm_ruby_rev" ] ; then
229
243
  if [ ! -d $rvm_source_path/$rvm_ruby_package_name ] ; then
230
244
  rvm_url="${rvm_url:-"ftp://ftp.ruby-lang.org/pub/ruby/1.$rvm_major_version/$rvm_ruby_package_name.tar.gz"}"
231
- rvm-log "info" "\tDownloading $rvm_ruby_package_name, this may take a while depending on your connection..."
232
- rvm-curl $rvm_url
245
+ __rvm_log "info" "\tDownloading $rvm_ruby_package_name, this may take a while depending on your connection..."
246
+ __rvm_curl $rvm_url
233
247
 
234
- rvm-log "info" "\tExtracting $rvm_ruby_package_name ..."
248
+ __rvm_log "info" "\tExtracting $rvm_ruby_package_name ..."
235
249
  mkdir -p $rvm_source_path/$rvm_ruby_package_name
236
250
  nice -n $rvm_niceness tar xzf $rvm_archives_path/$rvm_ruby_package_name.tar.gz -C $rvm_source_path
237
251
  fi
@@ -250,7 +264,7 @@ function rvm-install-source {
250
264
  rvm_rev="-r $rvm_ruby_rev"
251
265
  fi
252
266
  fi
253
- rvm-log "info" "\tRetrieving Ruby from $rvm_url"
267
+ __rvm_log "info" "\tRetrieving Ruby from $rvm_url"
254
268
  mkdir -p $rvm_source_path/$rvm_ruby_package_name
255
269
  # TODO: Instead of always forcing, check if it's already svn for correct url and simply check out required revision
256
270
  svn checkout -q $rvm_rev --force $rvm_url $rvm_source_path/$rvm_ruby_package_name
@@ -259,36 +273,39 @@ function rvm-install-source {
259
273
  fi
260
274
 
261
275
  if [ -s ./configure ] ; then
262
- rvm-log "info" "\tConfiguring $rvm_ruby_package_name using ${rvm_ruby_configure:-"--enable-shared"}, this may take a while depending on your cpu(s)..."
276
+ __rvm_log "info" "\tConfiguring $rvm_ruby_package_name using ${rvm_ruby_configure:-"--enable-shared"}, this may take a while depending on your cpu(s)..."
263
277
  nice -n $rvm_niceness ./configure --prefix=$rvm_install_path/$rvm_ruby_package_name ${rvm_ruby_configure:-"--enable-shared"} > $rvm_log_path/$rvm_ruby_package_name/configure.log 2> $rvm_log_path/$rvm_ruby_package_name/configure.error.log
278
+ if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
264
279
  else
265
- rvm-log "warn" "\tSkipping configure step, ./configure file does not exist."
280
+ __rvm_log "warn" "\tSkipping configure step, ./configure file does not exist."
266
281
  fi
267
282
 
268
- rvm-log "info" "\tCompiling $rvm_ruby_package_name, this may take a while, depending on your cpu(s)..."
283
+ __rvm_log "info" "\tCompiling $rvm_ruby_package_name, this may take a while, depending on your cpu(s)..."
269
284
  if [ -z "$rvm_ruby_make" ] ; then
270
285
  nice -n $rvm_niceness make > $rvm_log_path/$rvm_ruby_package_name/make.log 2> $rvm_log_path/$rvm_ruby_package_name/make.error.log
271
286
  else
272
287
  nice -n $rvm_niceness $rvm_ruby_make > $rvm_log_path/$rvm_ruby_package_name/install.log 2> $rvm_log_path/$rvm_ruby_package_name/install.error.log
273
288
  fi
289
+ if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
274
290
  if [ -z "$rvm_ruby_make" ] ; then
275
- rvm-log "info" "\tInstalling $rvm_ruby_package_name"
291
+ __rvm_log "info" "\tInstalling $rvm_ruby_package_name"
276
292
  nice -n $rvm_niceness make install > $rvm_log_path/$rvm_ruby_package_name/install.log 2> $rvm_log_path/$rvm_ruby_package_name/install.error.log
277
293
  else
278
294
  nice -n $rvm_niceness $rvm_ruby_make_install > $rvm_log_path/$rvm_ruby_package_name/install.log 2> $rvm_log_path/$rvm_ruby_package_name/install.error.log
279
295
  fi
296
+ if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
280
297
 
281
298
  chmod +x $rvm_install_path/$rvm_ruby_package_name/bin/*
282
299
 
283
300
  ln -fs $rvm_install_path/$rvm_ruby_package_name/bin/ruby $rvm_install_path/bin/$rvm_ruby_package_name
284
301
 
285
- rvm-log "info" "\tInstalling rubygems dedicated to $rvm_ruby_package_name..."
302
+ __rvm_log "info" "\tInstalling rubygems dedicated to $rvm_ruby_package_name..."
286
303
  rvm_gem_package_name="rubygems-1.3.5"
287
304
  rvm_gem_url="http://rubyforge.org/frs/download.php/60718/$rvm_gem_package_name.tgz"
288
305
  if [ -d $rvm_source_path/$rvm_gem_package_name ] ; then
289
306
  cd $rvm_source_path/$rvm_gem_package_name
290
307
  else
291
- rvm-curl $rvm_gem_url
308
+ __rvm_curl $rvm_gem_url
292
309
  mkdir -p $rvm_source_path/$rvm_gem_package_name
293
310
  nice -n $rvm_niceness tar zxf $rvm_archives_path/$rvm_gem_package_name.tgz -C $rvm_source_path
294
311
  fi
@@ -297,17 +314,17 @@ function rvm-install-source {
297
314
 
298
315
  nice -n $rvm_niceness $rvm_install_path/$rvm_ruby_package_name/bin/ruby $rvm_source_path/$rvm_gem_package_name/setup.rb > $rvm_log_path/$rvm_ruby_package_name/rubygems.install.log 2> $rvm_log_path/$rvm_ruby_package_name/rubygems.install.error.log
299
316
  popd > /dev/null
300
- rvm-log "info" "Installation of $rvm_ruby_package_name complete."
317
+ __rvm_log "info" "Installation of $rvm_ruby_package_name complete."
301
318
 
302
319
  for rvm_gem_name in rake ; do
303
- rvm-log "info" "Installing $rvm_gem_name"
320
+ __rvm_log "info" "Installing $rvm_gem_name"
304
321
  nice -n $rvm_niceness $rvm_install_path/$rvm_ruby_package_name/bin/gem install $rvm_gem_name --no-rdoc --no-ri -q >> $rvm_log_path/$rvm_ruby_package_name/gems.install.log 2> $rvm_log_path/$rvm_ruby_package_name/gems.error.log
305
322
  done
306
323
  }
307
324
 
308
- function rvm-install-ruby {
325
+ function __rvm_install-ruby {
309
326
 
310
- if [ -z "$rvm_selected" ] ; then rvm-select $* ; fi
327
+ if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
311
328
 
312
329
  if [ -z "$RUBYOPT" ] ; then ruby_options=$RUBYOPT ; unset RUBYOPT ; fi
313
330
 
@@ -334,65 +351,68 @@ function rvm-install-ruby {
334
351
  rvm_ruby_rev="-r $rvm_ruby_rev"
335
352
  fi
336
353
  fi
337
- rvm-log "info" "\tRetrieving MacRuby from $rvm_url"
354
+ __rvm_log "info" "\tRetrieving MacRuby from $rvm_url"
338
355
  #mkdir -p $rvm_source_path/$rvm_ruby_package_name
339
356
  # TODO: Instead of always forcing, check if it's already svn for correct url and simply check out required revision
340
357
  #svn checkout -q $rvm_rev --force $rvm_url $rvm_source_path/$rvm_ruby_package_name
341
358
  cd $rvm_source_path/$rvm_ruby_package_name
342
- rvm-install-source
359
+ __rvm_install-source
343
360
  unset DESTDIR
344
361
  else
345
- rvm-log "fail" "MacRuby can only be installed on a Darwin OS."
362
+ __rvm_log "fail" "MacRuby can only be installed on a Darwin OS."
346
363
  fi
347
364
  ;;
348
365
 
349
366
  ruby-enterprise|ree)
350
367
  rvm_url="http://rubyforge.org/frs/download.php/58677/$rvm_ruby_package_name.tar.gz"
351
- rvm-log "info" "Installing Ruby Enterprise Edition from source to: $rvm_install_path/$rvm_ruby_package_name"
368
+ __rvm_log "info" "Installing Ruby Enterprise Edition from source to: $rvm_install_path/$rvm_ruby_package_name"
352
369
  pushd $rvm_source_path > /dev/null
353
370
  if [ -d $rvm_source_path/$rvm_ruby_package_name ] ; then
354
371
  cd $rvm_source_path/$rvm_ruby_package_name
355
372
  else
356
- rvm-log "info" "\tDownloading $rvm_ruby_package_name, this may take a while depending on your connection..."
357
- rvm-curl $rvm_url
358
- rvm-log "info" "\tExtracting $rvm_ruby_package_name..."
373
+ __rvm_log "info" "\tDownloading $rvm_ruby_package_name, this may take a while depending on your connection..."
374
+ __rvm_curl $rvm_url
375
+ __rvm_log "info" "\tExtracting $rvm_ruby_package_name..."
359
376
  mkdir -p $rvm_source_path/$rvm_ruby_package_name
360
377
  nice -n $rvm_niceness tar xzf $rvm_archives_path/$rvm_ruby_package_name.tar.gz -C $rvm_source_path
361
378
  fi
379
+ if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
362
380
 
363
- rvm-log "info" "\tInstalling $rvm_ruby_package_name, this may take a while, depending on your cpu(s)..."
381
+ __rvm_log "info" "\tInstalling $rvm_ruby_package_name, this may take a while, depending on your cpu(s)..."
364
382
  mkdir -p $rvm_log_path/$rvm_ruby_package_name
365
383
 
366
384
  cd $rvm_source_path/$rvm_ruby_package_name
367
385
  nice -n $rvm_niceness ./installer -a $rvm_install_path/ruby-enterprise-$rvm_ruby_version-$rvm_ruby_patch_level --dont-install-useful-gems --no-tcmalloc > $rvm_log_path/$rvm_ruby_package_name/install.log 2> $rvm_log_path/$rvm_ruby_package_name/install.error.log
386
+ if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
368
387
  chmod +x $rvm_install_path/$rvm_ruby_package_name/bin/*
369
388
 
370
389
  ln -fs $rvm_install_path/$rvm_ruby_package_name/bin/ruby $rvm_install_path/bin/$rvm_ruby_package_name
371
390
 
372
- rvm-log "info" "\tInstalling rubygems dedicated to $rvm_ruby_package_name..."
391
+ __rvm_log "info" "\tInstalling rubygems dedicated to $rvm_ruby_package_name..."
373
392
  rvm_gem_package_name="rubygems-1.3.5"
374
393
  rvm_gem_url="http://rubyforge.org/frs/download.php/60718/$rvm_gem_package_name.tgz"
375
394
  if [ -d $rvm_source_path/$rvm_gem_package_name ] ; then
376
395
  cd $rvm_source_path/$rvm_gem_package_name
377
396
  else
378
- rvm-curl $rvm_gem_url
397
+ __rvm_curl $rvm_gem_url
379
398
  mkdir -p $rvm_source_path/$rvm_gem_package_name
380
399
  nice -n $rvm_niceness tar zxf $rvm_archives_path/$rvm_gem_package_name.tgz -C $rvm_source_path
381
400
  fi
401
+ if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
382
402
  # Well this is fun... fix nil error on require_paths:
383
403
  sed -i.orig "s/require_paths\.join/require_paths.to_a.join/" $rvm_source_path/$rvm_gem_package_name/lib/rubygems/gem_path_searcher.rb > $rvm_log_path/$rvm_ruby_package_name/rubygems.install.log 2> $rvm_log_path/$rvm_ruby_package_name/rubygems.install.error.log
384
404
 
385
405
  nice -n $rvm_niceness $rvm_install_path/$rvm_ruby_package_name/bin/ruby $rvm_source_path/$rvm_gem_package_name/setup.rb > $rvm_log_path/$rvm_ruby_package_name/rubygems.install.log 2> $rvm_log_path/$rvm_ruby_package_name/rubygems.install.error.log
386
- rvm-log "info" "Installation of $rvm_ruby_package_name complete."
406
+ __rvm_log "info" "Installation of $rvm_ruby_package_name complete."
387
407
  popd > /dev/null
388
408
 
389
409
  for rvm_gem_name in rake ; do
390
- rvm-log "info" "Installing $rvm_gem_name"
410
+ __rvm_log "info" "Installing $rvm_gem_name"
391
411
  nice -n $rvm_niceness $rvm_install_path/$rvm_ruby_package_name/bin/gem install $rvm_gem_name --no-rdoc --no-ri -q >> $rvm_log_path/$rvm_ruby_package_name/gems.install.log 2> $rvm_log_path/$rvm_ruby_package_name/gems.error.log
392
412
  done
393
413
  ;;
394
414
 
395
- rubinius)
415
+ rbx|rubinius)
396
416
  rvm_ruby_repo_url=$rvm_rubinius_repo_url
397
417
  rvm_ruby_configure=""
398
418
  rvm_ruby_make="rake"
@@ -403,7 +423,8 @@ function rvm-install-ruby {
403
423
  rm -rf $rvm_install_path/$rvm_ruby_interpreter-$rvm_ruby_version
404
424
  git clone --depth 1 $rvm_ruby_repo_url $rvm_install_path/$rvm_ruby_interpreter-$rvm_ruby_version
405
425
  fi
406
- cd $rvm_install_path/$rvm_ruby_interpreter-$rvm_ruby_version && rake build
426
+ cd $rvm_install_path/$rvm_ruby_interpreter-$rvm_ruby_version && $rvm_rubinius_jit rake build
427
+ if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
407
428
  for binary in ruby irb ; do
408
429
  ln -fs $rvm_install_path/$rvm_ruby_interpreter-$rvm_ruby_version/bin/rbx $rvm_install_path/$rvm_ruby_interpreter-$rvm_ruby_version/bin/$binary
409
430
  done
@@ -414,7 +435,7 @@ function rvm-install-ruby {
414
435
  rvm_url="http://dist.codehaus.org/$rvm_ruby_interpreter/$rvm_ruby_version/$rvm_package_file.zip"
415
436
  rvm_jruby_repo_url="${rvm_jruby_repo_url:-"git://kenai.com/jruby~main"}"
416
437
 
417
- rvm-log "info" "Installing jRuby to: $rvm_install_path/$rvm_ruby_package_name"
438
+ __rvm_log "info" "Installing jRuby to: $rvm_install_path/$rvm_ruby_package_name"
418
439
  mkdir -p $rvm_log_path/$rvm_ruby_package_name
419
440
  pushd $rvm_source_path > /dev/null
420
441
 
@@ -428,17 +449,19 @@ function rvm-install-ruby {
428
449
  if [ -d $rvm_source_path/$rvm_ruby_package_name ] ; then
429
450
  cd $rvm_source_path/$rvm_ruby_package_name
430
451
  else
431
- rvm-log "info" "\tDownloading $rvm_package_file, this may take a while depending on your connection..."
432
- rvm-curl $rvm_url
433
- rvm-log "info" "\tExtracting $rvm_package_file..."
452
+ __rvm_log "info" "\tDownloading $rvm_package_file, this may take a while depending on your connection..."
453
+ __rvm_curl $rvm_url
454
+ __rvm_log "info" "\tExtracting $rvm_package_file..."
434
455
  nice -n $rvm_niceness unzip -q $rvm_archives_path/$rvm_package_file.zip -d $rvm_source_path
435
456
  cd $rvm_source_path/$rvm_ruby_package_name
436
457
  fi
437
458
  fi
459
+ if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
438
460
 
439
- rvm-log "info" "\tInstalling $rvm_ruby_package_name..."
461
+ __rvm_log "info" "\tInstalling $rvm_ruby_package_name..."
440
462
  mkdir -p $rvm_install_path/$rvm_ruby_package_name/bin/
441
463
  rsync -ag $rvm_source_path/$rvm_ruby_package_name/ $rvm_install_path/$rvm_ruby_package_name/
464
+ if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
442
465
  cd $rvm_source_path/$rvm_ruby_package_name/tool/nailgun && make > $rvm_log_path/$rvm_ruby_package_name/install.nailgun.log 2> $rvm_log_path/$rvm_ruby_package_name/install.error.nailgun.log
443
466
  popd > /dev/null
444
467
  chmod +x $rvm_install_path/$rvm_ruby_package_name/bin/*
@@ -449,19 +472,19 @@ function rvm-install-ruby {
449
472
  ln -fs $rvm_install_path/$rvm_ruby_package_name/bin/ruby $rvm_install_path/bin/$rvm_ruby_package_name
450
473
 
451
474
  for rvm_gem_name in rake jruby-openssl ; do
452
- rvm-log "info" "Installing $rvm_gem_name"
475
+ __rvm_log "info" "Installing $rvm_gem_name"
453
476
  nice -n $rvm_niceness $rvm_install_path/$rvm_ruby_package_name/bin/jgem install $rvm_gem_name --no-rdoc --no-ri -q >> $rvm_log_path/$rvm_ruby_package_name/gems.install.log 2> $rvm_log_path/$rvm_ruby_package_name/gems.error.log
454
477
  done
455
478
  ;;
456
479
 
457
480
  ruby)
458
- rvm-install-source $*
481
+ __rvm_install-source $*
459
482
  ;;
460
483
 
461
484
  default)
462
- rvm-log "fail" "please specify a ruby implementation to install."
485
+ __rvm_log "fail" "please specify a ruby implementation to install."
463
486
  ;;
464
- *) rvm-log "fail" "Ruby implementation '$rvm_ruby_interpreter' is not known."
487
+ *) __rvm_log "fail" "Ruby implementation '$rvm_ruby_interpreter' is not known."
465
488
 
466
489
  esac
467
490
 
@@ -471,17 +494,17 @@ function rvm-install-ruby {
471
494
 
472
495
  }
473
496
 
474
- function rvm-uninstall {
497
+ function __rvm_uninstall {
475
498
 
476
- if [ -z "$rvm_selected" ] ; then rvm-select $* ; fi
499
+ if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
477
500
 
478
501
  if [ ! -z "$rvm_ruby_package_name" ] ; then
479
502
  for dir in $rvm_source_path $rvm_install_path ; do
480
503
  if [ -d $dir/$rvm_ruby_package_name ] ; then
481
- rvm-log "info" "Removing $dir/$rvm_ruby_package_name..."
504
+ __rvm_log "info" "Removing $dir/$rvm_ruby_package_name..."
482
505
  rm -rf $dir/$rvm_ruby_package_name
483
506
  else
484
- rvm-log "info" "it seems that $dir/$rvm_ruby_package_name is already non existent."
507
+ __rvm_log "info" "it seems that $dir/$rvm_ruby_package_name is already non existent."
485
508
  fi
486
509
  if [ -e $rvm_bin_path/$rvm_ruby_package_name ] ; then
487
510
  rm -f $rvm_bin_path/$rvm_ruby_package_name
@@ -489,13 +512,13 @@ function rvm-uninstall {
489
512
  done ; unset dir
490
513
  rm -rf $rvm_gem_path/$rvm_ruby_interpreter/$rvm_ruby_version*/
491
514
  else
492
- rvm-log "fail" "Cannot uninstall unknown package '$rvm_ruby_package_name'"
515
+ __rvm_log "fail" "Cannot uninstall unknown package '$rvm_ruby_package_name'"
493
516
  fi
494
517
 
495
518
  }
496
519
 
497
- # rvm-select implementation version patch_level
498
- function rvm-select {
520
+ # __rvm_select implementation version patch_level
521
+ function __rvm_select {
499
522
 
500
523
  rvm_ruby_interpreter="${1:-$rvm_ruby_interpreter}"
501
524
  rvm_ruby_interpreter="${rvm_ruby_interpreter:-ruby}" # Default is standard ruby
@@ -510,11 +533,12 @@ function rvm-select {
510
533
  rvm_ruby_version="head" # For now we are only supporting latest
511
534
  unset rvm_ruby_patch_level
512
535
  else
513
- rvm-log "fail" "MacRuby can only be installed on a Darwin OS."
536
+ __rvm_log "fail" "MacRuby can only be installed on a Darwin OS."
514
537
  fi
515
538
  ;;
516
539
 
517
- rubinius)
540
+ rbx|rubinius)
541
+ rvm_ruby_version="head"
518
542
  rvm_ruby_version="head"
519
543
  unset rvm_ruby_patch_level
520
544
  rvm_ruby_repo_url=$rvm_rubinius_repo_url
@@ -528,7 +552,7 @@ function rvm-select {
528
552
  rvm_ruby_version="${rvm_ruby_version:-1.3.1}"
529
553
  unset rvm_ruby_patch_level
530
554
  if [ "$rvm_ruby_version" != "1.2.0" -a "$rvm_ruby_version" != "1.3.1" ] ; then
531
- rvm-log "fail" "Unknown jRuby version: $rvm_ruby_version"
555
+ __rvm_log "fail" "Unknown jRuby version: $rvm_ruby_version"
532
556
  fi
533
557
  alias jruby_ng="jruby --ng"
534
558
  alias jruby_ng_server="jruby --ng-server"
@@ -540,7 +564,7 @@ function rvm-select {
540
564
  rvm_ruby_patch_level="${3:-20090610}"
541
565
 
542
566
  if [ "$rvm_ruby_version" != "1.8.6" ] ; then
543
- rvm-log "fail" "Unknown Ruby Enterprise Edition version: $rvm_ruby_version"
567
+ __rvm_log "fail" "Unknown Ruby Enterprise Edition version: $rvm_ruby_version"
544
568
  fi
545
569
  ;;
546
570
 
@@ -570,19 +594,15 @@ function rvm-select {
570
594
  unset rvm_ruby_patch_level
571
595
 
572
596
  else
573
- rvm-log "fail" "Unknown ruby version: $rvm_ruby_version"
597
+ __rvm_log "fail" "Unknown ruby version: $rvm_ruby_version"
574
598
  fi
575
599
  ;;
576
600
 
577
- system|default)
578
- unset rvm_ruby_interpreter rvm_ruby_version
579
- rvm-cleanup-variables
580
- if [ -e $rvm_install_path/current ] ; then
581
- source $rvm_install_path/current
582
- fi
601
+ default|system)
602
+ #noop?
583
603
  ;;
584
604
  *)
585
- rvm-log "fail" "Ruby implementation '$rvm_ruby_interpreter' is not known."
605
+ __rvm_log "fail" "Ruby implementation '$rvm_ruby_interpreter' is not known."
586
606
  esac
587
607
 
588
608
  if [ ! -z "$rvm_ruby_rev" ] ; then
@@ -625,17 +645,18 @@ function rvm-select {
625
645
 
626
646
  }
627
647
 
628
- function rvm-use {
648
+ function __rvm_use {
629
649
 
630
- if [ -z "$rvm_selected" ] ; then rvm-select $* ; fi
650
+ if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
651
+ if [ -z "$rvm_ruby_interpreter" ] ; then rvm_ruby_interpreter="default" ; fi
631
652
 
632
- if [ "$rvm_ruby_interpreter" = "default" -o "$rvm_ruby_interpreter" = "system" -o -z "$rvm_ruby_interpreter" ] ; then
653
+ if [ "$rvm_ruby_interpreter" = "default" -o "$rvm_ruby_interpreter" = "system" ] ; then
633
654
  unset GEM_HOME MY_RUBY_HOME IRBRC
634
- rvm-cleanup-variables
635
655
  PATH="$rvm_default_path" ; export PATH
636
- if [ -e $rvm_install_path/current ] ; then
656
+ if [ "$rvm_ruby_interpreter" = "default" -a -s $rvm_install_path/current ] ; then
637
657
  source $rvm_install_path/current
638
658
  fi
659
+
639
660
  else
640
661
  GEM_HOME=$rvm_gem_home ; export GEM_HOME
641
662
  MY_RUBY_HOME=$rvm_ruby_home ; export MY_RUBY_HOME
@@ -643,12 +664,13 @@ function rvm-use {
643
664
 
644
665
  # Install if not installed
645
666
  if [ ! -d $MY_RUBY_HOME ] ; then
646
- rvm-log "warn" "$rvm_ruby_interpreter $rvm_ruby_version is not installed."
647
- rvm-install-ruby $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level
667
+ __rvm_log "warn" "$rvm_ruby_interpreter $rvm_ruby_version is not installed."
668
+ __rvm_install-ruby $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level
648
669
  fi
649
670
 
650
671
  if [ ! -s "$rvm_ruby_irbrc" ] ; then
651
672
  rvm_irbrc_file=$(cat <<Config
673
+ require "irb/completion" rescue nil
652
674
  @prompt = {
653
675
  :PROMPT_I => "${rvm_ruby_package_name} > ", # default prompt
654
676
  :PROMPT_S => "${rvm_ruby_package_name}%l> ", # known continuation
@@ -661,16 +683,18 @@ function rvm-use {
661
683
  IRB.conf[:PROMPT][@prompt_mode] = @prompt
662
684
  IRB.conf[:PROMPT_MODE] = @prompt_mode
663
685
 
664
- require "irb/completion" rescue nil
665
686
  Config
666
687
  )
667
- # TODO: Prepend users irbrc, keep custom path
668
- echo "$rvm_irbrc_file" > $rvm_ruby_home/.irbrc
688
+ if [ -s ~/.irbrc ] ; then
689
+ cat ~/.irbrc > $rvm_ruby_home/.irbrc
690
+ fi
691
+ echo "$rvm_irbrc_file" >> $rvm_ruby_home/.irbrc
669
692
  fi
670
693
  PATH=$MY_RUBY_HOME/bin:$GEM_HOME/bin:$rvm_default_path ; export PATH
671
694
 
672
- if [ ! -z "$PS1" ] ; then
673
- PS1="\033[0;32m${rvm_ruby_package_name}\033[0m:: ${rvm_default_ps1}" ; export PS1
695
+ rvm_prompt="$rvm_ruby_package_name" ; export rvm_prompt
696
+ if [ ! -z "$rvm_set_prompt" -a ! -z "$PS1" ] ; then
697
+ PS1="\033[0;32m${rvm_prompt}\033[0m:: ${rvm_default_ps1}" ; export PS1
674
698
  fi
675
699
 
676
700
  if [ ! -z "$rvm_set_default" ] ; then
@@ -688,7 +712,7 @@ Config
688
712
  fi
689
713
  }
690
714
 
691
- function rvm-symlinks {
715
+ function __rvm_symlinks {
692
716
 
693
717
  mkdir -p ${rvm_install_path}/bin
694
718
  for release in `/bin/ls $rvm_install_path | grep 'ruby-'` ; do
@@ -701,7 +725,7 @@ function rvm-symlinks {
701
725
 
702
726
  }
703
727
 
704
- function rvm-list {
728
+ function __rvm_list {
705
729
 
706
730
  echo -e "\nruby:\n$(/bin/ls -l $rvm_install_path/ | awk '/ ruby-[1-2].*/ { print " - " $NF }')\n"
707
731
  echo -e "jruby:\n$(/bin/ls -l $rvm_install_path/ | awk '/jruby-.*/ { print " - " $NF }')\n"
@@ -710,48 +734,67 @@ function rvm-list {
710
734
 
711
735
  }
712
736
 
713
- function rvm-reset {
714
-
715
- rvm-select "default"
737
+ function __rvm_reset {
716
738
 
717
739
  PATH="$rvm_default_path" ; export PATH
718
740
  for variable in RUBY_VERSION GEM_HOME MY_RUBY_HOME ; do unset $variable ; done
719
741
  rm -f $rvm_install_path/default*
720
742
  rm -f $rvm_install_path/current
721
743
 
744
+ __rvm_select "system"
745
+
722
746
  }
723
747
 
724
- function rvm-gem-dir {
748
+ function __rvm_implode {
749
+ while : ; do
750
+ __rvm_log "warn" "Are you SURE you wish for rvm to implode? This will remove $rvm_install_path ? (type 'yes' or 'no')"
751
+ read response
752
+ if [ "$response" = "yes" ] ; then
753
+ if [ -d $rvm_install_path ] ; then
754
+ __rvm_log "info" "Hai! Removing $rvm_install_path"
755
+ rm -rf $rvm_install_path/
756
+ else
757
+ __rvm_log "info" "It appears that $rvm_install_path is already non existant."
758
+ fi
759
+ break
760
+ elif [ "$response" = "no" ] ; then
761
+ __rvm_log "info" "Cancelling implosion, no harm done :)"
762
+ break
763
+ fi
764
+ done
765
+ }
766
+
767
+ function __rvm_gem-dir {
725
768
 
726
- if [ -z "$rvm_selected" ] ; then rvm-select $* ; fi
769
+ if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
727
770
 
728
771
  mkdir -p $rvm_gem_home
729
772
  echo $rvm_gem_home
730
773
  }
731
774
 
732
- function rvm-src-dir {
775
+ function __rvm_src-dir {
733
776
 
734
- if [ -z "$rvm_selected" ] ; then rvm-select $* ; fi
777
+ if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
735
778
 
736
779
  if [ "$rvm_ruby_interpreter" -a "$rvm_ruby_version" ] ; then
737
780
  rvm_ruby_source_dir="$rvm_source_path/$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level"
738
781
  mkdir -p $rvm_ruby_source_dir
739
782
  echo "$rvm_ruby_source_dir"
740
783
  else
741
- rvm-log "fail" "No source directory exists for the default implementation."
784
+ __rvm_log "fail" "No source directory exists for the default implementation."
742
785
  fi
743
786
 
744
787
  }
745
788
 
746
789
  # clones from source implementation/version to current
747
- function rvm-gem-dup {
790
+ function __rvm_gem-dup {
748
791
 
749
792
  if [ "$1" = "default" ] ; then
750
- rvm_source_gem_dir="$default_user_gem_path"
793
+ rvm_source_gem_dir="$rvm_default_user_gem_path"
751
794
  elif [ "$1" = "system" ] ; then
752
- rvm_source_gem_dir="$default_system_gem_path"
795
+ rvm_source_gem_dir="$rvm_default_system_gem_path"
753
796
  else
754
- rvm_source_gem_dir=${1:-$default_user_gem_path} # TODO: check for and remove trailing /gems
797
+ rvm_source_gem_dir=${1:-$rvm_default_user_gem_path} # TODO: check for and remove trailing /gems
755
798
  fi
756
799
 
757
800
  if [ ! -z "$rvm_source_gem_dir" ] ; then
@@ -761,28 +804,28 @@ function rvm-gem-dup {
761
804
  if [ -d $GEM_HOME/gems/$rvm_gem_name_version ] ; then
762
805
  echo "$rvm_gem_name_version already installed."
763
806
  else
764
- rvm-gi $rvm_source_gem_dir/cache/$rvm_gem_name-$rvm_gem_version.gem
807
+ __rvm_gi $rvm_source_gem_dir/cache/$rvm_gem_name-$rvm_gem_version.gem
765
808
  fi
766
809
  done
767
810
  unset rvm_gem_name_version rvm_gem_name rvm_gem_version
768
811
  else
769
- rvm-log "fail" "Unknown $rvm_ruby_interpreter version: $rvm_ruby_version"
812
+ __rvm_log "fail" "Unknown $rvm_ruby_interpreter version: $rvm_ruby_version"
770
813
  fi
771
814
 
772
815
  }
773
816
 
774
- function rvm-execute {
775
- if [ -z "$rvm_selected" ] ; then rvm-select $* ; fi
817
+ function __rvm_execute {
818
+ if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
776
819
  $rvm_ruby_home/bin/ruby $rvm_ruby_args
777
820
  }
778
821
 
779
- function rvm-cache {
822
+ function __rvm_cache {
780
823
  rvm_cache_file="$rvm_config_path/cache"
781
824
  touch $rvm_cache_file
782
825
  key="$1" ; shift
783
826
 
784
827
  if [ -z "$key" ] ; then
785
- rvm-log "fail" "rvm-cache must be called with at least one argument: rvm-cache key [value]"
828
+ __rvm_log "fail" "__rvm_cache must be called with at least one argument: __rvm_cache key [value]"
786
829
  else
787
830
  if [ "$key" = "unset" -o "$key" = "delete" ] ; then
788
831
  sed -i~ "s/^$2=.*$//" $rvm_cache_file
@@ -801,20 +844,20 @@ function rvm-cache {
801
844
  fi
802
845
  }
803
846
 
804
- function rvm-cleanup-variables {
847
+ function __rvm_cleanup-variables {
805
848
  unset rvm_selected rvm_action rvm_ruby_interpreter rvm_ruby_patch_level rvm_ruby_version rvm_irbrc_file rvm_ruby_irbrc rvm_source_path rvm_install_path rvm_debug rvm_prefix_path rvm_ruby_package_name rvm_gem_path rvm_command rvm_error_message IRBRC rvm_ruby_home rvm_ruby_binary rvm_gem_set_name rvm_delete_flag rvm_ruby_tag rvm_ruby_rev rvm_url rvm_ruby_make rvm_ruby_make_install rvm_config_path
806
849
  }
807
850
 
808
- function rvm-get-user-defaults {
851
+ function __rvm_get-user-defaults {
809
852
  # NOW load defaults settings. TODO: root user loads /etc/rvmrc
810
853
  if [ -s ~/.rvmrc ] ; then source ~/.rvmrc ; fi
811
854
  }
812
855
 
813
- function rvm-parse-args {
856
+ function __rvm_parse-args {
814
857
  while [ $# -gt 0 ] ; do
815
858
  rvm_token="$1" ; shift
816
859
  case "$rvm_token" in
817
- install|uninstall|path|info|setup|version|srcdir|list|symlinks|reset|debug|reload|usage|help)
860
+ install|uninstall|path|info|setup|version|srcdir|list|symlinks|reset|debug|reload|usage|help|implode)
818
861
  rvm_action=$rvm_token
819
862
  ;;
820
863
  use)
@@ -824,7 +867,7 @@ function rvm-parse-args {
824
867
  fi
825
868
  ;;
826
869
 
827
- ruby|jruby|ree|macruby|rubinius|default|all)
870
+ ruby|jruby|ree|macruby|rbx|rubinius|default|all)
828
871
  rvm_ruby_interpreter="$rvm_token"
829
872
  rvm_action="${rvm_action:-use}"
830
873
  ;;
@@ -918,7 +961,8 @@ function rvm-parse-args {
918
961
  -d|--default) rvm_set_default=1 ;;
919
962
  --debug) rvm_debug=1 ;;
920
963
  -m|--gem-set) rvm_gem_set_name="$1" ; shift ;;
921
- --rm-gem-set) rvm_gem_set_name_rm="$1" ; shift ;;
964
+ --rm-gem-set) rvm_gem_set_name_rm="$1" ; shift ;;
965
+ --jit) rvm_rubinius_jit="RBX_LLVM=1" ;;
922
966
 
923
967
  default|system)
924
968
  rvm_action="use"
@@ -939,37 +983,22 @@ function rvm-parse-args {
939
983
 
940
984
  function rvm {
941
985
 
942
- rvm-cleanup-variables
943
- rvm-get-user-defaults
944
- rvm-initialize
945
- rvm-set-defaults
946
- rvm-parse-args $*
986
+ __rvm_cleanup-variables
987
+ __rvm_get-user-defaults
988
+ __rvm_initialize
989
+ __rvm_set-defaults
990
+ __rvm_parse-args $*
947
991
 
948
992
  case "$rvm_action" in
949
- install)
950
- if [ "$rvm_ruby_interpreter" = "all" ] ; then
951
- for rvm_ruby_interpreter in ruby jruby ree ; do
952
- if [ "$rvm_ruby_interpreter" = "ruby" ] ; then
953
- for rvm_ruby_version in 1.8.6 1.8.7 1.9.1 1.9.2 ; do
954
- rvm-install-ruby $rvm_ruby_interpreter $rvm_ruby_version
955
- done
956
- else
957
- rvm-install-ruby $rvm_ruby_interpreter $rvm_ruby_version
958
- fi
959
- unset rvm_ruby_version
960
- done
961
- else
962
- rvm-install-ruby $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level
963
- fi
964
- ;;
965
- uninstall) rvm-uninstall $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level ;;
966
- use) rvm-use $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level ;;
967
- list) rvm-list ;;
968
- gemdir) rvm-gem-dir $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level ;;
969
- srcdir) rvm-src-dir $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level ;;
970
- gemdup) rvm-gem-dup $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level ;;
971
- symlinks) rvm-symlinks ;;
972
- version) rvm-version ;;
993
+ install) __rvm_install-ruby $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level ;;
994
+ uninstall) __rvm_uninstall $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level ;;
995
+ use) __rvm_use $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level ;;
996
+ list) __rvm_list ;;
997
+ gemdir) __rvm_gem-dir $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level ;;
998
+ srcdir) __rvm_src-dir $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level ;;
999
+ gemdup) __rvm_gem-dup $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level ;;
1000
+ symlinks) __rvm_symlinks ;;
1001
+ version) __rvm_version ;;
973
1002
  rubydo)
974
1003
  if [ ! -z "$rvm_ruby_version" ] ; then
975
1004
  rvm_ruby_versions=$(echo $rvm_ruby_version | tr ',' ' ')
@@ -982,7 +1011,7 @@ function rvm {
982
1011
  unset rvm_ruby_version
983
1012
  fi
984
1013
  unset temp
985
- rvm-select $rvm_ruby_interpreter $rvm_ruby_version
1014
+ __rvm_select $rvm_ruby_interpreter $rvm_ruby_version
986
1015
 
987
1016
  rvm_command="$rvm_ruby_binary $rvm_ruby_args"
988
1017
  echo "$(basename $rvm_ruby_binary):"
@@ -1000,12 +1029,13 @@ function rvm {
1000
1029
  done
1001
1030
  fi
1002
1031
  ;;
1003
- reset) rvm-reset ;;
1032
+ reset) __rvm_reset ;;
1004
1033
  # TODO: how can we use bin_path here for reload, default file?
1005
- reload) source ~/.rvm/scripts/rvm ;;
1006
- error) rvm-log "fail" "$rvm_error_message ( see: rvm usage )" ; return 1; ;;
1034
+ reload) source ~/.rvm/scripts/rvm ;;
1035
+ implode) __rvm_implode ;;
1036
+ error) __rvm_log "fail" "$rvm_error_message ( see: rvm usage )" ; return 1; ;;
1007
1037
  info|debug)
1008
- rvm-version
1038
+ __rvm_version
1009
1039
  cat <<-Info
1010
1040
 
1011
1041
  ruby:
@@ -1032,27 +1062,27 @@ environment:
1032
1062
  Info
1033
1063
 
1034
1064
  if [ "$rvm_action" = "debug" ] ; then
1035
- rvm-log "info" "PATH:$(echo $PATH | awk -F":" '{print $1":"$2":"$3":"$4":"$5}')"
1065
+ __rvm_log "info" "PATH:$(echo $PATH | awk -F":" '{print $1":"$2":"$3":"$4":"$5}')"
1036
1066
  for file in .bash_profile .bashrc .zshrc ; do
1037
1067
  if [ -s $file ] ; then
1038
- rvm-log "debug" "~/$file:\n$(cat ~/$file | grep rvm)\n"
1068
+ __rvm_log "debug" "~/$file:\n$(cat ~/$file | grep rvm)\n"
1039
1069
  fi
1040
1070
  done
1041
1071
  if [ -s $rvm_install_path/current ] ; then
1042
- rvm-log "debug" "$rvm_install_path/current:\n$($rvm_install_path/current)\n"
1072
+ __rvm_log "debug" "$rvm_install_path/current:\n$($rvm_install_path/current)\n"
1043
1073
  fi
1044
1074
  if [ -e $rvm_install_path/bin/rvm ] ; then
1045
- rvm-log "debug" "rvm script in bin:\n$(ls -laht $rvm_install_path/bin/rvm)"
1075
+ __rvm_log "debug" "rvm script in bin:\n$(ls -laht $rvm_install_path/bin/rvm)"
1046
1076
  fi
1047
1077
  fi
1048
1078
  return 0
1049
1079
  ;;
1050
- usage|help) rvm-usage ;;
1080
+ usage|help) __rvm_usage ;;
1051
1081
  *)
1052
1082
  if [ ! -z "$rvm_action" ] ; then
1053
- rvm-log "fail" "unknown action '$rvm_action'"
1083
+ __rvm_log "fail" "unknown action '$rvm_action'"
1054
1084
  else
1055
- rvm-usage
1085
+ __rvm_usage
1056
1086
  fi
1057
1087
  return 1
1058
1088
  esac
data/scripts/rvm-install CHANGED
@@ -8,10 +8,13 @@ fi
8
8
 
9
9
  info="\n\033[0;32m<i>\033[0m"
10
10
  question="\n\033[0;32m<?>\033[0m"
11
-
12
- echo -e "Installing rvm source to ~/.rvm/scripts/rvm..."
13
11
  cwd=$(pwd)
12
+ source_dir="${source_dir:-`dirname $0 | xargs dirname`}"
13
+ if [ ! -d "$source_dir" ] ; then unset source_dir ; fi
14
+ source_dir="${source_dir:-$cwd}"
14
15
  rvm_dir=~/.rvm
16
+
17
+ echo -e "Installing rvm source to ~/.rvm/scripts/rvm..."
15
18
  mkdir -p $rvm_dir
16
19
 
17
20
  for dir in src scripts bin log archives config gems examples ; do
@@ -32,8 +35,8 @@ fi
32
35
 
33
36
  for dir in scripts examples ; do
34
37
  mkdir -p $rvm_dir/$dir
35
- for file in `/bin/ls $dir/`; do
36
- cp $cwd/$dir/$file $rvm_dir/$dir/$file
38
+ for file in `/bin/ls $source_dir/$dir/`; do
39
+ cp $source_dir/$dir/$file $rvm_dir/$dir/$file
37
40
  done
38
41
  done
39
42
 
data/scripts/rvm-update CHANGED
@@ -6,6 +6,9 @@ if [ "$user" = "root" ] ; then
6
6
  exit 1
7
7
  fi
8
8
  cwd=$(pwd)
9
+ source_dir="${source_dir:-`dirname $0 | xargs dirname`}"
10
+ if [ ! -d "$source_dir" ] ; then unset source_dir ; fi
11
+ source_dir="${source_dir:-$cwd}"
9
12
  rvm_dir=~/.rvm
10
13
 
11
14
  info="\n\033[0;32m<i>\033[0m"
@@ -29,8 +32,8 @@ fi
29
32
 
30
33
  for dir in scripts examples ; do
31
34
  mkdir -p $rvm_dir/$dir
32
- for file in `/bin/ls $dir/`; do
33
- cp $cwd/$dir/$file $rvm_dir/$dir/$file
35
+ for file in `/bin/ls $source_dir/$dir/`; do
36
+ cp $source_dir/$dir/$file $rvm_dir/$dir/$file
34
37
  done
35
38
  done
36
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wayneeseguin-rvm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.25
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wayne E. Seguin
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-30 00:00:00 -07:00
12
+ date: 2009-08-31 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -35,7 +35,6 @@ files:
35
35
  - scripts/rvm-update
36
36
  has_rdoc: false
37
37
  homepage: http://github.com/wayneeseguin/rvm
38
- licenses:
39
38
  post_install_message:
40
39
  rdoc_options:
41
40
  - --inline-source
@@ -57,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
56
  requirements: []
58
57
 
59
58
  rubyforge_project: dynamicreports
60
- rubygems_version: 1.3.5
59
+ rubygems_version: 1.2.0
61
60
  signing_key:
62
61
  specification_version: 3
63
62
  summary: Ruby Version Manager (rvm)