rvm 0.0.62 → 0.0.63

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/config/db CHANGED
@@ -1,6 +1,7 @@
1
1
  niceness=0
2
2
  ruby_repo_url=http://svn.ruby-lang.org/repos/ruby
3
3
  rubinius_repo_url=git://github.com/evanphx/rubinius.git
4
+ shyouhei_repo_url=git://github.com/shyouhei/ruby.git
4
5
  macruby_repo_url=git://git.macruby.org/macruby/MacRuby.git
5
6
  macruby_nightly_url=http://macruby.icoretech.org/latest
6
7
  jruby_repo_url=git://kenai.com/jruby~main
@@ -13,9 +14,9 @@ ree_version=1.8.7
13
14
  ree_1.8.6_patch_level=20090610
14
15
  ree_1.8.6_url=http://rubyforge.org/frs/download.php/58677
15
16
  ree_1.8.6_repo_url=git://github.com/FooBarWidget/rubyenterpriseedition.git
16
- ree_1.8.7_url=http://rubyforge.org/frs/download.php/64475
17
+ ree_1.8.7_url=http://rubyforge.org/frs/download.php/66162
17
18
  ree_1.8.7_repo_url=git://github.com/FooBarWidget/rubyenterpriseedition187.git
18
- ree_1.8.7_patch_level=20090928
19
+ ree_1.8.7_patch_level=2009.10
19
20
  ruby_1.9.1_patch_level=243
20
21
  ruby_1.9.2_patch_level=preview1
21
22
  ruby_1.8.5_patch_level=231
data/lib/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 62
4
+ :patch: 63
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.62"
8
+ s.version = "0.0.63"
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-10-22}
12
+ s.date = %q{2009-10-26}
13
13
  s.default_executable = %q{rvm-install}
14
14
  s.description = %q{Manages Ruby interpreter installations and switching between them.}
15
15
  s.email = %q{wayneeseguin@gmail.com}
data/scripts/cli CHANGED
@@ -51,6 +51,7 @@ Implementation
51
51
  jruby - jRuby
52
52
  rbx - rubinius
53
53
  ree - ruby Enterprise Edition
54
+ mput - shyouhei(mput)'s github repository
54
55
  system - use the system ruby (eg. pre-rvm state)
55
56
  default - use rvm set default ruby and system if it hasn't been set.
56
57
 
@@ -129,13 +130,10 @@ function __rvm_parse_args {
129
130
  rvm_ruby_interpreter="$rvm_token"
130
131
  ;;
131
132
 
132
- jruby|ree|macruby|rbx|rubinius|default|all)
133
+ jruby|ree|macruby|rbx|rubinius|mput|shyouhei|default|all)
133
134
  rvm_ruby_interpreter="$rvm_token"
134
135
  rvm_action="${rvm_action:-use}"
135
- #if [[ ! -z "$(echo $1 | awk '/^[0-9]/')" ]] ; then
136
- if [[ ! -z "$1" ]] && [[ "$1" =~ ^[0-9] ]] ; then
137
- rvm_ruby_version=$1 ; shift
138
- fi
136
+ if match "$1" "^[0-9]" ; then rvm_ruby_version=$1 ; shift ; fi
139
137
  ;;
140
138
 
141
139
  gems|gemset)
@@ -191,14 +189,14 @@ function __rvm_parse_args {
191
189
  rvm_parse_break=1
192
190
  fi
193
191
  else
194
- if [[ ! -z "$(echo $1 | awk '/^-/')" ]] ; then
192
+ if match "$1" "^-" ; then
195
193
  unset rvm_ruby_version
196
194
  else
197
- if [[ ! -z "$(echo $1 | awk '/^[0-9]/')" ]] ; then
195
+ if match "$1" "^[0-9]" ; then
198
196
  rvm_ruby_version=$(echo "$1" | tr ',' ' ') ; shift
199
197
  unset rvm_ruby_interpreter
200
198
  else
201
- if [[ "jruby" = "$1" ]] || [[ "rbx" = "$1" ]] || [[ "rubinius" = "$1" ]] || [[ "macruby" = "$1" ]] || [[ "ree" = "$1" ]] || [[ "ruby-enterprise" = "$1" ]] ; then
199
+ if [[ "jruby" = "$1" ]] || [[ "rbx" = "$1" ]] || [[ "rubinius" = "$1" ]] || [[ "macruby" = "$1" ]] || [[ "ree" = "$1" ]] || [[ "ruby-enterprise" = "$1" ]] || [[ "mput" = "$1" ]] || [[ "shyouhei" = "$1" ]] ; then
202
200
  rvm_ruby_interpreter=$1 ; shift
203
201
  else
204
202
  unset rvm_ruby_interpreter rvm_ruby_version
@@ -351,7 +349,7 @@ function __rvm_parse_args {
351
349
  --make) rvm_ruby_make="$1" ; shift ;;
352
350
  --make-install) rvm_ruby_make_install="$1"; shift ;;
353
351
  --nice) rvm_niceness="$1" ; shift ;;
354
- -l|--level) rvm_ruby_patch_level="$1" ; shift ;;
352
+ -l|--level) rvm_ruby_patch_level="p$1" ; shift ;;
355
353
  # TODO: handle this below better (if $1 is null)
356
354
  -m|--gem-set) rvm_gem_set_name="$1" ; shift ;;
357
355
  tests|specs) rvm_action="tests" ;;
@@ -376,28 +374,29 @@ function __rvm_parse_args {
376
374
  *)
377
375
  if [[ ! -z "$rvm_token" ]] ; then
378
376
  if [[ "gems" = "$rvm_action" ]] ; then
379
- if [[ ! -z "$(echo $rvm_token | awk '/\.gems$/')" ]] ; then
380
- rvm_file_name="$(echo $rvm_token | sed 's#\.gems##g').gems"
381
- # elif [[ ! -z "$(echo $rvm_token | awk '/\.gems$/')" ]] ; then
377
+ if [[ ! -z "$(echo "$rvm_token" | awk '/\.gems$/')" ]] ; then
378
+ rvm_file_name="$(echo "$rvm_token" | sed 's#\.gems##g').gems"
379
+ # elif [[ ! -z "$(echo "$rvm_token" | awk '/\.gems$/')" ]] ; then
382
380
  else
383
- rvm_gem_set_name="$(echo $rvm_token | sed 's#\.gems##g')"
381
+ rvm_gem_set_name="$(echo "$rvm_token" | sed 's#\.gems##g')"
384
382
  rvm_file_name="$rvm_gem_set_name.gems"
385
383
  fi
386
- elif [[ ! -z "$(echo $rvm_token | awk '/,/')" ]] ; then
384
+ elif [[ ! -z "$(echo "$rvm_token" | awk '/,/')" ]] ; then
387
385
  rvm_ruby_version="$rvm_token"
388
386
  if [[ -z "$rvm_action" ]] ; then
389
387
  rvm_action="do" # Not sure if we really want to do this but we'll try it out.
390
388
  fi
391
- elif [[ ! -z "$(echo $rvm_token | awk '/^.+%.+$/')" ]] ; then
392
- rvm_gem_set_name="$(echo $rvm_token | awk -F'%' '{print $2}')"
393
- rvm_ruby_string="$(echo $rvm_token | awk -F'%' '{print $1}')"
394
- #elif [[ ! -z "$(echo $rvm_token | awk '/^[0-9].[0-9]/')" ]] ; then
395
- elif [[ ! -z "$rvm_token" ]] && [[ "$rvm_token" =~ ^[0-9].[0-9] ]] ; then
389
+ elif match "$rvm_token" "^.+%.+$" ; then
390
+ rvm_gem_set_name="$(echo "$rvm_token" | awk -F'%' '{print $2}')"
391
+ rvm_ruby_string="$(echo "$rvm_token" | awk -F'%' '{print $1}')"
392
+ elif match "$rvm_token" "^[0-9].[0-9]" ; then
393
+ rvm_ruby_string="$rvm_token"
394
+ rvm_action="${rvm_action:-use}"
395
+ elif match "$rvm_token" "^ree" ; then
396
396
  rvm_ruby_string="$rvm_token"
397
- rvm_action="${rvm_action:-rvm_token}"
397
+ rvm_action="${rvm_action:-use}"
398
398
  else
399
- if [[ ! -z "$(echo $rvm_token | awk '/\.rb$/{print}')" ]] ; then # we have a specified ruby script
400
- #if [[ ! -z "$rvm_token" ]] && [[ " ! $rvm_token =~ \.rb$ ]] ; then # we have a specified ruby script
399
+ if match "$rvm_token" "\.rb$" ; then # we have a specified ruby script
401
400
  rvm_ruby_args=$rvm_token
402
401
  rvm_ruby_file=$rvm_token
403
402
  if [[ -z "$rvm_action" ]] ; then
data/scripts/completion CHANGED
@@ -148,7 +148,6 @@ function _rvm {
148
148
  version) __rvm_version ; result=$? ;;
149
149
  reset) __rvm_reset ; result=$? ;;
150
150
  # TODO: how can we use bin_path here for reload, default file?
151
- reload) __rvm_reload ; result=$? ;;
152
151
  implode) __rvm_implode ; result=$? ;;
153
152
  update) __rvm_update ; result=$? ;;
154
153
  readline) __rvm_readline_install ; result=$? ;;
@@ -157,6 +156,7 @@ function _rvm {
157
156
  usage|help) __rvm_usage ; result=$? ;;
158
157
  bench|benchmark) __rvm_benchmark ; result=$? ;;
159
158
  rubydo|rakedo|gemdo) __rvm_do ; result=$? ;;
159
+ reload) source ~/.rvm/scripts/rvm ; result=$? ;;
160
160
 
161
161
  gemsync)
162
162
  result=0
data/scripts/gems CHANGED
@@ -34,7 +34,7 @@ __rvm_gems_select() {
34
34
  rvm_gem_set_name=$(echo $rvm_ruby_gem_home | xargs basename | awk -F'%' '{print $2}')
35
35
  fi
36
36
 
37
- if [[ ! -z "$rvm_gem_set_name" ]] && [[ ! "$rvm_gem_set_name" =~ ^\d\.\d ]] ; then
37
+ if [[ ! -z "$rvm_gem_set_name" ]] && ! match "$rvm_gem_set_name" "^[0-9]\.[0-9]" ; then
38
38
  rvm_ruby_gem_home="$rvm_gem_path/$rvm_ruby_interpreter/$rvm_ruby_version%$rvm_gem_set_name"
39
39
  else
40
40
  if [[ ! -z "$rvm_ruby_interpreter" ]] && [[ ! -z "$rvm_ruby_version" ]] && [[ "$rvm_ruby_interpreter" != "system" ]] ; then
@@ -156,7 +156,7 @@ __rvm_gems_load() {
156
156
  # TODO: Switch to a different field separator than ; to allow for evals
157
157
  gem="$(echo $line | awk -F';' '{print $1}')"
158
158
  gem_prefix="$(echo $line | awk -F';' '{print $2}')"
159
- if [[ ! -z "$gem" ]] && [[ "$gem" =~ \.gem$ ]] ; then
159
+ if match "$gem" "\.gem$" ; then
160
160
  gem_name="$(basename $gem | sed 's#\.gem##' | awk -F'-' '{$NF=NULL;print}')"
161
161
  gem_version="$(basename $gem | sed 's#\.gem##' | awk -F'-' '{print $NF}' )"
162
162
  gem_postfix="$(basename $gem | sed "s#.*\.gem##")"
@@ -169,7 +169,7 @@ __rvm_gems_load() {
169
169
  if [[ -f "$gem" ]] ; then
170
170
  gem_file_name="$gem"
171
171
  cache_file="$gem"
172
- elif [[ ! -z "$gem" ]] && [[ "$gem" =~ ".gem$" ]] ; then
172
+ elif match "$gem" ".gem$" ]] ; then
173
173
  gem_file_name="$gem"
174
174
  elif [[ -z "${gem_version/ /}" ]] ; then # no version
175
175
  gem_file_name="${gem_name/ /}*.gem"
@@ -193,8 +193,8 @@ __rvm_gems_load() {
193
193
  else # cached
194
194
  gem_file_name="$(basename "$cache_file")"
195
195
  gem_string="$(echo "$gem_file_name" | sed 's#\.gem$##')"
196
+ # TODO: Switch this to use match
196
197
  if [[ ! -z "$(echo "$rvm_ruby_gem_list" | awk "/${gem_name/ /} \(.*$gem_version/{print}")" ]] ; then
197
- #if [[ ! -z "$rvm_ruby_gem_list" ]] && [[ "$rvm_ruby_gem_list" =~ $gem_string ]] ; then
198
198
  if [[ ! -z "$rvm_force_flag" ]] ; then
199
199
  cp $cache_file $rvm_temp_path/$gem_file_name
200
200
  gem="$rvm_temp_path/$gem_file_name" # install as a named local gem
@@ -56,12 +56,12 @@ function __rvm_install_source {
56
56
  if [[ -d "$rvm_ruby_src_path/.svn" ]] ; then
57
57
  cd $rvm_ruby_src_path
58
58
  if [[ -z "$rvm_rev" ]] ; then
59
- svn update
59
+ __rvm_run "svn.update" "svn update"
60
60
  else
61
- svn checkout -q $rvm_rev
61
+ __rvm_run "svn.checkout" "svn checkout -q $rvm_rev"
62
62
  fi
63
63
  else
64
- svn checkout -q $rvm_rev --force $rvm_url $rvm_ruby_src_path
64
+ __rvm_run "svn.checkout" "svn checkout -q $rvm_rev --force $rvm_url $rvm_ruby_src_path"
65
65
  fi
66
66
  if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
67
67
  fi
@@ -322,6 +322,67 @@ RubyWrapper
322
322
  done ; unset rvm_gem_name
323
323
  ;;
324
324
 
325
+ mput|shyouhei)
326
+ unset GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC
327
+ PATH=$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)
328
+ PATH=$rvm_bin_path:$PATH ; export PATH
329
+
330
+ rvm_ruby_repo_url=$rvm_shyouhei_repo_url
331
+ rvm_ruby_configure=" "
332
+ rvm_ruby_src_path=$rvm_ruby_home
333
+ # rvm_ruby_make="rake"
334
+ # rvm_ruby_make_install="rake install"
335
+ rvm_ruby_home="$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version"
336
+ # rvm_ruby_revision="head"
337
+
338
+ if [[ ! -d "$rvm_ruby_src_path" ]] || [[ ! -d "$rvm_ruby_src_path/.git" ]] ; then
339
+ rm -rf $rvm_ruby_src_path
340
+ __rvm_run "mput.repo" "git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_src_path" "Cloning $rvm_ruby_repo_url"
341
+ cd $rvm_ruby_home
342
+ else
343
+ cd $rvm_ruby_home
344
+ __rvm_run "mput.repo" "git pull origin trunk" "Pulling from origin trunk"
345
+ fi
346
+
347
+ if [[ ! -s "$rvm_ruby_src_path/configure" ]] ; then
348
+ rvm_autoconf="$(which autoconf)"
349
+ if [[ $? -gt 0 ]] ; then __rvm_log "fail" "rvm expects autoconf" ; result=$? ; return $result ; fi
350
+ __rvm_run "autoconf" "$rvm_autoconf" "Running autoconf"
351
+ # if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi # Don't barf on autoconf fail...
352
+ fi
353
+
354
+ if [[ -s ./Makefile ]] && [[ -z "$rvm_reconfigure_flag" ]] ; then
355
+ __rvm_log "debug" "Skipping configure step, Makefile exists so configure must have already been run."
356
+ elif [[ -s ./configure ]] ; then
357
+ __rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure $configure_parameters" "Configuring $rvm_ruby_package_name using $rvm_ruby_configure, this may take a while depending on your cpu(s)..."
358
+ if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
359
+ unset configure_parameters
360
+ elif [[ ! -z "rvm_ruby_configure" ]] ; then
361
+ $rvm_ruby_configure
362
+ else
363
+ __rvm_log "error" "Skipping configure step, 'configure' script does not exist, did autoconf not run successfully?"
364
+ fi
365
+
366
+ rvm_ruby_make=${rvm_ruby_make:-"/usr/bin/make"}
367
+ __rvm_run "make" "$rvm_ruby_make $rvm_make_flags" "Compiling $rvm_ruby_package_name, this may take a while, depending on your cpu(s)..."
368
+ if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
369
+
370
+ rvm_ruby_make_install=${rvm_ruby_make_install:-"/usr/bin/make install"}
371
+ __rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_package_name"
372
+ if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
373
+
374
+ __rvm_log "info" "Installation of $rvm_ruby_package_name is complete."
375
+
376
+ GEM_HOME="$rvm_ruby_gem_home" ; export GEM_HOME
377
+ GEM_PATH="$rvm_ruby_gem_home" ; export GEM_PATH
378
+
379
+ __rvm_rubygems_setup
380
+ __rvm_bin_script
381
+ __rvm_run "chmod.bin" "chmod +x $rvm_ruby_home/bin/*"
382
+ __rvm_post_install
383
+ __rvm_pushpop
384
+ ;;
385
+
325
386
  ruby)
326
387
  __rvm_install_source $*
327
388
  ;;
@@ -451,7 +512,7 @@ function __rvm_post_install {
451
512
  }
452
513
 
453
514
  function __rvm_rubygems_setup {
454
- if [[ ! -z "$(echo $rvm_ruby_version | awk '/^1\.9/')" ]] ; then
515
+ if [[ ! -z "$(echo $rvm_ruby_version | awk '/^1\.9/')" ]] || [[ ! -z "$(echo $rvm_ruby_interpreter | awk '/^mput/')" ]] ; then
455
516
  # 1.9 has it's own built-in gem command
456
517
  __rvm_inject_ruby_shebang "$rvm_ruby_src_path/bin/gem"
457
518
  __rvm_inject_gem_env "$rvm_ruby_home/bin/gem"
data/scripts/rvm-prompt CHANGED
@@ -1,8 +1,52 @@
1
1
  #!/bin/bash
2
- if [[ ! -z "$(which ruby | awk '/\.rvm/{print}')" ]] ; then
3
- command=$(which ruby)
4
- if [[ ! -z "$command" ]] ; then
5
- echo "[$(echo $command | xargs dirname | xargs dirname | xargs basename | tr '-' ':')]"
6
- fi ; unset command
2
+
3
+ add(){
4
+ token="$1"
5
+ eval "${token}_flag=1" ; shift
6
+ if [[ ! -z "$format" ]] ; then
7
+ format="${format}-\$${token}"
8
+ else
9
+ format="\$${token}"
10
+ fi
11
+ }
12
+
13
+ if [[ ! -z "$(which ruby | awk '/rvm/{print}')" ]] ; then
14
+ unset format
15
+ while [[ $# -gt 0 ]] ; do
16
+ token="$1" ; shift
17
+ case "$token" in
18
+ i|interpreter) add "interpreter" ;;
19
+ v|version) add "version" ;;
20
+ p|patchlevel) add "patchlevel" ;;
21
+ r|revision) add "revision" ;;
22
+ a|architecture) add "architecture" ;;
23
+ *) echo "Unrecognized command line option '$token' for $0" ; exit 1 ;;
24
+ esac
25
+ done
26
+
27
+ if [[ -z "$format" ]] ; then
28
+ add "interpreter"
29
+ add "version"
30
+ add "patchlevel"
31
+ fi
32
+
33
+ ruby_string=$(dirname "$(which ruby)" | xargs dirname | xargs basename)
34
+ if [[ ! -z "$interpreter_flag" ]] ; then
35
+ interpreter="$(echo $ruby_string | awk -F'-' '{print $1}')"
36
+ fi
37
+ if [[ ! -z "$version_flag" ]] ; then
38
+ version="$(echo $ruby_string | awk -F'-' '{print $2}')"
39
+ fi
40
+ if [[ ! -z "$patchlevel_flag" ]] ; then
41
+ patchlevel=$(echo $ruby_string | awk -F'-' '{print $3}')
42
+ fi
43
+ if [[ ! -z "$architecture_flag" ]] ; then
44
+ architecture="$(echo "$(ruby -v)" | sed 's/^.*\[//' | sed 's/\].*$//')"
45
+ fi
46
+
47
+ command="prompt=\"[$format]\""
48
+ eval "$command"
49
+ echo "${prompt/-]/]}"
7
50
  fi
8
51
 
52
+ exit 0
data/scripts/selector CHANGED
@@ -2,29 +2,13 @@
2
2
 
3
3
  # __rvm_select implementation version patch_level
4
4
  function __rvm_select {
5
- if [[ ! -z "$rvm_ruby_string" ]] ; then
6
- if [[ ! -z "$(echo "$rvm_ruby_string" | awk '/^.+%.+$/')" ]] ; then
7
- rvm_gem_set_name="$(echo "$rvm_ruby_string" | awk -F'%' '{print $2}')"
8
- rvm_ruby_string="$(echo "$rvm_ruby_string" | awk -F'%' '{print $1}')"
9
- fi
10
-
11
- if [[ ! -z "$(echo "$rvm_ruby_string" | awk '/^[0-9]/')" ]] ; then
12
- rvm_ruby_interpreter="${rvm_ruby_interpreter:-ruby}"
13
- rvm_ruby_version=$rvm_ruby_string
14
- else
15
- rvm_ruby_interpreter="$rvm_ruby_string"
16
- unset rvm_ruby_version
17
- fi
18
- elif [[ ! -z "$rvm_ruby_interpreter" ]] ; then
19
- if [[ ! -z "$(echo $rvm_ruby_interpreter | awk '/^[0-9]/')" ]] ; then
20
- rvm_ruby_version=$rvm_ruby_interpreter
21
- rvm_ruby_interpreter="ruby"
22
- else
23
- rvm_ruby_interpreter="${rvm_ruby_interpreter:-ruby}" # Default is standard ruby
24
- fi
5
+ if [[ -z "$rvm_ruby_string" ]] ; then
6
+ rvm_ruby_string="$rvm_ruby_interpreter"
7
+ if [[ ! -z "$rvm_ruby_version" ]] ; then rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_version" ; fi
8
+ if [[ ! -z "$rvm_ruby_patch_level" ]] ; then rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_patch_level" ; fi
9
+ if [[ ! -z "$rvm_ruby_revision" ]] ; then rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_revision" ; fi
25
10
  fi
26
-
27
- if [[ ! -z "$rvm_ruby_string" ]] ; then __rvm_ruby_string ; fi
11
+ __rvm_ruby_string
28
12
  if [[ "1.8" = "$rvm_ruby_version" ]] ; then rvm_ruby_version="1.8.6" ; fi
29
13
  if [[ "1.9" = "$rvm_ruby_version" ]] ; then rvm_ruby_version="1.9.1" ; fi
30
14
 
@@ -49,6 +33,7 @@ function __rvm_select {
49
33
  #rvm_ruby_revision="head"
50
34
  unset rvm_ruby_patch_level
51
35
  rvm_ruby_repo_url=${rvm_rbx_repo_url:-"$(__rvm_db "rubinius_repo_url")"}
36
+ rvm_ruby_string="rbx-head"
52
37
  rvm_url=$rvm_ruby_repo_url
53
38
  rvm_ruby_configure=""
54
39
  rvm_ruby_make="build"
@@ -56,19 +41,18 @@ function __rvm_select {
56
41
  ;;
57
42
 
58
43
  jruby)
59
- rvm_ruby_version="${rvm_ruby_version:-"$(__rvm_db "jruby_version")"}"
60
44
  rvm_jruby_repo_url="${rvm_jruby_repo_url:-"git://kenai.com/jruby~main"}"
61
- if [[ ! -z "$(echo $rvm_ruby_version | awk '/^1.4/')" ]] ; then
45
+ rvm_ruby_version="${rvm_ruby_version:-"$(__rvm_db "jruby_version")"}"
46
+ unset rvm_ruby_patch_level
47
+ if match "$rvm_ruby_version" "^1.4" ; then
62
48
  rvm_ruby_version="1.4.0RC1"
49
+ rvm_ruby_string="jruby-1.4.0RC1"
63
50
  rvm_package_file="$rvm_ruby_interpreter-bin-${rvm_ruby_version}"
64
51
  else
65
52
  rvm_package_file="$rvm_ruby_interpreter-bin-$rvm_ruby_version"
53
+ rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}"
66
54
  fi
67
55
  rvm_url="http://dist.codehaus.org/$rvm_ruby_interpreter/$rvm_ruby_version/$rvm_package_file.tar.gz"
68
- unset rvm_ruby_patch_level
69
- if [[ -z "$(echo $rvm_ruby_version | awk '/^1\.[2-4]/')" ]] ; then
70
- __rvm_log "fail" "Unknown jRuby version: $rvm_ruby_version"
71
- fi
72
56
  alias jruby_ng="jruby --ng"
73
57
  alias jruby_ng_server="jruby --ng-server"
74
58
  ;;
@@ -76,22 +60,44 @@ function __rvm_select {
76
60
  ruby-enterprise|ree)
77
61
  rvm_ruby_interpreter=ree
78
62
  rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "ree_version")"}
79
- if [[ "$rvm_ruby_version" != "head" ]] ; then
63
+ if [[ -z "$rvm_ruby_patch_level" ]] ; then
80
64
  rvm_ruby_patch_level="${rvm_ruby_patch_level:-$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_patch_level")}"
65
+ else
66
+ rvm_ruby_patch_level="$(echo $rvm_ruby_patch_level | sed 's#^p##')"
81
67
  fi
82
- rvm_ruby_package_name="ree-$rvm_ruby_version-$rvm_ruby_patch_level"
83
- rvm_ruby_package_file="ruby-enterprise-$rvm_ruby_version-$rvm_ruby_patch_level"
84
- if [[ -z "$(echo $rvm_ruby_version | awk '/^1\.8/')" ]] ; then
68
+ rvm_ruby_string="${rvm_ruby_interpreter}-${rvm_ruby_version}-${rvm_ruby_patch_level}"
69
+
70
+ if [[ "$rvm_ruby_version" != "head" ]] ; then
71
+ if [[ ! -z "$rvm_ruby_revision" ]] ; then
72
+ unset rvm_ruby_patch_level rvm_ruby_package_file
73
+ rvm_ruby_package_name="ree-$rvm_ruby_version-$rvm_ruby_revision"
74
+ else
75
+ rvm_ruby_package_file="ruby-enterprise-$rvm_ruby_version-$rvm_ruby_patch_level"
76
+ rvm_url="${rvm_url:-$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_url")}/$rvm_ruby_package_file.tar.gz"
77
+ fi
78
+ fi
79
+ if ! match "$rvm_ruby_version" "^1\.8" ; then
85
80
  __rvm_log "fail" "Unknown Ruby Enterprise Edition version: $rvm_ruby_version"
86
81
  fi
87
82
  ;;
88
83
 
84
+ mput|shyouhei)
85
+ rvm_ruby_interpreter="mput"
86
+ rvm_ruby_version="head"
87
+ rvm_ruby_string="mput-head"
88
+ unset rvm_ruby_patch_level
89
+ rvm_ruby_repo_url=${rvm_mput_repo_url:-"$(__rvm_db "shyouhei_repo_url")"}
90
+ rvm_url=$rvm_ruby_repo_url
91
+ unset rvm_ruby_configure rvm_ruby_make rvm_ruby_make_install
92
+ ;;
93
+
89
94
  ruby)
90
95
  if [[ ! -z "$rvm_ruby_tag" ]] ; then
91
96
  rvm_ruby_version=$(echo $rvm_ruby_tag | sed 's#^v##' | sed 's#/##' | awk -F'_' '{print 1 "." $2 "." $3 }')
92
97
  # rvm_ruby_patch_level=$rvm_ruby_tag # $(echo $rvm_ruby_tag | sed 's#^v##' | sed 's#/##' | awk -F'_' '{print $4 }')
93
- if [[ -z "$rvm_ruby_patch_level" ]] ; then rvm_ruby_patch_level=$rvm_Ruby_tag ; fi
98
+ if [[ -z "$rvm_ruby_patch_level" ]] ; then rvm_ruby_patch_level=$rvm_ruby_tag ; fi
94
99
  fi
100
+ if [[ ! -z "$rvm_head_flag" ]] ; then rvm_ruby_repo_url="${rvm_ruby_repo_url:-"$(__rvm_db "ruby_repo_url")"}" ; fi
95
101
  if [[ -z "$rvm_ruby_version" ]] ; then rvm_ruby_version=$(__rvm_db "ruby_version") ; fi
96
102
  if [[ -z "$rvm_ruby_patch_level" ]] ; then rvm_ruby_patch_level="$(__rvm_db "ruby_${rvm_ruby_version/ /}_patch_level")" ; fi
97
103
  if [[ -z "$rvm_ruby_patch_level" ]] ; then unset rvm_ruby_patch_level ; fi
@@ -124,26 +130,18 @@ function __rvm_select {
124
130
  if [[ ! -z "$rvm_ruby_interpreter" ]] && [[ ! -z "$rvm_ruby_version" ]] && [[ "system" != "$rvm_ruby_interpreter" ]] ; then
125
131
  rvm_major_version=$(echo $rvm_ruby_version | awk -F'.' '{ print $2 }')
126
132
  rvm_minor_version=$(echo $rvm_ruby_version | awk -F'.' '{ print $3 }')
127
-
128
- if [[ -z "$rvm_ruby_patch_level" ]] ; then
129
- rvm_ruby_package_name="${rvm_ruby_package_name:-"$rvm_ruby_interpreter-$rvm_ruby_version"}"
130
- rvm_ruby_home="${rvm_ruby_home:-"$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version"}"
131
- else
132
- if [[ "$rvm_ruby_interpreter" != "ree" ]] ; then
133
- if [[ ! -z "$(echo $rvm_ruby_patch_level | awk '/^[0-9]/')" ]] ; then
134
- rvm_ruby_patch_level="p$rvm_ruby_patch_level"
135
- fi
136
- rvm_ruby_patch_level="$(echo $rvm_ruby_patch_level | sed 's#^pp#p#')" # sanity check, thanks sfpyra
137
- fi
138
- rvm_ruby_package_name="${rvm_ruby_package_name:-"$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level"}"
139
- rvm_ruby_home="${rvm_ruby_home:-"$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level"}"
140
- fi
141
-
142
- rvm_ruby_string="$rvm_ruby_package_name"
143
- rvm_ruby_log_path="$rvm_log_path/$rvm_ruby_package_name"
133
+ rvm_ruby_package_name="$rvm_ruby_string"
134
+ rvm_ruby_home="$rvm_path/$rvm_ruby_string"
135
+ rvm_ruby_log_path="$rvm_log_path/$rvm_ruby_string"
144
136
  rvm_ruby_src_path="$rvm_src_path/$rvm_ruby_string"
145
137
  rvm_ruby_binary="$rvm_ruby_home/bin/ruby"
146
138
  rvm_ruby_irbrc="$rvm_ruby_home/.irbrc"
139
+ if [[ -z "$rvm_gem_set_name" ]] ; then
140
+ rvm_ruby_gem_home="${rvm_gem_path}/${rvm_ruby_interpreter}/${rvm_ruby_version}"
141
+ else
142
+ rvm_ruby_gem_home="${rvm_gem_path}/${rvm_ruby_interpreter}/${rvm_ruby_version}%${rvm_gem_set_name}"
143
+ fi
144
+
147
145
  rvm_ruby_selected_flag=1
148
146
 
149
147
  export rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_url rvm_ruby_patch_level rvm_ruby_configure rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_gem_set_name rvm_gem_path rvm_ruby_gem_home rvm_path rvm_src_path rvm_bin_path rvm_ruby_binary rvm_ruby_home rvm_log_path rvm_ruby_log_path rvm_src_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string
@@ -188,7 +186,7 @@ function __rvm_use {
188
186
  GEM_HOME=$rvm_ruby_gem_home ; export GEM_HOME
189
187
  GEM_PATH=$rvm_ruby_gem_home ; export GEM_PATH
190
188
  MY_RUBY_HOME=$rvm_ruby_home ; export MY_RUBY_HOME
191
- RUBY_VERSION=$rvm_ruby_package_name ; export RUBY_VERSION
189
+ RUBY_VERSION=$rvm_ruby_string ; export RUBY_VERSION
192
190
  IRBRC="$rvm_ruby_irbrc" ; export IRBRC
193
191
  if [[ -z "$IRBRC" ]] ; then unset IRBRC ; fi
194
192
 
@@ -227,10 +225,10 @@ function __rvm_use {
227
225
  fi
228
226
  done ; unset variable value
229
227
 
230
- if [[ -s $rvm_path/bin/$rvm_ruby_package_name ]] ; then
231
- ln -fs $rvm_path/bin/$rvm_ruby_package_name $rvm_path/bin/default-ruby # So that people know what it's for :)
232
- ln -fs $rvm_path/bin/gem-$rvm_ruby_package_name $rvm_path/bin/default-gem
233
- ln -fs $rvm_path/bin/irb-$rvm_ruby_package_name $rvm_path/bin/default-irb
228
+ if [[ -s "$rvm_path/bin/$rvm_ruby_string" ]] ; then
229
+ ln -fs "$rvm_path/bin/$rvm_ruby_string" "$rvm_path/bin/default-ruby" # So that people know what it's for :)
230
+ ln -fs "$rvm_path/bin/gem-$rvm_ruby_string" "$rvm_path/bin/default-gem"
231
+ ln -fs "$rvm_path/bin/irb-$rvm_ruby_string" "$rvm_path/bin/default-irb"
234
232
  else
235
233
  rm -f $rvm_path/bin/default*
236
234
  fi
@@ -243,65 +241,107 @@ function __rvm_use {
243
241
  }
244
242
 
245
243
  function __rvm_ruby_string {
246
- if [[ "system" = "$rvm_ruby_interpreter" ]] ; then
247
- rvm_ruby_string="system"
248
- elif [[ ! -z "$rvm_ruby_string" ]] ; then
249
- ruby_string=$(echo "$rvm_ruby_string" | sed 's#ruby-enterprise#ree#g') # dash-antics
250
- if [[ ! -z "$(echo "$rvm_ruby_string" | awk -F'%' '{print $2}')" ]] ; then
251
- rvm_gem_set_name=$(echo "$rvm_ruby_string" | awk -F'%' '{print $2}')
252
- fi
253
- set +x
254
- ruby_string=$(echo "$rvm_ruby_string" | awk -F'%' '{print $1}')
255
- __rvm_unset_ruby_variables
256
-
257
- rvm_ruby_interpreter=$(echo $ruby_string | awk -F'-' '{print $1}')
258
- rvm_ruby_version=$(echo $ruby_string | awk -F'-' '{print $2}')
259
- if [[ "$rvm_ruby_version" != "head" ]] ; then
260
- patch_level=$(echo $ruby_string | awk -F'-' '{print $3}')
261
- if [[ ! -z "$patch_level" ]] ; then rvm_ruby_patch_level="$patch_level" ; fi
244
+ if [[ ! -z "$rvm_ruby_string" ]] ; then
245
+ if [[ "system" = "$rvm_ruby_string" ]] ; then
246
+ __rvm_unset_ruby_variables
247
+ rvm_ruby_interpreter="system"
262
248
  else
263
- rvm_ruby_patch_level="head"
264
- fi
249
+ ruby_string="${rvm_ruby_string/ruby-enterprise/ree}"
265
250
 
266
- if [[ ! -z "$(echo $rvm_ruby_interpreter | awk '/^1\.[8-9]/')" ]] ; then
267
- rvm_ruby_patch_level=$rvm_ruby_version
268
- rvm_ruby_version=$rvm_ruby_interpreter
269
- rvm_ruby_interpreter="ruby"
270
- if [[ -z "$rvm_ruby_patch_level" ]] ; then
271
- if [[ "$rvm_ruby_version" != "head" ]] ; then
272
- rvm_ruby_patch_level="$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_patch_level")"
273
- else
274
- rvm_ruby_patch_level="head"
251
+ __rvm_unset_ruby_variables
252
+
253
+ if [[ ! -z "$(echo "$ruby_string" | awk -F'%' '{print $2}')" ]] ; then
254
+ rvm_gem_set_name=$(echo "$ruby_string" | awk -F'%' '{print $2}')
255
+ fi
256
+
257
+ ruby_string=$(echo "$ruby_string" | awk -F'%' '{print $1}')
258
+ rvm_ruby_interpreter=$(echo $ruby_string | awk -F'-' '{print $1}')
259
+ rvm_ruby_version=$(echo $ruby_string | awk -F'-' '{print $2}')
260
+
261
+ if [[ "$rvm_ruby_version" != "head" ]] ; then
262
+ patch_level=$(echo $ruby_string | awk -F'-' '{print $3}')
263
+ if [[ ! -z "$patch_level" ]] ; then rvm_ruby_patch_level="$patch_level" ; fi
264
+ else
265
+ unset rvm_ruby_version
266
+ rvm_head_flag=1
267
+ rvm_ruby_revision="head"
268
+ rvm_ruby_patch_level="head"
269
+ fi
270
+
271
+ if match "$rvm_ruby_interpreter" "^1\.[8-9]" ; then
272
+ rvm_ruby_patch_level=$rvm_ruby_version
273
+ rvm_ruby_version=$rvm_ruby_interpreter
274
+ rvm_ruby_interpreter="ruby"
275
+ if [[ -z "$rvm_ruby_patch_level" ]] ; then
276
+ if [[ "$rvm_ruby_version" != "head" ]] ; then
277
+ rvm_ruby_patch_level="p$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_patch_level")"
278
+ else
279
+ unset rvm_ruby_version
280
+ rvm_head_flag=1
281
+ rvm_ruby_revision="head"
282
+ rvm_ruby_patch_level="head"
283
+ fi
275
284
  fi
285
+ elif match "$rvm_ruby_interpreter" "^1\.[3-4]" ; then
286
+ rvm_ruby_version=$rvm_ruby_interpreter
287
+ rvm_ruby_interpreter=jruby
288
+ unset rvm_ruby_patch_level
276
289
  fi
277
- elif [[ ! -z "$(echo $rvm_ruby_interpreter | awk '/^1\.[3-4]/')" ]] ; then
278
- rvm_ruby_version=$rvm_ruby_interpreter
279
- rvm_ruby_interpreter=jruby
280
- unset rvm_ruby_patch_level
281
- fi
282
290
 
283
- if [[ "head" = "$rvm_ruby_version" ]] ; then
284
- revision="head"
285
- if [[ "ree" = "$rvm_ruby_interpreter" ]] ; then rvm_ruby_version="1.8.7" ; fi
286
- if [[ "rbx" = "$rvm_ruby_interpreter" ]] ; then unset revision ; fi
287
- else
288
- revision=$(echo $ruby_string | awk -F'-' '{print $3}')
289
- fi
291
+ if match "$rvm_ruby_patch_level" "^r" ; then
292
+ rvm_ruby_revision=$rvm_ruby_patch_level
293
+ unset rvm_ruby_patch_level
294
+ fi
290
295
 
291
- if [[ "head" = "$revision" ]] || [[ "preview" = "$revision" ]] ; then
292
- rvm_ruby_revision="$revision"
293
- else
294
- if [[ ! -z "$(echo $revision | awk '/^p[0-9]\+/')" ]] ; then
295
- rvm_ruby_patch_level=${rvm_ruby_patch_level:-$(echo $revision | awk -F'p' '{print $2}')}
296
+ if [[ "head" = "$rvm_ruby_version" ]] || [[ "head" = "$rvm_ruby_patch_level" ]] || [[ 1 = "$rvm_head_flag" ]] ; then
297
+ rvm_ruby_patch_level="head"
298
+ rvm_head_flag=1
299
+ if [[ "rbx" = "$rvm_ruby_interpreter" ]] ; then unset rvm_ruby_patch_level ; fi
300
+ if [[ "mput" = "$rvm_ruby_interpreter" ]] ; then unset rvm_ruby_patch_level ; fi
296
301
  else
297
- if [[ ! -z "$(echo $revision | awk '/^[0-9]\+/')" ]] ; then
298
- rvm_ruby_revision="$revision"
302
+ revision=$(echo $ruby_string | awk -F'-' '{print $3}')
303
+ if [[ ! -z "$revision" ]] ; then
304
+ if match "$revision" "^p" ; then
305
+ rvm_ruby_patch_level="$revision"
306
+ # if [[ "preview" == "$revision" ]] ; then
307
+ elif match "$revision" "^[0-9]" ; then
308
+ if [[ "ree" = "$rvm_ruby_interpreter" ]] ; then
309
+ rvm_ruby_patch_level="$revision"
310
+ unset rvm_ruby_revision
311
+ else
312
+ rvm_ruby_revision="r$revision"
313
+ fi
314
+ elif match "$revision" "^r" ; then
315
+ rvm_ruby_revision="$revision"
316
+ elif match "$revision" "^t" ; then
317
+ rvm_ruby_tag="$revision"
318
+ else
319
+ unset rvm_ruby_patch_level rvm_ruby_revision rvm_ruby_tag
320
+ fi ; unset revision
299
321
  else
300
- unset rvm_ruby_revision
322
+ patch_level="$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_patch_level")"
323
+ if [[ ! -z "$patch_level" ]] ; then
324
+ rvm_ruby_patch_level="p$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_patch_level")"
325
+ else
326
+ unset rvm_ruby_patch_level
327
+ fi ; unset patch_level
328
+ fi
329
+ fi
330
+
331
+ if [[ ! -z "$rvm_ruby_revision" ]] ; then
332
+ rvm_ruby_string="$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_revision"
333
+ elif [[ ! -z "$rvm_ruby_patch_level" ]] ; then
334
+ if match "$rvm_ruby_patch_level" "^[0-9]" ; then
335
+ rvm_ruby_patch_level="p$rvm_ruby_patch_level"
301
336
  fi
337
+ rvm_ruby_patch_level="$(echo $rvm_ruby_patch_level | sed 's#^pp#p#')" # sanity check, thanks sfpyra
338
+ rvm_ruby_string="$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level"
339
+ else
340
+ rvm_ruby_string="$rvm_ruby_interpreter-$rvm_ruby_version"
302
341
  fi
342
+
343
+ unset ruby_string
303
344
  fi
304
- unset ruby_string
305
345
  fi
306
346
  return 0
307
347
  }
data/scripts/utility CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/bin/bash
2
2
 
3
- function __rvm_info {
3
+ __rvm_info() {
4
4
  full_version=$(ruby -v)
5
5
  cat <<Info
6
6
 
@@ -113,11 +113,11 @@ function __rvm_run {
113
113
 
114
114
  function __rvm_cleanup_variables {
115
115
  __rvm_unset_ruby_variables
116
- unset rvm_ruby_selected_flag rvm_action rvm_irbrc_file rvm_src_path rvm_path rvm_prefix_path rvm_gem_path rvm_command rvm_error_message rvm_gem_set_name rvm_url rvm_config_path rvm_bin_path rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_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_head_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_log_path rvm_file_name
116
+ unset rvm_ruby_selected_flag rvm_action rvm_irbrc_file rvm_src_path rvm_path rvm_prefix_path rvm_gem_path rvm_command rvm_error_message rvm_gem_set_name rvm_url rvm_config_path rvm_bin_path rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_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_log_path rvm_file_name
117
117
  }
118
118
 
119
119
  function __rvm_unset_ruby_variables {
120
- unset rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_configure rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_ruby_binary rvm_ruby_home rvm_ruby_log_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string rvm_ruby_string rvm_ruby_src_path rvm_ruby_repo_url rvm_major_version rvm_minor_version rvm_ruby_gem_home
120
+ unset rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_configure rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_ruby_binary rvm_ruby_home rvm_ruby_log_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string rvm_ruby_string rvm_ruby_src_path rvm_ruby_repo_url rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_head_flag
121
121
  }
122
122
 
123
123
  # TODO: root user loadng of /etc/rvmrc
@@ -342,7 +342,7 @@ function __rvm_gem_sync {
342
342
  fi
343
343
  }
344
344
 
345
- function __rvm_db {
345
+ __rvm_db() {
346
346
  rvm_hash_file="$rvm_config_path/db"
347
347
  touch $rvm_hash_file
348
348
  key="$1" ; shift
@@ -367,12 +367,13 @@ function __rvm_db {
367
367
  fi
368
368
  }
369
369
 
370
- function __rvm_list {
370
+ __rvm_list() {
371
371
  if [[ ! -z "$rvm_all_flag" ]] ; then
372
372
  svn list http://svn.ruby-lang.org/repos/ruby/tags/ | grep 'v1_[8|9]' | sed 's#^v1_##' | sed 's#/$##' | awk -F'_' '{print "1."$1"."$2 " -l "$3}' | sed 's#p$##'
373
373
  echo -e "jruby 1.2.0\njruby 1.3.0\njruby (1.3.1, the default)\njruby 1.4.1\njruby --head"
374
374
  echo -e "rbx head (rubinius head, the default)\nrbx head --jit"
375
375
  echo -e "ree 1.8.6 --head\nree (1.8.7, the default)"
376
+ echo -e "mput head (shyouhei head, the default)"
376
377
  else
377
378
  current_ruby="$(which ruby | xargs dirname | xargs dirname | xargs basename 2> /dev/null)"
378
379
  echo -e "\nruby:\n"
@@ -408,6 +409,17 @@ function __rvm_list {
408
409
  fi
409
410
  done ; unset version
410
411
 
412
+ echo -e "\nmput:\n"
413
+ for version in $(/bin/ls $rvm_path/ 2> /dev/null | awk '/mput-.*/ { print $NF }') ; do
414
+ string="$($rvm_path/$version/bin/ruby -v | tr "\n" ' ' )"
415
+ if [[ "$version" = "$current_ruby" ]] ; then
416
+ echo -e "=> $version : $string"
417
+ selected="1"
418
+ else
419
+ echo -e " $version : $string"
420
+ fi
421
+ done ; unset version
422
+
411
423
  if [[ -f "$rvm_path/default" ]] && [[ -s $rvm_path/default ]] ; then
412
424
  version=$(grep '^MY_RUBY_HOME' ~/.rvm/default | awk -F"'" '{print $2}' | xargs basename)
413
425
  if [[ ! -z "$version" ]] ; then
@@ -465,6 +477,7 @@ function __rvm_initialize {
465
477
  rvm_ruby_repo_url="${rvm_ruby_repo_url:-"http://svn.ruby-lang.org/repos/ruby"}"
466
478
  # Rubinius sha1's will be available after RC1.
467
479
  rvm_rubinius_repo_url="${rvm_rubinius_repo_url:-"git://github.com/evanphx/rubinius.git"}"
480
+ rvm_shyouhei_repo_url="${rvm_shyouhei_repo_url:-"git://github.com/shyouhei/ruby.git"}"
468
481
  rvm_jruby_repo_url="${rvm_jruby_repo_url:-"git://kenai.com/jruby~main"}"
469
482
  rvm_ruby_load_path="."
470
483
  rvm_ruby_require=""
@@ -478,19 +491,18 @@ function __rvm_initialize {
478
491
  mkdir -p $rvm_src_path $rvm_bin_path $rvm_archives_path $rvm_gem_path $rvm_temp_path
479
492
  }
480
493
 
481
- function __rvm_update {
494
+ __rvm_update() {
482
495
  if [[ "head" = "$rvm_ruby_revision" ]] || [[ ! -z "$rvm_self_flag" ]] || [[ "update" = "$rvm_action" ]] || [[ ! -z "$rvm_update_flag" ]] ; then
483
496
  __rvm_version
484
497
  __rvm_update_rvm
485
- __rvm_version
486
498
  fi
487
- __rvm_reload
488
499
  if [[ ! -z "$rvm_bin_flag" ]] ; then __rvm_bin_scripts ; fi
489
500
  if [[ ! -z "$rvm_rubygems_flag" ]] ; then __rvm_rubygems_setup ; fi
490
501
  }
491
502
 
492
- function __rvm_update_rvm {
493
- mkdir -p $rvm_src_path
503
+ __rvm_update_rvm() {
504
+ mkdir -p "$rvm_src_path"
505
+ __rvm_pushpop "$rvm_src_path"
494
506
  if [[ "head" = "$rvm_ruby_revision" ]] ; then
495
507
  if [[ -d "$rvm_src_path/rvm/.git" ]] ; then
496
508
  cd $rvm_src_path/rvm/ && git pull origin master && ./scripts/install
@@ -499,9 +511,9 @@ function __rvm_update_rvm {
499
511
  fi
500
512
  else
501
513
  # TODO: rvm_install_path:
502
- GEM_HOME="${GEM_HOME:-$(gem env gemdir user)}"
503
- gem install rvm --no-rdoc --no-ri -q && $GEM_HOME/bin/rvm-install && source ~/.rvm/scripts/rvm
514
+ gem install rvm --no-rdoc --no-ri -q rvm && $(gem env gemdir user)/bin/rvm-install && source ~/.rvm/scripts/rvm
504
515
  fi
516
+ __rvm_pushpop
505
517
  }
506
518
 
507
519
  __rvm_reboot() {
@@ -540,10 +552,9 @@ __rvm_ruby_do() {
540
552
  if [[ -x "$rvm_ruby_home/bin/$binary" ]] ; then
541
553
  load_path="$rvm_ruby_home/bin:$rvm_ruby_load_path"
542
554
  if [[ "ruby" = "$binary" ]] ; then
543
- if [[ -z "$(echo $rvm_ruby_args | awk '/\.rb$/')" ]] ; then
544
- #if [[ $rvm_ruby_args =~ '\.rb$' ]] ; then
555
+ if match "$rvm_ruby_args" "\.rb$" ; then
545
556
  if [[ -z "$prefix" ]] ; then prefix="-S" ; fi
546
- if [[ ! -z "$rvm_ruby_args" ]] && [[ ! "$rvm_ruby_args" =~ "$prefix" ]] ; then
557
+ if ! match "$rvm_ruby_args" "$prefix" ; then
547
558
  rvm_ruby_args="$prefix $rvm_ruby_args"
548
559
  fi
549
560
  fi
@@ -836,16 +847,41 @@ __rvm_make_flags() {
836
847
  fi
837
848
  CFLAGS="-isysroot /Developer/SDKs/$sdk $rvm_archflags" ; export CFLAGS
838
849
  LDFLAGS="-Wl,-syslibroot /Developer/SDKs/$sdk $rvm_archflags" ; export LDFLAGS
850
+ # CXXFLAGS="-mmacosx-version-min="$(sw_vers -productVersion | awk -F'.' '{print $1"."$2}')" -isysroot /Developer/SDKs/$sdk " ; export CXXFLAGS
839
851
  ARCHFLAGS="$rvm_archflags" ; export ARCHFLAGS
840
852
  fi
841
853
  }
842
854
 
843
855
  __rvm_monitor() {
844
- if [[ -d "test/" ]] ; then
845
- :
846
- elif [[ -d "spec/" ]] ; then
847
- :
848
- fi
856
+ if [[ -d "test/" ]] ; then test_timestamp=$(timestamp "test/") ; fi
857
+ if [[ -d "spec/" ]] ; then spec_timestamp=$(timestamp "spec/") ; fi
858
+ while : ; do
859
+ changed_test_files=() ; changed_spec_files=()
860
+
861
+ if [[ -d "test/" ]] ; then
862
+ test_files=($(/bin/ls test/**/*_test.rb))
863
+ for file in "${test_files[@]}"; do
864
+ if [[ $(timestamp $file) -gt $timestamp ]] ; then
865
+ array_push $changed_test_files
866
+ fi
867
+ done
868
+ fi
869
+
870
+ if [[ -d "spec/" ]] ; then
871
+ spec_files=($(/bin/ls spec/**/*_spec.rb))
872
+ for file in "${spec_files[@]}"; do
873
+ if [[ $(timestamp $file) -gt $timestamp ]] ; then
874
+ array_push $changed_spec_files
875
+ fi
876
+ done
877
+ fi
878
+ if [[ $(array_length $changed_test_files) -gt 0 ]] ; then
879
+ testrb "${myarray[*]}"
880
+ fi
881
+ if [[ $(array_length $changed_spec_files) -gt 0 ]] ; then
882
+ spec "${myarray[*]}"
883
+ fi
884
+ done
849
885
  }
850
886
 
851
887
  #
@@ -853,9 +889,9 @@ __rvm_monitor() {
853
889
  #
854
890
  timestamp() {
855
891
  if [[ "Darwin" = "$(uname)" ]] ; then
856
- echo $(stat -c "%Y" $1)
857
- else
858
892
  echo $(stat -f "%m" $1)
893
+ else
894
+ echo $(stat -c "%Y" $1)
859
895
  fi
860
896
  }
861
897
 
@@ -870,3 +906,28 @@ contains() {
870
906
  echo -1 ; return 1
871
907
  }
872
908
 
909
+ array_length() {
910
+ array=$1 ; return "${#array[*]}"
911
+ }
912
+
913
+ array_push() {
914
+ array=$1 ; shift ; item=$2
915
+ # TODO: allow loop over more arguments.
916
+ eval "index=\$((\${#${array}[*]} + $__array_start))"
917
+ eval "${array}[${index}]=${item}"
918
+ }
919
+
920
+ match() {
921
+ if [[ ! -z "$BASH_VERSION" ]] && [[ ${BASH_VERSION:0:1} -gt 2 ]] && [[ ${BASH_VERSION:2:1} -ge 1 ]] ; then
922
+ [[ "$1" =~ $2 ]] ; return $?
923
+ # elif [[ ! -z "$ZSH_VERSION"]] && [[ ${ZSH_VERSION:0:1} -gt 3 ]] && [[ ${ZSH_VERSION:2:1} -ge 2 ]] && [[ ${ZSH_VERSION:4:1} -ge 4 ]] ; then
924
+ # return [[ "$1" =~ "$2" ]]
925
+ else
926
+ if [ ! -z "$(echo "$1" | awk "/${2}/")" ] ; then
927
+ return 0
928
+ else
929
+ return 1
930
+ fi
931
+ fi
932
+ }
933
+
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.0.62
4
+ version: 0.0.63
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-10-22 00:00:00 -04:00
12
+ date: 2009-10-26 00:00:00 -04:00
13
13
  default_executable: rvm-install
14
14
  dependencies: []
15
15