rvm 0.1.16 → 0.1.18

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.
data/README CHANGED
@@ -35,7 +35,7 @@ Action
35
35
  fetch - Performs an archive / src fetch only of the selected ruby.
36
36
  srcdir - display the path to rvm source directory (may be yanked)
37
37
  list - show currently installed rubies, interactive output.
38
- rubies - show list of rubies installed for use with scripting.
38
+ rubies - (query info) default, installed, or expand_string <str>
39
39
  iconv - Install iconv
40
40
  openssl - Install openssl
41
41
  ncurses - Install ncurses
@@ -51,7 +51,7 @@ Implementation
51
51
  rbx - rubinius
52
52
  ree - ruby Enterprise Edition
53
53
  macruby - MacRuby (Mac OS X Only)
54
- maglev - Gemstone Ruby
54
+ maglev - GemStone Ruby
55
55
  ironruby - IronRuby
56
56
  mput - shyouhei(mput)'s github repository
57
57
  system - use the system ruby (eg. pre-rvm state)
data/config/db CHANGED
@@ -4,6 +4,9 @@ ruby_configure=--enable-shared
4
4
  interpreter=ruby
5
5
  ruby_version=1.8.6
6
6
  ruby_patchlevel=383
7
+ rubygems_version=1.3.6
8
+ rubygems_1.3.5_url=http://rubyforge.org/frs/download.php/60718
9
+ rubygems_1.3.6_url=http://rubyforge.org/frs/download.php/69365
7
10
  rbx_version=1.0.0
8
11
  rbx_patch_level=rc2
9
12
  rbx_url=http://asset.rubini.us/rubinius-1.0.0-rc2-20100104.tar.gz
@@ -26,7 +29,7 @@ macruby_version=0.5
26
29
  macruby_url=http://www.macruby.org/files
27
30
  macruby_repo_url=git://git.macruby.org/macruby/MacRuby.git
28
31
  macruby_nightly_url=http://macruby.icoretech.org/latest/macruby_nightly-latest.pkg
29
- maglev_version=22816
32
+ maglev_version=22891
30
33
  maglev_url=http://glass-downloads.gemstone.com/maglev
31
34
  maglev_repo_url=git://github.com/MagLev/maglev.git
32
35
  rubinius_repo_url=git://github.com/evanphx/rubinius.git
data/config/md5 CHANGED
@@ -39,6 +39,10 @@ GemStone-22816.Darwin-i386.tar.gz=b12426c17b3925f1c8c7086a3285f15f
39
39
  GemStone-22816.Linux-x86_64.tar.gz=21d1e8e7a4b10ac8a1c199eb0cbfaec1
40
40
  MagLev-22816.Darwin-i386.tar.gz=b1b3e6530e90d7dcf36f81e097776643
41
41
  MagLev-22816.Linux-x86_64.tar.gz=424ca92c34cfce6d0da63170755b000c
42
+ MagLev-22891.Darwin-i386.tar.gz=d8d3a8aaff1473422d6a30ecd2b2e9ff
43
+ GemStone-22891.Darwin-i386.tar.gz=84080bda40c640aac9f19f5ea48403bf
44
+ MagLev-22891.Linux-x86_64.tar.gz=f91f1bec1f3defb49323a70ec25504ef
45
+ GemStone-22891.Linux-x86_64.tar.gz=5fd0d341a0eb586c9f804976cc290810
42
46
  MacRuby%200.5.zip=675454a8c7bc19d606d90a726e08427c
43
47
  jruby-bin-1.3.1.tar.gz=4a95db8fc93ed7219663fbede98b6117
44
48
  jruby-bin-1.4.0.tar.gz=f37322c18e9134e91e064aebb4baa4c7
@@ -50,3 +54,4 @@ readline-6.0.tar.gz=b7f65a48add447693be6e86f04a63019
50
54
  zlib-1.2.3.tar.gz=debc62758716a169df9f62e6ab2bc634
51
55
  curl-7.19.7.tar.gz=ecb2e37e45c9933e2a963cabe03670ab
52
56
  pkg-config-0.23.tar.gz=d922a88782b64441d06547632fd85744
57
+ rubygems-1.3.6.tgz=789ca8e9ad1d4d3fe5f0534fcc038a0d
data/install CHANGED
@@ -42,13 +42,7 @@ if [[ -z "$rvm_path" ]] ; then
42
42
  if [[ "root" = "$(whoami)" ]] ; then
43
43
  rvm_path="/usr/local/rvm"
44
44
  else
45
- if [[ -d "$HOME/.rvm" ]] && [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
46
- rvm_path="$HOME/.rvm"
47
- elif [[ -d "/usr/local/rvm" ]] && [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
48
- rvm_path="/usr/local/rvm"
49
- else
50
- rvm_path="$HOME/.rvm"
51
- fi
45
+ rvm_path="$HOME/.rvm"
52
46
  fi
53
47
  fi
54
48
 
@@ -188,4 +182,8 @@ if [[ "root" != "$(whoami)" ]] ; then
188
182
  echo -e "\n4) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
189
183
  fi
190
184
 
185
+ if grep '&& return' ~/.bashrc ; then
186
+ echo -e "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc. Please remove it and refactor your profiles to be correct. If you have questions about this please visit #rvm on irc.freenode.net.\n\n"
187
+ fi
188
+
191
189
  exit 0
data/lib/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 16
4
+ :patch: 18
data/rvm.gemspec CHANGED
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.1.16"
8
+ s.version = "0.1.18"
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{2010-02-18}
12
+ s.date = %q{2010-02-23}
13
13
  s.default_executable = %q{rvm-install}
14
14
  s.description = %q{Manages Ruby interpreter environments and switching between them.}
15
15
  s.email = %q{wayneeseguin@gmail.com}
@@ -64,6 +64,7 @@ Gem::Specification.new do |s|
64
64
  "scripts/utility",
65
65
  "scripts/version"
66
66
  ]
67
+ s.has_rdoc = false
67
68
  s.homepage = %q{http://github.com/wayneeseguin/rvm}
68
69
  s.post_install_message = %q{********************************************************************************
69
70
 
@@ -91,3 +92,4 @@ Gem::Specification.new do |s|
91
92
  else
92
93
  end
93
94
  end
95
+
data/scripts/cli CHANGED
@@ -8,7 +8,7 @@ __rvm_parse_args() {
8
8
  while [[ $# -gt 0 ]] ; do
9
9
  rvm_token="$1" ; shift
10
10
  case "$rvm_token" in
11
- fetch|info|version|srcdir|list|rubies|reset|debug|reload|implode|readline|update|iconv|curl|openssl|ncurses|zlib|monitor|notes|mono)
11
+ fetch|version|srcdir|reset|debug|reload|implode|readline|update|iconv|curl|openssl|ncurses|zlib|monitor|notes|mono)
12
12
  rvm_action=$rvm_token
13
13
  ;;
14
14
 
@@ -20,7 +20,7 @@ __rvm_parse_args() {
20
20
 
21
21
  inspect)
22
22
  rvm_action=$rvm_token
23
- rvm_ruby_args=$*
23
+ export rvm_ruby_args=$*
24
24
  rvm_parse_break=1
25
25
  ;;
26
26
 
@@ -50,9 +50,7 @@ __rvm_parse_args() {
50
50
 
51
51
  gems|gemset)
52
52
  rvm_action="gems"
53
- if [[ "name" = "$1" ]] || [[ "dir" = "$1" ]] || [[ "list" = "$1" ]] || [[ "empty" = "$1" ]] || [[ "dump" = "$1" ]] || [[ "load" = "$1" ]] || [[ "empty" = "$1" ]] || [[ "copy" = "$1" ]] || [[ "import" = "$1" ]] || [[ "export" = "$1" ]] ; then
54
- export rvm_ruby_args="$*" ; export rvm_${1}_flag=1 ; shift
55
- elif [[ "clear" = "$1" ]] ; then
53
+ if [[ "clear" = "$1" ]] ; then
56
54
  unset rvm_gem_set_name ; shift
57
55
  export rvm_ruby_gem_home="$(echo $GEM_HOME | sed 's/%.*$//')"
58
56
  export GEM_HOME="$rvm_ruby_gem_home"
@@ -60,9 +58,9 @@ __rvm_parse_args() {
60
58
  export GEM_PATH="$rvm_ruby_gem_home/bin:$rvm_ruby_gem_home%global/bin"
61
59
  rvm_ruby_args="clear"
62
60
  rvm_parse_break=1
63
- elif [[ "delete" = "$1" ]] ; then
64
- export rvm_delete_flag=1
65
- rvm_ruby_args="$*" ; shift
61
+ elif [[ "delete" = "$1" ]] || [[ "use" = "$1" ]] ; then
62
+ export rvm_${1}_flag=1
63
+ export rvm_ruby_args="$*" ; shift
66
64
  rvm_gem_set_name="$1"; shift
67
65
  rvm_ruby_string=$(echo $rvm_gem_set_name | sed 's/\(.*\)%.*/\1/')
68
66
  rvm_gem_set_name=$(echo $rvm_gem_set_name | sed 's/.*%\(.*\)/\1/')
@@ -73,8 +71,7 @@ __rvm_parse_args() {
73
71
  rvm_action="error"
74
72
  rvm_error_message="'gems' must be followed by a gems(et) action, see http://rvm.beginrescueend.com/gemsets/#managing for details."
75
73
  else
76
- rvm_gem_set_name="$1" ; shift
77
- export rvm_use_flag=1 # Default is to use the (named) gem set.
74
+ export rvm_ruby_args="$*" ; export rvm_${1}_flag=1 ; shift
78
75
  fi
79
76
  fi
80
77
  ;;
@@ -86,14 +83,21 @@ __rvm_parse_args() {
86
83
  if [[ "user" = "$1" ]] ; then export rvm_user_flag=1 ; shift ; fi
87
84
  ;;
88
85
 
86
+ list|info|strings)
87
+ rvm_action="$rvm_token"
88
+ export rvm_ruby_args="$@"
89
+ rvm_parse_break=1
90
+ ;;
91
+
89
92
  -S)
90
93
  rvm_action="ruby"
91
- rvm_ruby_args="$rvm_token $@"
94
+ export rvm_ruby_args="$rvm_token $@"
92
95
  rvm_parse_break=1
93
96
  ;;
97
+
94
98
  -e)
95
99
  rvm_action="ruby"
96
- rvm_ruby_args="$rvm_token \"$@\""
100
+ export rvm_ruby_args="$rvm_token \"$@\""
97
101
  rvm_parse_break=1
98
102
  ;;
99
103
 
@@ -281,7 +285,7 @@ __rvm_parse_args() {
281
285
  --disable-llvm|--disable-jit) export rvm_llvm_flag=0 ;;
282
286
  --enable-llvm|--enable-jit) export rvm_llvm_flag=1 ;;
283
287
 
284
- --self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--all|--export|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--import|--rvmrc|--passenger|--editor|--sticky_gems)
288
+ --self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--all|--export|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--import|--rvmrc|--passenger|--editor|--sticky)
285
289
  export rvm_$(echo $rvm_token | sed 's#-##g')_flag=1
286
290
  if [[ "--debug" = "$rvm_token" ]] ; then export rvm_debug_flag ; fi
287
291
  ;;
@@ -377,24 +381,29 @@ rvm() {
377
381
 
378
382
  result=0
379
383
  case "$rvm_action" in
380
- use) __rvm_use ; result=$? ;;
381
- srcdir) __rvm_source_dir ; result=$? ;;
382
- list) __rvm_list ; result=$? ;;
383
- rubies) __rvm_rubies ; result=$? ;;
384
- version) __rvm_version ; result=$? ;;
385
- reset) __rvm_reset ; result=$? ;;
386
- implode) __rvm_implode ; result=$? ;;
387
- update) __rvm_update ; result=$? ;;
388
- reboot) __rvm_reboot ; result=$? ;;
389
- usage|help) __rvm_usage ; result=$? ;;
390
- benchmark) __rvm_benchmark ; result=$? ;;
391
- inspect) __rvm_inspect ; result=$? ;;
392
- ruby|gem|rake) __rvm_do ; result=$? ;;
384
+ use) __rvm_use ; result=$? ;;
385
+ srcdir) __rvm_source_dir ; result=$? ;;
386
+ list) __rvm_list ; result=$? ;;
387
+ strings) __rvm_strings ; result=$? ;;
388
+ info) __rvm_info ; result=$? ;;
389
+ debug) __rvm_debug ; result=$? ;;
390
+ version) __rvm_version ; result=$? ;;
391
+ reset) __rvm_reset ; result=$? ;;
392
+ implode) __rvm_implode ; result=$? ;;
393
+ update) __rvm_update ; result=$? ;;
394
+ reboot) __rvm_reboot ; result=$? ;;
395
+ usage|help) __rvm_usage ; result=$? ;;
396
+ benchmark) __rvm_benchmark ; result=$? ;;
397
+ inspect) __rvm_inspect ; result=$? ;;
398
+ ruby|gem|rake) __rvm_do ; result=$? ;;
393
399
  gemdir) $rvm_scripts_path/gems gemdir ; result=$? ;;
394
400
  gems)
395
401
  if [[ "$rvm_use_flag" -eq 1 ]] ; then
396
402
  __rvm_gems_select
397
- __rvm_gems_use
403
+ result=$?
404
+ if [[ $result -eq 0 ]] ; then
405
+ __rvm_gems_use
406
+ fi
398
407
  else
399
408
  $rvm_scripts_path/gems $rvm_ruby_args
400
409
  fi
@@ -424,11 +433,6 @@ rvm() {
424
433
  result=$?
425
434
  ;;
426
435
 
427
- info|debug)
428
- __rvm_version
429
- __rvm_info
430
- if [[ "debug" = "$rvm_action" ]] ; then export rvm_debug_flag=1 ; __rvm_debug ; fi
431
- ;;
432
436
 
433
437
  error)
434
438
  $rvm_scripts_path/log "fail" "$rvm_error_message ( see: 'rvm usage' )"
data/scripts/gems CHANGED
@@ -10,7 +10,7 @@ color_none=$($rvm_scripts_path/color "none")
10
10
 
11
11
  if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi
12
12
  rvm_ruby_gem_home="${rvm_ruby_gem_home:-$GEM_HOME}"
13
- if [[ -d "$rvm_ruby_gem_home" ]] && which gem &> /dev/null ; then rvm_ruby_gem_home="$(gem env home)" ; fi
13
+ if [[ ! -d "$rvm_ruby_gem_home" ]] && which gem &> /dev/null ; then rvm_ruby_gem_home="$(gem env home)" ; fi
14
14
 
15
15
  trap "if [[ -d $rvm_tmp_path/ ]] && [[ -s $rvm_tmp_path/$$ ]] ; then rm -f $rvm_tmp_path/$$ > /dev/null 2>&1 ; fi ; exit" 0 1 2 3 15
16
16
 
@@ -22,6 +22,15 @@ __rvm_gems_dir() {
22
22
  echo "$rvm_ruby_gem_home"
23
23
  }
24
24
 
25
+ __rvm_gems_create() {
26
+ for gemset in $(echo $gems_args) ; do
27
+ gem_home="$rvm_ruby_gem_home%${gems_args/ /}"
28
+ mkdir -p $gem_home
29
+ ln -nfs "$HOME/.gem/cache" "$gem_home/cache"
30
+ $rvm_scripts_path/log "info" "Gemset '$gemset' created."
31
+ done ; unset gem_home
32
+ }
33
+
25
34
  __rvm_gems_list() {
26
35
  if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
27
36
 
@@ -65,31 +74,27 @@ __rvm_gems_delete() {
65
74
 
66
75
  __rvm_gems_empty() {
67
76
  if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
68
- if [[ ! -z "$rvm_gem_set_name" ]] ; then
69
- gemdir="$rvm_gems_path/$rvm_ruby_string%$rvm_gem_set_name"
70
- if [[ -d "$gemdir" ]] && [[ "$gemdir" != '/' ]] && [[ ! -z "$rvm_force_flag" ]] ; then
77
+ gemdir="$rvm_ruby_gem_home"
78
+ if [[ -d "$gemdir" ]] && [[ "$gemdir" != '/' ]] && [[ ! -z "$rvm_force_flag" ]] ; then
79
+ cd $gemdir && rm -rf ./bin/* ./doc/* ./gems/* ./specifications/*
80
+ elif [[ -d "$gemdir" ]] ; then
81
+ $rvm_scripts_path/log "warn" "Are you SURE you wish to remove the installed gems for gemset '%$rvm_gem_set_name' ($gemdir)?"
82
+ echo -n "(anything other than 'yes' will cancel) > "
83
+ read response
84
+ if [[ "yes" = "$response" ]] ; then
71
85
  cd $gemdir && rm -rf ./bin/* ./doc/* ./gems/* ./specifications/*
72
- elif [[ -d "$gemdir" ]] ; then
73
- $rvm_scripts_path/log "warn" "Are you SURE you wish to remove the installed gems for gemset '%$rvm_gem_set_name' ($gemdir)?"
74
- echo -n "(anything other than 'yes' will cancel) > "
75
- read response
76
- if [[ "yes" = "$response" ]] ; then
77
- cd $gemdir && rm -rf ./bin/* ./doc/* ./gems/* ./specifications/*
78
- else
79
- $rvm_scripts_path/log "info" "Not doing anything, phew... close call that one eh?"
80
- fi
81
86
  else
82
- $rvm_scripts_path/log "info" "$gemdir already does not exist."
83
- fi ; unset gemdir
87
+ $rvm_scripts_path/log "info" "Not doing anything, phew... close call that one eh?"
88
+ fi
84
89
  else
85
- $rvm_scripts_path/log "error" "A gems name must be specified in order to delete a gems."
86
- fi
90
+ $rvm_scripts_path/log "info" "$gemdir already does not exist."
91
+ fi ; unset gemdir
87
92
  }
88
93
 
89
94
  # Migrate gemsets from ruby X to ruby Y
90
95
  __rvm_gems_copy() {
91
- source_ruby="$(echo $gem_args | awk '{print $1}')"
92
- destination_ruby="$(echo $gem_args | awk '{print $2}')"
96
+ source_ruby="$(echo $gems_args | awk '{print $1}')"
97
+ destination_ruby="$(echo $gems_args | awk '{print $2}')"
93
98
  if [[ -z "$source_ruby" ]] ; then
94
99
  $rvm_scripts_path/log "error" "Source and destination must be specified: 'rvm gems copy X Y'"
95
100
  fi
@@ -191,7 +196,7 @@ __rvm_gems_import() {
191
196
  fi
192
197
  }
193
198
 
194
- __rvm_parse_gem_args() {
199
+ __rvm_parse_gems_args() {
195
200
  gem="$(echo $gems_args | awk -F';' '{print $1}')"
196
201
  gem_prefix="$(echo $gems_args | awk -F';' '{print $2}')"
197
202
  if $rvm_scripts_path/match "$gem" "\.gem$" ; then
@@ -225,7 +230,7 @@ __rvm_parse_gem_args() {
225
230
  # Install a gem
226
231
  __rvm_gem_install() {
227
232
  # First we parse the gem args to pick apart the pieces.
228
- __rvm_parse_gem_args
233
+ __rvm_parse_gems_args
229
234
 
230
235
  # Now we determine if a .gem cache file is already installed
231
236
  if [[ -z "$rvm_force_flag" ]] && [[ -f "${rvm_ruby_gem_home}/specifications/$(basename $gem_file_name)spec" ]] ; then
@@ -312,12 +317,14 @@ if [[ -z "$(which gem 2>/dev/null)" ]] ; then
312
317
  fi
313
318
 
314
319
  action="$(echo $* | awk '{print $1}')"
315
- gem_args=$(echo "$*" | awk '{$1="" ; print}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
320
+ gems_args=$(echo "$*" | awk '{$1="" ; print}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
316
321
 
317
322
  if [[ "import" = "$action" ]] || [[ "load" = "$action" ]] ; then
318
323
  __rvm_gems_import
319
324
  elif [[ "export" = "$action" ]] || [[ "dump" = "$action" ]] ; then
320
325
  __rvm_gems_export
326
+ elif [[ "create" = "$action" ]] ; then
327
+ __rvm_gems_create
321
328
  elif [[ "copy" = "$action" ]] ; then
322
329
  __rvm_gems_copy
323
330
  elif [[ "empty" = "$action" ]] ; then
@@ -338,7 +345,7 @@ elif [[ "clear" = "$action" ]] ; then
338
345
  $rvm_scripts_path/log "info" "gems(et) cleared."
339
346
  exit 0
340
347
  else
341
- $rvm_scripts_path/log "error" "Unrecognized gems action '$action'.\ngems must be passed an action as the first parameter {import,export,copy,delete,empty,name,list,gemdir,install}"
348
+ $rvm_scripts_path/log "error" "Unrecognized gems action '$action'.\n\nValid gems actions are: {create,use,import,export,copy,delete,empty,name,list,gemdir,install}"
342
349
  fi
343
350
 
344
351
  exit $?
data/scripts/install CHANGED
@@ -42,13 +42,7 @@ if [[ -z "$rvm_path" ]] ; then
42
42
  if [[ "root" = "$(whoami)" ]] ; then
43
43
  rvm_path="/usr/local/rvm"
44
44
  else
45
- if [[ -d "$HOME/.rvm" ]] && [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
46
- rvm_path="$HOME/.rvm"
47
- elif [[ -d "/usr/local/rvm" ]] && [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
48
- rvm_path="/usr/local/rvm"
49
- else
50
- rvm_path="$HOME/.rvm"
51
- fi
45
+ rvm_path="$HOME/.rvm"
52
46
  fi
53
47
  fi
54
48
 
@@ -188,4 +182,8 @@ if [[ "root" != "$(whoami)" ]] ; then
188
182
  echo -e "\n4) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
189
183
  fi
190
184
 
185
+ if grep '&& return' ~/.bashrc ; then
186
+ echo -e "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc. Please remove it and refactor your profiles to be correct. If you have questions about this please visit #rvm on irc.freenode.net.\n\n"
187
+ fi
188
+
191
189
  exit 0
data/scripts/manage CHANGED
@@ -30,7 +30,7 @@ __rvm_install_source() {
30
30
  $rvm_scripts_path/log "error" "There has been an error, source directory is missing. Did the download or extraction fail? Aborting the installation." ; __rvm_pushpop ; return $result
31
31
  fi
32
32
 
33
- if [[ -d "${rvm_path}/usr/bin" ]] ; then export PATH="${rvm_path}/usr/bin:${PATH}" ; fi
33
+ if [[ -d "${rvm_path}/usr" ]] ; then export PATH="${rvm_path}/usr/bin:${PATH}" ; fi
34
34
 
35
35
  if [[ -z "$rvm_ruby_configure" ]] && [[ ! -s "$rvm_ruby_src_path/configure" ]] ; then
36
36
  if which autoconf &> /dev/null ; then
@@ -423,10 +423,10 @@ RubyWrapper
423
423
  rvm_gemstone_url="${rvm_gemstone_url:-"$maglev_url/${rvm_gemstone_package_file}.${rvm_archive_extension}"}"
424
424
  fi
425
425
 
426
- $rvm_scripts_path/log "info" "Downloading the gemstone package, this may take a while depending on your connection..."
426
+ $rvm_scripts_path/log "info" "Downloading the GemStone package, this may take a while depending on your connection..."
427
427
  $rvm_scripts_path/fetch "$rvm_gemstone_url"
428
428
  result=$? ; if [[ "$result" -gt 0 ]] ; then
429
- $rvm_scripts_path/log "error" "There has been an error while trying to fetch the gemstone package. Aborting the installation." ; __rvm_pushpop ; return $result
429
+ $rvm_scripts_path/log "error" "There has been an error while trying to fetch the GemStone package. Aborting the installation." ; __rvm_pushpop ; return $result
430
430
  fi
431
431
 
432
432
  builtin cd "$rvm_src_path"
@@ -439,7 +439,7 @@ RubyWrapper
439
439
 
440
440
  __rvm_run "gemstone.extract" "cat $rvm_archives_path/${rvm_gemstone_package_file}.${rvm_archive_extension} | gunzip | tar xf - -C $rvm_ruby_src_path"
441
441
  result=$? ; if [[ "$result" -gt 0 ]] ; then
442
- $rvm_scripts_path/log "error" "There has been an error while trying to extract the gemstone package. Aborting the installation." ; __rvm_pushpop ; return $result
442
+ $rvm_scripts_path/log "error" "There has been an error while trying to extract the GemStone package. Aborting the installation." ; __rvm_pushpop ; return $result
443
443
  fi
444
444
 
445
445
  chmod -R 777 "$rvm_gemstone_package_file" # for now.
@@ -853,6 +853,15 @@ __rvm_post_install() {
853
853
 
854
854
  __rvm_rubygems_setup() {
855
855
  if [[ ! -z "$(echo $rvm_ruby_version | awk '/^1\.9/')" ]] || [[ ! -z "$(echo $rvm_ruby_interpreter | awk '/^mput/')" ]] ; then
856
+ install=0
857
+ elif [[ "$rvm_ruby_string" = "ruby-head" ]] ; then
858
+ install=0
859
+ else
860
+ install=1
861
+ fi
862
+
863
+
864
+ if [[ "$install" -eq 0 ]] ; then
856
865
  # 1.9.X has it's own built-in gem command
857
866
  __rvm_inject_ruby_shebang "$rvm_ruby_src_path/bin/gem"
858
867
  __rvm_inject_gem_env "$rvm_ruby_home/bin/gem"
@@ -868,12 +877,14 @@ __rvm_rubygems_setup() {
868
877
  __rvm_inject_gem_env "$rvm_ruby_home/bin/gem"
869
878
  ruby_lib_gem_path="$rvm_ruby_home/lib/ruby/gems/1.$rvm_major_version"
870
879
  elif [[ ! -z "$(echo $rvm_ruby_interpreter | awk '/^rbx|jruby/')" ]] ; then
871
- (($rvm_debug_flag)) && $rvm_scripts_path/log "debug" "Skipping rubygems update for $rvm_ruby_version"
880
+ if [[ ! -z "$rvm_debug_flag" ]] ; then $rvm_scripts_path/log "debug" "Skipping rubygems update for $rvm_ruby_version" ; fi
872
881
  ruby_lib_gem_path="$rvm_ruby_home/lib/ruby/gems/jruby"
873
882
  else
874
883
  $rvm_scripts_path/log "info" "Installing rubygems dedicated to $rvm_ruby_string..."
875
- rvm_gem_package_name="rubygems-1.3.5"
876
- rvm_gem_url="http://rubyforge.org/frs/download.php/60718/$rvm_gem_package_name.tgz"
884
+ rvm_rubygems_version=$(__rvm_db "rubygems_version")
885
+ rvm_rubygems_url=$(__rvm_db "rubygems_${rvm_rubygems_version}_url")
886
+ rvm_gem_package_name="rubygems-$rvm_rubygems_version"
887
+ rvm_gem_url="$rvm_rubygems_url/$rvm_gem_package_name.tgz"
877
888
 
878
889
  # Sanity check...
879
890
  if [[ ! -f "$rvm_src_path/$rvm_gem_package_name/setup.rb" ]]; then
@@ -987,7 +998,7 @@ __rvm_manage_rubies() {
987
998
  fi
988
999
  done < <(\ls $rvm_rubies_path/*/bin/ruby 2> /dev/null)
989
1000
  else
990
- $rvm_scripts_path/log "warn" 'Really? Install all? See "rvm list --all" and limit the selection to something more sane please :)'
1001
+ $rvm_scripts_path/log "warn" 'Really? Install all? See "rvm list known" and limit the selection to something more sane please :)'
991
1002
  fi
992
1003
  fi
993
1004
 
data/scripts/rvm-install CHANGED
@@ -42,13 +42,7 @@ if [[ -z "$rvm_path" ]] ; then
42
42
  if [[ "root" = "$(whoami)" ]] ; then
43
43
  rvm_path="/usr/local/rvm"
44
44
  else
45
- if [[ -d "$HOME/.rvm" ]] && [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
46
- rvm_path="$HOME/.rvm"
47
- elif [[ -d "/usr/local/rvm" ]] && [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
48
- rvm_path="/usr/local/rvm"
49
- else
50
- rvm_path="$HOME/.rvm"
51
- fi
45
+ rvm_path="$HOME/.rvm"
52
46
  fi
53
47
  fi
54
48
 
@@ -188,4 +182,8 @@ if [[ "root" != "$(whoami)" ]] ; then
188
182
  echo -e "\n4) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
189
183
  fi
190
184
 
185
+ if grep '&& return' ~/.bashrc ; then
186
+ echo -e "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc. Please remove it and refactor your profiles to be correct. If you have questions about this please visit #rvm on irc.freenode.net.\n\n"
187
+ fi
188
+
191
189
  exit 0
data/scripts/selector CHANGED
@@ -181,6 +181,7 @@ __rvm_select() {
181
181
  else
182
182
  if [[ -z "$rvm_ruby_string" ]] ; then
183
183
  $rvm_scripts_path/log "fail" "Ruby implementation '$rvm_ruby_interpreter' is not known."
184
+ return 1
184
185
  fi
185
186
  fi
186
187
  esac
@@ -218,6 +219,7 @@ __rvm_select() {
218
219
  else
219
220
  rvm_ruby_interpreter="${rvm_ruby_interpreter:-system}"
220
221
  fi
222
+
221
223
  }
222
224
 
223
225
  __rvm_use() {
@@ -424,7 +426,8 @@ __rvm_ruby_string() {
424
426
  rvm_ruby_user_tag="$string"
425
427
  elif $rvm_scripts_path/match "$string" "^b[0-9][0-9]" ; then
426
428
  rvm_ruby_bits="$string"
427
- elif $rvm_scripts_path/match "ruby rbx jruby macruby ree rubinius maglev mput shyouhei ironruby" "$string" ; then
429
+ elif $rvm_scripts_path/match "ruby rbx jruby macruby ree rubinius maglev mput shyouhei ironruby " "$string " ; then
430
+ # NOTE: The space at the end of each of the above strings is *very* important.
428
431
  rvm_ruby_interpreter="$string"
429
432
  else
430
433
  $rvm_scripts_path/log "error" "Unknown ruby string component: '$string'"
data/scripts/update CHANGED
@@ -42,13 +42,7 @@ if [[ -z "$rvm_path" ]] ; then
42
42
  if [[ "root" = "$(whoami)" ]] ; then
43
43
  rvm_path="/usr/local/rvm"
44
44
  else
45
- if [[ -d "$HOME/.rvm" ]] && [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
46
- rvm_path="$HOME/.rvm"
47
- elif [[ -d "/usr/local/rvm" ]] && [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
48
- rvm_path="/usr/local/rvm"
49
- else
50
- rvm_path="$HOME/.rvm"
51
- fi
45
+ rvm_path="$HOME/.rvm"
52
46
  fi
53
47
  fi
54
48
 
@@ -188,4 +182,8 @@ if [[ "root" != "$(whoami)" ]] ; then
188
182
  echo -e "\n4) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
189
183
  fi
190
184
 
185
+ if grep '&& return' ~/.bashrc ; then
186
+ echo -e "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc. Please remove it and refactor your profiles to be correct. If you have questions about this please visit #rvm on irc.freenode.net.\n\n"
187
+ fi
188
+
191
189
  exit 0
data/scripts/utility CHANGED
@@ -24,11 +24,22 @@ __rvm_db() {
24
24
 
25
25
  # Ouput rvm environment information.
26
26
  __rvm_info() {
27
- if [[ ! -z "$(/usr/bin/which ruby 2>/dev/null)" ]] ; then full_version=$(ruby -v) ; fi
28
27
 
28
+ if [[ ! -z "$rvm_ruby_args" ]] ; then
29
+ echo $(rvm_ruby_string="$rvm_ruby_args"; __rvm_select ; __rvm_use ; __rvm_environment_info)
30
+ echo -e $info ; unset info
31
+ else
32
+ __rvm_environment_info
33
+ fi
34
+
35
+ }
36
+
37
+ __rvm_environment_info() {
38
+ if [[ ! -z "$(/usr/bin/which ruby 2>/dev/null)" ]] ; then full_version=$(ruby -v) ; fi
29
39
  echo -e "system:\n uname: \"$(uname -a)\""
30
- if [[ ! -z "$ZSH_VERSION" ]] ; then echo -e " shell: \"zsh\"\n version: \"$ZSH_VERSION\"" ; fi
31
- if [[ ! -z "$BASH_VERSION" ]] ; then echo -e " shell: \"bash\"\n version: \"$BASH_VERSION\"" ; fi
40
+
41
+ if [[ ! -z "$ZSH_VERSION" ]] ; then echo -e " shell: \"zsh\"\n version: \"$ZSH_VERSION\"" ; fi
42
+ if [[ ! -z "$BASH_VERSION" ]] ; then echo -e " shell: \"bash\"\n version: \"$BASH_VERSION\"" ; fi
32
43
 
33
44
  cat <<Info
34
45
 
@@ -58,13 +69,15 @@ environment:
58
69
  IRBRC: "$IRBRC"
59
70
 
60
71
  Info
61
- if [[ ! -z "$MAGLEV_HOME" ]] ; then echo -e " MAGLEV_HOME: \"$MAGLEV_HOME\"" ; fi
72
+ if [[ ! -z "$MAGLEV_HOME" ]] ; then info="$info\n MAGLEV_HOME: \"$MAGLEV_HOME\"" ; fi
62
73
 
63
74
  unset full_version
64
75
  }
65
76
 
66
77
  # Output debugging information that has been found useful to help people identify and resolve issues.
67
78
  __rvm_debug() {
79
+ __rvm_version
80
+ __rvm_environment_info
68
81
  $rvm_scripts_path/log "debug" "PATH:\n$(echo $PATH | awk -F":" '{print $1":"$2":"$3":"$4":"$5}')"
69
82
  $rvm_scripts_path/log "debug" "uname -a: $(uname -a)"
70
83
  $rvm_scripts_path/log "debug" "permissions: $(ls -la $rvm_path{,/rubies})"
@@ -100,6 +113,22 @@ __rvm_debug() {
100
113
  $rvm_scripts_path/log "debug" "gem sources:\n$(gem sources | awk '/gems/')"
101
114
  }
102
115
 
116
+ __rvm_strings() {
117
+ unset results
118
+ for rvm_ruby_string in $(echo $rvm_ruby_args) ; do
119
+ __rvm_ruby_string
120
+ if [[ $? -gt 0 ]] ; then
121
+ return 1
122
+ else
123
+ results="$results $(__rvm_select ; echo $rvm_ruby_string)"
124
+ unset rvm_ruby_string
125
+ fi
126
+ done
127
+ echo $results
128
+ unset results
129
+ return 0
130
+ }
131
+
103
132
  # ZSH has 1 based array indexing, bash has 0 based.
104
133
  if [[ ! -z "$ZSH_VERSION" ]] ; then __shell_array_start=1 ; else __shell_array_start=0 ; fi
105
134
 
@@ -146,13 +175,13 @@ __rvm_run() {
146
175
  }
147
176
 
148
177
  # Unset both rvm variables as well as ruby-specific variables
149
- # Preserve gemset if 'rvm_sticky_gems' is set (persist gemset unless clear is explicitely called).
178
+ # Preserve gemset if 'rvm_sticky' is set (persist gemset unless clear is explicitely called).
150
179
  __rvm_cleanup_variables() {
151
180
  __rvm_unset_ruby_variables
152
181
 
153
- if [[ "$rvm_sticky_gems" = "1" ]] ; then export rvm_gem_set_name ; else unset rvm_gem_set_name ; fi
182
+ if [[ "$rvm_sticky_flag" = "1" ]] ; then export rvm_gem_set_name ; else unset rvm_gem_set_name ; fi
154
183
 
155
- unset rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_url rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_import_flag rvm_export_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags rvm_uninstall_flag rvm_install_flag rvm_llvm_flag rvm_ruby_bits rvm_ruby_patch rvm_sticky_gems
184
+ unset rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_url rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_import_flag rvm_export_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags rvm_uninstall_flag rvm_install_flag rvm_llvm_flag rvm_ruby_bits rvm_ruby_patch rvm_sticky_flag
156
185
  }
157
186
 
158
187
  # Unset ruby-specific variables
@@ -309,75 +338,106 @@ __rvm_source_dir() {
309
338
  fi
310
339
  }
311
340
 
312
- # List all rvm installed rubies.
341
+ # Query for valid rvm ruby strings
313
342
  # This is meant to be used with scripting.
314
- __rvm_rubies() {
315
- \ls $rvm_rubies_path
343
+ __rvm_list_strings() {
344
+ echo $(\ls $rvm_rubies_path)
316
345
  }
317
346
 
318
347
  # List all rvm installed rubies, default ruby and system ruby.
319
348
  # Display the rubies, indicate their architecture and indicate which is currently used.
320
349
  # This is not meant to be used with scripting. This is for interactive mode usage only.
321
350
  __rvm_list() {
322
- echo
323
- if [[ ! -z "$rvm_all_flag" ]] ; then
324
- while read -r tag
325
- do
326
- prefix="$(echo ${tag/\//} | sed 's#^v1_##' | awk -F'_' '{print "(ruby-)1."$1"."$2}' | sed 's#p$##')"
327
- echo "${prefix}-t${tag/\//}"
328
- unset prefix tag
329
- done < <(svn list http://svn.ruby-lang.org/repos/ruby/tags/ | awk '/^v1_[8|9]/')
330
- echo -e "(ruby-)1.8.6(-p383)\n(ruby-)1.8.6-head\n(ruby-)1.8.7(-p248)\n(ruby-)1.8.7-head\n(ruby-)1.9.1(-p243)\n(ruby-)1.9.1(-p376)\n(ruby-)1.9.1-head\n(ruby-)1.9.2-preview1"
331
- echo -e "jruby-1.2.0\njruby-1.3.0\njruby-1.3.1\njruby(-1.4.0) # the default\njruby-head"
332
- echo -e "rbx(-prc1) # default\nrbx-head"
333
- echo -e "ree-1.8.6\nree(-1.8.7) # the default\nree-1.8.6-head\nree-1.8.7-head"
334
- echo -e "maglev(-22725)"
335
- echo -e "mput(-head) # shyouhei head, the default mput"
336
- echo -e "ironruby-0.9.3 # (1.0 RC1)\nironruby-head"
337
- if [[ "Darwin" = "$(uname)" ]] ; then
338
- echo -e "macruby(-nightly) # the default macruby\nmacruby-head # Build from the macruby git repository"
339
- fi
351
+ action="$(echo $rvm_ruby_args | awk '{print $1}')"
352
+ if [[ "known" = "$action" ]] ; then
353
+ __rvm_list_known
354
+ elif [[ "default" = "$action" ]] ; then
355
+ __rvm_list_default
356
+ elif [[ "rubies" = "$action" ]] ; then
357
+ __rvm_list_rubies
358
+ elif [[ "strings" = "$action" ]] ; then
359
+ __rvm_list_strings
340
360
  else
341
- ruby=$(which ruby 2>/dev/null) ; current_ruby=""
342
- if [[ ! -z "$ruby" ]] && [[ ! -z "$(echo $ruby | awk '/rvm/')" ]] ; then
343
- current_ruby="$(echo $ruby | xargs dirname | xargs dirname | xargs basename 2> /dev/null)"
344
- fi
345
-
346
- echo -e "rvm Rubies\n"
347
- for version in $(\ls $rvm_rubies_path/ 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}') ; do
348
- if [[ ! -z "$(echo $version | awk '/^jruby-/')" ]] ; then
349
- string="[ $($rvm_rubies_path/$version/bin/ruby -v | awk '{print $NF}') ]"
350
- elif [[ ! -z "$(echo $version | awk '/^maglev-|^macruby-/')" ]] ; then
351
- string="[ x86_64 ]"
352
- else
353
- string="[ $(file $rvm_rubies_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
354
- fi
355
- if [[ "$version" = "$current_ruby" ]] ; then echo -n "=> " ; else echo -n " " ; fi
356
- echo -e "$(tput setaf 2)$version$(tput sgr0) $string"
357
- done ; unset version
361
+ echo -e "Usage: rvm list {known,default,rubies,strings}"
362
+ fi
363
+ }
358
364
 
365
+ __rvm_list_default() {
366
+ strings="$(echo $rvm_ruby_args | awk '{print $2}')"
367
+ if [[ "$strings" = "string" ]] ; then
368
+ echo $(grep 'MY_RUBY_HOME' $rvm_config_path/default | awk -F"'" '{print $2}' | xargs basename)
369
+ else
359
370
  if [[ -f "$rvm_config_path/default" ]] && [[ -s $rvm_config_path/default ]] ; then
360
371
  version=$(grep 'MY_RUBY_HOME' $rvm_config_path/default | awk -F"'" '{print $2}' | xargs basename)
361
372
  if [[ ! -z "$version" ]] ; then
362
373
  echo -e "\nDefault Ruby (for new shells)\n"
363
374
  string="[ $(file $rvm_rubies_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
364
- echo -e " $(tput setaf 2)$version$(tput sgr0) $string"
375
+ echo -e " $(tput setaf 2)$version$(tput sgr0) $string\n"
365
376
  fi ; unset version
366
377
  fi
378
+ fi
379
+ }
367
380
 
368
- system_ruby="$(rvm system ; which ruby 2>/dev/null)"
369
- if [[ ! -z "$system_ruby" ]] && [[ -x "$system_ruby" ]]; then
370
- echo -e "\nSystem Ruby\n"
371
- system_version=$($system_ruby -v)
372
- string="[ $(file $system_ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
373
- if [[ ! -z "$system_ruby" ]] && [[ "$current_ruby" = "$system_version" ]] ; then echo -n "=> " ; else echo -n " " ; fi
374
- echo -e "$(tput setaf 2)system$(tput sgr0) $string"
381
+ __rvm_list_known() {
382
+ while read -r tag
383
+ do
384
+ prefix="$(echo ${tag/\//} | sed 's#^v1_##' | awk -F'_' '{print "(ruby-)1."$1"."$2}' | sed 's#p$##')"
385
+ echo "${prefix}-t${tag/\//}"
386
+ unset prefix tag
387
+ done < <(svn list http://svn.ruby-lang.org/repos/ruby/tags/ | awk '/^v1_[8|9]/')
388
+ echo -e "(ruby-)1.8.6(-p383)\n(ruby-)1.8.6-head\n(ruby-)1.8.7(-p248)\n(ruby-)1.8.7-head\n(ruby-)1.9.1(-p243)\n(ruby-)1.9.1(-p376)\n(ruby-)1.9.1-head\n(ruby-)1.9.2-preview1"
389
+ echo -e "jruby-1.2.0\njruby-1.3.1\njruby(-1.4.0) # the default\njruby-head"
390
+ echo -e "rbx(-prc1) # default\nrbx-head"
391
+ echo -e "ree-1.8.6\nree(-1.8.7) # the default\nree-1.8.6-head\nree-1.8.7-head"
392
+ echo -e "maglev(-22891)\nmaglev-head"
393
+ echo -e "mput(-head) # shyouhei head, the default mput"
394
+ echo -e "ironruby-0.9.3 # (1.0 RC1)\nironruby-head"
395
+ if [[ "Darwin" = "$(uname)" ]] ; then
396
+ echo -e "macruby(-nightly) # the default macruby\nmacruby-head # Build from the macruby git repository"
397
+ fi
398
+ }
399
+
400
+ __rvm_list_rubies() {
401
+ echo
402
+ ruby=$(which ruby 2>/dev/null) ; current_ruby=""
403
+ if [[ ! -z "$ruby" ]] && [[ ! -z "$(echo $ruby | awk '/rvm/')" ]] ; then
404
+ current_ruby="$(echo $ruby | xargs dirname | xargs dirname | xargs basename 2> /dev/null)"
405
+ fi
406
+
407
+ echo -e "rvm Rubies\n"
408
+ for version in $(\ls $rvm_rubies_path/ 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}') ; do
409
+ if [[ ! -z "$(echo $version | awk '/^jruby-/')" ]] ; then
410
+ string="[ $($rvm_rubies_path/$version/bin/ruby -v | awk '{print $NF}') ]"
411
+ elif [[ ! -z "$(echo $version | awk '/^maglev-|^macruby-/')" ]] ; then
412
+ string="[ x86_64 ]"
375
413
  else
376
- $rvm_scripts_path/log "info" "No system ruby found."
414
+ string="[ $(file $rvm_rubies_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
377
415
  fi
416
+ if [[ "$version" = "$current_ruby" ]] ; then echo -n "=> " ; else echo -n " " ; fi
417
+ echo -e "$(tput setaf 2)$version$(tput sgr0) $string"
418
+ done ; unset version
378
419
 
379
- unset current_ruby version selected system_ruby system_version string
420
+ if [[ -f "$rvm_config_path/default" ]] && [[ -s $rvm_config_path/default ]] ; then
421
+ version=$(grep 'MY_RUBY_HOME' $rvm_config_path/default | awk -F"'" '{print $2}' | xargs basename)
422
+ if [[ ! -z "$version" ]] ; then
423
+ echo -e "\nDefault Ruby (for new shells)\n"
424
+ string="[ $(file $rvm_rubies_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
425
+ echo -e " $(tput setaf 2)$version$(tput sgr0) $string"
426
+ fi ; unset version
380
427
  fi
428
+
429
+ system_ruby="$(rvm system ; which ruby 2>/dev/null)"
430
+ if [[ ! -z "$system_ruby" ]] && [[ -x "$system_ruby" ]]; then
431
+ echo -e "\nSystem Ruby\n"
432
+ system_version=$($system_ruby -v)
433
+ string="[ $(file $system_ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
434
+ if [[ ! -z "$system_ruby" ]] && [[ "$current_ruby" = "$system_version" ]] ; then echo -n "=> " ; else echo -n " " ; fi
435
+ echo -e "$(tput setaf 2)system$(tput sgr0) $string"
436
+ else
437
+ $rvm_scripts_path/log "info" "No system ruby found."
438
+ fi
439
+
440
+ unset current_ruby version selected system_ruby system_version string
381
441
  echo
382
442
  }
383
443
 
@@ -415,16 +475,6 @@ __rvm_update_rvm() {
415
475
  mkdir -p "$rvm_src_path"
416
476
  __rvm_pushpop "$rvm_src_path"
417
477
 
418
- ruby="$(which ruby 2>/dev/null)"
419
- system_ruby="$(rvm system ; which ruby 2>/dev/null)"
420
- if [[ ! -x "$ruby" ]] ; then
421
- if [[ ! -x "$system" ]] ; then
422
- unset ruby
423
- else
424
- ruby=$system_ruby
425
- fi
426
- fi
427
-
428
478
  if [[ "head" = "$rvm_ruby_revision" ]] || [[ -z "$system_ruby" ]] ; then
429
479
  if [[ -d "$rvm_src_path/rvm/.git" ]] ; then
430
480
  builtin cd $rvm_src_path/rvm/ && git pull origin master && ./scripts/install
@@ -432,15 +482,15 @@ __rvm_update_rvm() {
432
482
  builtin cd $rvm_src_path && git clone git://github.com/wayneeseguin/rvm.git && builtin cd rvm/ && ./install
433
483
  fi
434
484
  else
435
- if [[ "true" = "$($ruby -S gem list rvm --installed)" ]]; then
436
- $ruby -S gem update rvm $rvm_gem_options
437
- else
438
- $ruby -S gem install rvm $rvm_gem_options
439
- fi
440
- # TODO: Check all gem paths instead of simply assuming the last one...
441
- builtin cd "$($ruby -S gem env | grep "\- $HOME" | awk '{print $NF}' | head -n 1)/gems/rvm-$(gem list rvm | sed 's/.*(//' | sed 's/).*//' | awk -F',' '{print $1 ; exit}')" && ./install
485
+ stable_version=$(curl -s http://rvm.beginrescueend.com/releases/stable-version.txt)
486
+
487
+ __rvm_run "fetch" "$rvm_scripts_path/fetch 'http://rvm.beginrescueend.com/releases/rvm-${stable_version}.tar.gz'" "fetching rvm-${stable_version}.tar.gz"
488
+
489
+ __rvm_run "extract" "cat $rvm_archives_path/rvm-${stable_version}.tar.gz | gunzip | tar xf - -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..."
490
+
491
+ __rvm_run "install" "builtin cd $rvm_src_path/rvm-${stable_version}/ ; ./install" "Installing rvm-${stable_version}..."
442
492
  fi
443
- unset ruby system_ruby
493
+
444
494
  __rvm_pushpop
445
495
  $rvm_scripts_path/hook "after_update"
446
496
  }
@@ -730,14 +780,14 @@ __rvm_make_flags() {
730
780
  # Select a gems(et) based on CLI set options and environment.
731
781
  # This only sets 'rvm_ruby_gem_home'
732
782
  __rvm_gems_select() {
733
- if ! which gem >/dev/null 2>&1 ; then return 0 ; fi
783
+ if ! which gem > /dev/null 2>&1 ; then return 0 ; fi
734
784
 
735
785
  rvm_ruby_global_gems_path="$rvm_gems_path/$rvm_ruby_string%global"
736
786
 
737
787
  if [[ -z "$rvm_gem_set_name" ]] ; then
738
788
  # No longer defaulting to 'sticky' gem sets.
739
- # Set 'rvm_sticky_gems=1' in ~/.rvmrc to enable.
740
- if [[ ! -z "$rvm_sticky_gems" ]] ; then
789
+ # Set 'rvm_sticky_flag=1' in ~/.rvmrc to enable.
790
+ if [[ ! -z "$rvm_sticky_flag" ]] ; then
741
791
  if [[ ! -z "$GEM_HOME" ]] ; then
742
792
  rvm_gem_set_name=$(echo $GEM_HOME | xargs basename | awk -F'%' '{print $2}')
743
793
  fi
@@ -749,7 +799,7 @@ __rvm_gems_select() {
749
799
  if [[ ! -z "$rvm_gem_set_name" ]] && ! $rvm_scripts_path/match "$rvm_gem_set_name" "^[0-9]\.[0-9]" ; then
750
800
  rvm_ruby_gem_home="$rvm_gems_path/$rvm_ruby_string%$rvm_gem_set_name"
751
801
  else
752
- if [[ ! -z "$rvm_ruby_interpreter" ]] && [[ ! -z "$rvm_ruby_version" ]] && [[ "$rvm_ruby_interpreter" != "system" ]] ; then
802
+ if [[ ! -z "$rvm_ruby_string" ]] && [[ "$rvm_ruby_interpreter" != "system" ]] ; then
753
803
  rvm_ruby_gem_home="$rvm_gems_path/$rvm_ruby_string"
754
804
  elif [[ -z "$GEM_HOME" ]] && [[ ! -z "$(which gem 2>/dev/null)" ]] ; then
755
805
  rvm_ruby_gem_home=$(gem env gemdir)
@@ -764,7 +814,11 @@ __rvm_gems_select() {
764
814
  rvm_ruby_gem_home="$rvm_gems_path/$rvm_ruby_string%$rvm_gem_set_name"
765
815
  fi
766
816
 
767
- if [[ ! -d "$rvm_ruby_gem_home" ]] ; then mkdir -p $rvm_ruby_gem_home ; fi
817
+ # If the gemset does not exist, then notify the user as such and abort the action.
818
+ if [[ ! -d "$rvm_ruby_gem_home" ]] && [[ ! -z "$rvm_gem_set_name" ]] && [[ -z "$rvm_create_flag" ]]; then
819
+ $rvm_scripts_path/log "error" "Gemset '$rvm_gem_set_name' does not exist, rvm gems create '$rvm_gem_set_name' first."
820
+ return 1
821
+ fi
768
822
 
769
823
  rvm_ruby_gem_path="$rvm_ruby_gem_home:$rvm_ruby_global_gems_path"
770
824
 
@@ -812,7 +866,8 @@ __rvm_gems_use() {
812
866
 
813
867
  if [[ ! -z "$rvm_ruby_gem_home" ]] ; then
814
868
  if [[ ! -d "$rvm_ruby_gem_home" ]] ; then
815
- mkdir -p "$rvm_ruby_gem_home"
869
+ $rvm_scripts_path/log "error" "Gemset '$rvm_gem_set_name' does not exist, rvm gems create '$rvm_gem_set_name' first."
870
+ return 1
816
871
  fi
817
872
 
818
873
  if [[ "$rvm_interactive" = 1 ]] ; then
@@ -824,6 +879,7 @@ __rvm_gems_use() {
824
879
  export BUNDLE_PATH="$rvm_ruby_gem_home"
825
880
  __rvm_use
826
881
  fi
882
+ return 0
827
883
  }
828
884
 
829
885
  __rvm_mono_env() {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rvm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.18
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: 2010-02-18 00:00:00 -05:00
12
+ date: 2010-02-23 00:00:00 -05:00
13
13
  default_executable: rvm-install
14
14
  dependencies: []
15
15
 
@@ -67,7 +67,7 @@ files:
67
67
  - scripts/update
68
68
  - scripts/utility
69
69
  - scripts/version
70
- has_rdoc: true
70
+ has_rdoc: false
71
71
  homepage: http://github.com/wayneeseguin/rvm
72
72
  licenses: []
73
73