rvm 0.0.41 → 0.0.42

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.
@@ -30,3 +30,6 @@
30
30
 
31
31
  # Default gems directory
32
32
  # rvm_gem_path="$HOME/.gem"
33
+
34
+ # Install rubies on use when they are not installed
35
+ #ruby_install_on_use=1
@@ -0,0 +1,4 @@
1
+ ---
2
+ :major: 0
3
+ :minor: 0
4
+ :patch: 42
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.0.41"
8
+ s.version = "0.0.42"
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-09-16}
12
+ s.date = %q{2009-09-17}
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}
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
23
23
  "README",
24
24
  "config/db",
25
25
  "examples/rvmrc",
26
+ "lib/VERSION.yml",
26
27
  "lib/rvm.rb",
27
28
  "rvm.gemspec",
28
29
  "scripts/rvm",
@@ -4,8 +4,8 @@ function __rvm_meta {
4
4
  rvm_meta_author="Wayne E. Seguin"
5
5
  rvm_meta_author_email="wayneeseguin@gmail.com"
6
6
  rvm_meta_website="http://rvm.beginrescueend.com/"
7
- rvm_meta_version="`cat $rvm_path/VERSION.yml | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//'`"
8
- rvm_meta_updated="2009.09.16"
7
+ rvm_meta_version="`cat $rvm_path/lib/VERSION.yml | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//'`"
8
+ rvm_meta_updated="2009.09.17"
9
9
  }
10
10
 
11
11
  function __rvm_version { __rvm_meta ; echo "rvm $rvm_meta_version ($rvm_meta_updated) [$rvm_meta_website]" ; }
@@ -91,9 +91,7 @@ function __rvm_usage {
91
91
  --summary - Used with rubydo to print out a summary of the commands run.
92
92
  --jit - Used with rubinius install to build with JIT
93
93
  --latest - with gemset --dump skips version strings for latest gem.
94
- --reconfigure -
95
- --spec -
96
- --test -
94
+ --reconfigure - Force ./configure on install even if Makefile already exists.
97
95
 
98
96
  Resources:
99
97
 
@@ -108,7 +106,7 @@ function __rvm_parse-args {
108
106
  while [ $# -gt 0 ] ; do
109
107
  rvm_token="$1" ; shift
110
108
  case "$rvm_token" in
111
- install|uninstall|path|info|setup|version|srcdir|list|symlinks|reset|debug|reload|usage|help|implode|update|readline|iconv)
109
+ install|uninstall|remove|path|info|setup|version|srcdir|list|symlinks|reset|debug|reload|usage|help|implode|update|readline|iconv)
112
110
  rvm_action=$rvm_token
113
111
  ;;
114
112
 
@@ -268,6 +266,17 @@ function __rvm_parse-args {
268
266
  shift
269
267
  ;;
270
268
 
269
+ specs|tests)
270
+ rvm_action="rubydo"
271
+ rvm_ruby_args="rake $rvm_token"
272
+ ;;
273
+
274
+ rake|gem)
275
+ rvm_action="rubydo"
276
+ rvm_ruby_args="$rvm_token $@"
277
+ rvm_parse_break=1
278
+ ;;
279
+
271
280
  -S|--script|-e|--execute)
272
281
  rvm_action="rubydo"
273
282
  rvm_ruby_args="$@"
@@ -304,7 +313,7 @@ function __rvm_parse-args {
304
313
  --rm-gem-set) rvm_gem_set_name_rm="$1" ; shift ;;
305
314
  tests|specs) rvm_action="tests" ;;
306
315
 
307
- --self|--gem|--rubygems|--reconfigure|--default|--debug|debug|--force|--all|--dump|--summary|--jit|--latest|--spec|--test)
316
+ --self|--gem|--rubygems|--reconfigure|--default|--debug|debug|--force|--all|--dump|--summary|--jit|--latest)
308
317
  eval "rvm_$(echo $rvm_token | sed 's/-//g')_flag=1"
309
318
  ;;
310
319
 
@@ -360,6 +369,7 @@ function rvm {
360
369
  case "$rvm_action" in
361
370
  install) __rvm_install-ruby ; result=$? ;;
362
371
  uninstall) __rvm_uninstall ; result=$? ;;
372
+ remove) __rvm_remove ; result=$? ;;
363
373
  use) __rvm_use ; result=$? ;;
364
374
  gemdir) __rvm_gem-dir ; result=$? ;;
365
375
  srcdir) __rvm_src-dir ; result=$? ;;
@@ -14,10 +14,16 @@ if [ ! -d "$source_dir" ] ; then unset source_dir ; fi
14
14
  source_dir="${source_dir:-$cwd}"
15
15
  rvm_dir=~/.rvm
16
16
 
17
- echo -e "\nInstalling rvm source to ~/.rvm/scripts/rvm..."
17
+ echo -e "\nInstalling rvm to ~/.rvm/ ..."
18
18
  for dir in src scripts bin log archives config gems examples ; do
19
19
  mkdir -p $rvm_dir/$dir
20
20
  done
21
+ for dir in config scripts examples lib ; do
22
+ mkdir -p $rvm_dir/$dir
23
+ /bin/cp -r $source_dir/$dir/ $rvm_dir/$dir
24
+ done
25
+ cp $source_dir/scripts/rvm-prompt $rvm_dir/bin/
26
+ chmod +x $rvm_dir/bin/rvm-prompt
21
27
 
22
28
  # State what is required to use rvm
23
29
  echo -e "\n\033[0;32mrvm\033[0m is a shell script that allows a user to manage multiple ruby versions in their own account."
@@ -116,15 +122,6 @@ if [ -f ~/.rvm/bin/rvm ] ; then
116
122
  rm -f ~/.rvm/bin/rvm
117
123
  fi
118
124
 
119
- for dir in config scripts examples ; do
120
- mkdir -p $rvm_dir/$dir
121
- for file in `/bin/ls $source_dir/$dir/`; do
122
- cp $source_dir/$dir/$file $rvm_dir/$dir/$file
123
- done
124
- done
125
- cp $source_dir/scripts/rvm-prompt $rvm_dir/bin/
126
- cp $source_dir/VERSION.yml $rvm_dir/
127
-
128
125
  system=`uname`
129
126
  if [ "$system" = "Linux" ] ; then
130
127
  rvm_apt_get_binary=`which apt-get 2> /dev/null`
@@ -137,13 +137,15 @@ function __rvm_install-ruby {
137
137
 
138
138
  macruby)
139
139
  if [ "`uname`" = "Darwin" ] ; then
140
+ #rvm_macruby_repo_url="${rvm_macruby_repo_url:-"http://svn.macosforge.org/repository/ruby/MacRuby"}"
141
+ rvm_macruby_repo_url="${rvm_macruby_repo_url:-"git://github.com/masterkain/macruby.git"}"
140
142
  rvm_ruby_repo_url=$rvm_macruby_repo_url
141
- #/macruby_nightly-2009-09-10.pkg
142
- rvm_macruby_nightly_url=`__rvm_db "macruby_nightly_url"`
143
+ #rvm_macruby_nightly_url=`__rvm_db "macruby_nightly_url"`
143
144
  rvm_ruby_configure=""
144
145
  rvm_ruby_make="rake macruby:build framework_instdir=$rvm_path/macruby-head framework_name=/macruby-head --trace"
145
146
  rvm_ruby_make_install="rake framework:install framework_instdir=$rvm_path/macruby-head framework_name=/macruby-head --trace"
146
- #rvm_ruby_rev="${rvm_ruby_rev:-head}" # Hard coding this for now
147
+ rvm_ruby_rev="${rvm_ruby_rev:-head}" # Hard coding this for now
148
+ rvm_url=$rvm_ruby_repo_url
147
149
 
148
150
  DESTDIR="$rvm_ruby_home" ; export DESTDIR
149
151
  if [ -z "$rvm_ruby_rev" ] ; then
@@ -159,9 +161,9 @@ function __rvm_install-ruby {
159
161
  rvm_ruby_rev="-r $rvm_ruby_rev"
160
162
  fi
161
163
  fi
162
- __rvm_fetch $rvm_url
163
- __rvm_run /usr/sbin/installer -pkg $rvm_ruby_package_name.pkg -target "$rvm_path/$rvm_ruby_package_name/"
164
- #__rvm_install-source
164
+ #__rvm_fetch $rvm_url
165
+ #__rvm_run /usr/sbin/installer -pkg $rvm_ruby_package_name.pkg -target "$rvm_path/$rvm_ruby_package_name/"
166
+ __rvm_install-source
165
167
  unset DESTDIR
166
168
  else
167
169
  __rvm_log "fail" "MacRuby can only be installed on a Darwin OS."
@@ -178,30 +180,34 @@ function __rvm_install-ruby {
178
180
  else
179
181
  __rvm_log "info" "\tDownloading $rvm_ruby_package_name, this may take a while depending on your connection..."
180
182
  __rvm_fetch $rvm_url
181
- if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log" ; popd > /dev/null ; return 1 ; fi
183
+ if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
182
184
  __rvm_log "info" "\tExtracting $rvm_ruby_package_name..."
183
185
  mkdir -p $rvm_ruby_src_path
184
186
  __rvm_run "extract" tar xzf $rvm_archives_path/$rvm_ruby_package_name.tar.gz -C $rvm_source_path
187
+ if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
185
188
  fi
186
189
 
187
190
  __rvm_log "info" "\tInstalling $rvm_ruby_package_name, this may take a while, depending on your cpu(s)..."
188
191
  mkdir -p $rvm_ruby_log_path
189
192
 
190
193
  cd $rvm_ruby_src_path
194
+ mkdir -p $rvm_ruby_home/lib/ruby/gems/1.8/gems
191
195
  if [ ! -z "$rvm_ruby_configure" ] ; then rvm_ruby_configure="-c $rvm_ruby_configure"; fi
192
196
  __rvm_run "install" ./installer -a $rvm_path/ruby-enterprise-$rvm_ruby_version-$rvm_ruby_patch_level --dont-install-useful-gems --no-tcmalloc $rvm_ruby_configure
197
+ if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
193
198
  chmod +x $rvm_ruby_home/bin/*
194
199
 
195
200
  __rvm_rubygems_setup
196
- __rvm_bin_script
197
-
198
- popd > /dev/null
199
201
 
200
202
  for rvm_gem_name in rake ; do
201
203
  __rvm_log "info" "Installing $rvm_gem_name"
202
204
  __rvm_run "gems" $rvm_ruby_home/bin/gem install $rvm_gem_name --no-rdoc --no-ri -q
203
205
  done
204
- ;;
206
+
207
+ __rvm_bin_script
208
+
209
+ popd > /dev/null
210
+ ;;
205
211
 
206
212
  rbx|rubinius)
207
213
  # TODO: check if system is 1.8.X otherwise use rvm's 1.8.X and check for parsetree, install if missing
@@ -283,7 +289,9 @@ function __rvm_install-ruby {
283
289
  ;;
284
290
 
285
291
  ruby)
286
- if [ -z "rvm_ruby_configure" ] ; then rvm_ruby_configure="--enable-shared=true --enable-pthread=true " ; fi
292
+ # Merge configure options with user specified options
293
+ rvm_ruby_configure="--enable-shared=true --enable-pthread $rvm_ruby_configure "
294
+ if [ "`uname`" = "Darwin" ] ; then ARCHFLAGS="-arch x86_64 -arch i386" ; export ARCHFLAGS ; fi
287
295
  __rvm_install-source $*
288
296
  ;;
289
297
 
@@ -301,12 +309,34 @@ function __rvm_install-ruby {
301
309
 
302
310
  }
303
311
 
312
+ # TODO: DRY up __rvm_remove and __rvm_uninstall
313
+ function __rvm_remove {
314
+ if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
315
+
316
+ if [ ! -z "$rvm_ruby_package_name" ] ; then
317
+ for dir in $rvm_source_path $rvm_path ; do
318
+ if [ -d $dir/$rvm_ruby_package_name ] ; then
319
+ __rvm_log "info" "Removing $dir/$rvm_ruby_package_name..."
320
+ rm -rf $dir/$rvm_ruby_package_name
321
+ else
322
+ __rvm_log "info" "it seems that $dir/$rvm_ruby_package_name is already non existent."
323
+ fi
324
+ if [ -e $rvm_bin_path/$rvm_ruby_package_name ] ; then
325
+ rm -f $rvm_bin_path/$rvm_ruby_package_name
326
+ fi
327
+ done ; unset dir
328
+ rm -rf $rvm_gem_path/$rvm_ruby_interpreter/$rvm_ruby_version*/
329
+ else
330
+ __rvm_log "fail" "Cannot uninstall unknown package '$rvm_ruby_package_name'"
331
+ fi
332
+ }
333
+
304
334
  function __rvm_uninstall {
305
335
 
306
336
  if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
307
337
 
308
338
  if [ ! -z "$rvm_ruby_package_name" ] ; then
309
- for dir in $rvm_source_path $rvm_path ; do
339
+ for dir in $rvm_path ; do
310
340
  if [ -d $dir/$rvm_ruby_package_name ] ; then
311
341
  __rvm_log "info" "Removing $dir/$rvm_ruby_package_name..."
312
342
  rm -rf $dir/$rvm_ruby_package_name
@@ -327,7 +357,7 @@ function __rvm_uninstall {
327
357
  function __rvm_post_install {
328
358
 
329
359
  for binary in gem irb erb ri rdoc testrb rake ; do
330
- if [ -x $rvm_ruby_src_path/bin/$binary ] ; then
360
+ if [ -f $rvm_ruby_src_path/bin/$binary ] ; then
331
361
  if [ "$rvm_ruby_src_path" != "$rvm_ruby_home" ] ; then
332
362
  cp $rvm_ruby_src_path/bin/$binary $rvm_ruby_home/bin/$binary
333
363
  fi
@@ -3,7 +3,7 @@
3
3
  # __rvm_select implementation version patch_level
4
4
  function __rvm_select {
5
5
 
6
- __rvm_ruby_string
6
+ if [ ! -z "$rvm_ruby_string" ] ; then __rvm_ruby_string ; fi
7
7
 
8
8
  rvm_ruby_interpreter="${1:-$rvm_ruby_interpreter}"
9
9
  rvm_ruby_interpreter="${rvm_ruby_interpreter:-ruby}" # Default is standard ruby
@@ -22,9 +22,11 @@ function __rvm_select {
22
22
  macruby)
23
23
  if [ "`uname`" = "Darwin" ] ; then
24
24
  rvm_ruby_repo_url="${rvm_ruby_repo_url:-`__rvm_db "macruby_repo_url"`}"
25
- rvm_ruby_version="${rvm_ruby_version:-`__rvm_db "macruby_version"`}"
26
- rvm_ruby_package_name=${rvm_ruby_interpreter}_nightly-${rvm_ruby_version}
27
- rvm_url="http://dl.getdropbox.com/u/163257/$rvm_ruby_package_name.pkg" # For now we are only supporting the 'nightly' builds
25
+ rvm_ruby_version="head"
26
+ rvm_ruby_package_name=${rvm_ruby_interpreter}-${rvm_ruby_version}
27
+ #rvm_ruby_version="${rvm_ruby_version:-`__rvm_db "macruby_version"`}"
28
+ #rvm_ruby_package_name=${rvm_ruby_interpreter}_nightly-${rvm_ruby_version}
29
+ #rvm_url="http://dl.getdropbox.com/u/163257/$rvm_ruby_package_name.pkg" # 'nightly' builds
28
30
  unset rvm_ruby_patch_level
29
31
  else
30
32
  __rvm_log "fail" "MacRuby can only be installed on a Darwin OS."
@@ -67,8 +69,9 @@ function __rvm_select {
67
69
  rvm_ruby_version=$(echo $rvm_ruby_tag | sed 's/^v//' | sed 's/\///' | awk -F'_' '{print 1 "." $2 "." $3 }')
68
70
  rvm_ruby_patch_level=$rvm_ruby_tag # $(echo $rvm_ruby_tag | sed 's/^v//' | sed 's/\///' | awk -F'_' '{print $4 }')
69
71
  fi
70
-
71
- rvm_ruby_version=${rvm_ruby_version:-`__rvm_db "ruby_version"`} # Default verison is 1.8.6
72
+ if [ -z "$rvm_ruby_version" ] ; then
73
+ rvm_ruby_version=`__rvm_db "ruby_version"` # Default verison is 1.8.6
74
+ fi
72
75
  rvm_ruby_patch_level=${rvm_ruby_patch_level:-`__rvm_db "ruby_${rvm_ruby_version}_patch_level"`} # Default verison is 1.8.6
73
76
  if [ -z "rvm_ruby_patch_level" ] ; then unset rvm_ruby_patch_level ; fi
74
77
 
@@ -113,10 +116,12 @@ function __rvm_select {
113
116
  rvm_ruby_package_name="${rvm_ruby_package_name:-"$rvm_ruby_interpreter-$rvm_ruby_version"}"
114
117
  rvm_ruby_home="${rvm_ruby_home:-"$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version"}"
115
118
  else
116
- if [ "`echo $rvm_ruby_patch_level | awk '{print substr($1, 0, 1)}'`" != "p" ] ; then
117
- rvm_ruby_patch_level="p$rvm_ruby_patch_level"
119
+ if [ "$rvm_ruby_interpreter" != "ruby-enterprise" ] ; then
120
+ if [ ! -z "`echo $rvm_ruby_patch_level | awk '/[0-9]+/{print}'`" ] ; then
121
+ rvm_ruby_patch_level="p$rvm_ruby_patch_level"
122
+ fi
123
+ rvm_ruby_patch_level="`echo $rvm_ruby_patch_level | sed 's/^pp/p/'`" # sanity check, thanks sfpyra
118
124
  fi
119
- rvm_ruby_patch_level="`echo $rvm_ruby_patch_level | sed 's/^pp/p/'`" # sanity check, thanks sfpyra
120
125
  rvm_ruby_package_name="${rvm_ruby_package_name:-"$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level"}"
121
126
  rvm_ruby_home="${rvm_ruby_home:-"$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level"}"
122
127
  fi
@@ -127,7 +132,7 @@ function __rvm_select {
127
132
  rvm_ruby_string="$rvm_ruby_package_name"
128
133
  rvm_selected=1
129
134
 
130
- export rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_version rvm_ruby_package_name rvm_url rvm_ruby_patch_level rvm_ruby_configure rvm_ruby_make rvm_ruby_make_install rvm_ruby_rev rvm_ruby_tag rvm_major_version rvm_minor_version rvm_gem_set_name rvm_gem_path rvm_gem_home rvm_path rvm_source_path rvm_bin_path rvm_ruby_binary rvm_ruby_package_name rvm_ruby_home rvm_log_path rvm_ruby_log_path rvm_source_path rvm_ruby_src_path rvm_ruby_irbrc rvm_selected rvm_ruby_string
135
+ 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_rev rvm_ruby_tag rvm_major_version rvm_minor_version rvm_gem_set_name rvm_gem_path rvm_gem_home rvm_path rvm_source_path rvm_bin_path rvm_ruby_binary rvm_ruby_home rvm_log_path rvm_ruby_log_path rvm_source_path rvm_ruby_src_path rvm_ruby_irbrc rvm_selected rvm_ruby_string
131
136
 
132
137
  if [ ! -z "$rvm_load_flag" ] ; then __rvm_gemset_load ; fi
133
138
  if [ ! -z "$rvm_dump_flag" ] ; then __rvm_gemset_dump ; fi
@@ -176,15 +181,9 @@ function __rvm_use {
176
181
  IRBRC="$rvm_ruby_irbrc" ; export IRBRC
177
182
  if [ -z "$IRBRC" ] ; then unset IRBRC ; fi
178
183
 
179
- # Install if not installed
180
184
  if [ ! -d $MY_RUBY_HOME ] ; then
181
185
  __rvm_log "warn" "$rvm_ruby_interpreter $rvm_ruby_version is not installed."
182
- echo -n -e "Would you like rvm to install $rvm_ruby_interpreter $rvm_ruby_version for you now?\n(Y/n) ? "
183
- read response
184
- if [ "$response" = 'n' ] ; then
185
- __rvm_log "warn" "Please run 'rvm install $rvm_ruby_interpreter $rvm_ruby_version' if you wish to use it.\n"
186
- return 0
187
- else
186
+ if [ ! -z "$rvm_install_on_use" ] ; then
188
187
  __rvm_install-ruby $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level
189
188
  fi
190
189
  fi
@@ -14,10 +14,16 @@ if [ ! -d "$source_dir" ] ; then unset source_dir ; fi
14
14
  source_dir="${source_dir:-$cwd}"
15
15
  rvm_dir=~/.rvm
16
16
 
17
- echo -e "\nInstalling rvm source to ~/.rvm/scripts/rvm..."
17
+ echo -e "\nInstalling rvm to ~/.rvm/ ..."
18
18
  for dir in src scripts bin log archives config gems examples ; do
19
19
  mkdir -p $rvm_dir/$dir
20
20
  done
21
+ for dir in config scripts examples lib ; do
22
+ mkdir -p $rvm_dir/$dir
23
+ /bin/cp -r $source_dir/$dir/ $rvm_dir/$dir
24
+ done
25
+ cp $source_dir/scripts/rvm-prompt $rvm_dir/bin/
26
+ chmod +x $rvm_dir/bin/rvm-prompt
21
27
 
22
28
  # State what is required to use rvm
23
29
  echo -e "\n\033[0;32mrvm\033[0m is a shell script that allows a user to manage multiple ruby versions in their own account."
@@ -116,15 +122,6 @@ if [ -f ~/.rvm/bin/rvm ] ; then
116
122
  rm -f ~/.rvm/bin/rvm
117
123
  fi
118
124
 
119
- for dir in config scripts examples ; do
120
- mkdir -p $rvm_dir/$dir
121
- for file in `/bin/ls $source_dir/$dir/`; do
122
- cp $source_dir/$dir/$file $rvm_dir/$dir/$file
123
- done
124
- done
125
- cp $source_dir/scripts/rvm-prompt $rvm_dir/bin/
126
- cp $source_dir/VERSION.yml $rvm_dir/
127
-
128
125
  system=`uname`
129
126
  if [ "$system" = "Linux" ] ; then
130
127
  rvm_apt_get_binary=`which apt-get 2> /dev/null`
@@ -52,11 +52,11 @@ function __rvm_debug {
52
52
  function __rvm_log {
53
53
 
54
54
  case "$1" in
55
- debug) shift ; echo -e "\n\033[0;35m <d> \033[0m $*" ;;
56
- info) shift ; echo -e "\n\033[0;32m <i> \033[0m $*" ;;
57
- warn) shift ; echo -e "\n\033[0;33m <w> \033[0m $*" ;;
58
- error) shift ; echo -e "\n\033[0;31m <e> \033[0m $*" ;;
59
- fail) shift ; echo -e "\n\033[0;31m <e> \033[0m $*" ; popd 2> /dev/null ; return 1 ;;
55
+ debug) shift ; echo -e "\033[0;35m <d> \033[0m $*" ;;
56
+ info) shift ; echo -e "\033[0;32m <i> \033[0m $*" ;;
57
+ warn) shift ; echo -e "\033[0;33m <w> \033[0m $*" ;;
58
+ error) shift ; echo -e "\033[0;31m <e> \033[0m $*" ;;
59
+ fail) shift ; echo -e "\033[0;31m <e> \033[0m $*" ; popd 2> /dev/null ; return 1 ;;
60
60
  *) echo -e "$*"
61
61
  esac
62
62
  }
@@ -91,7 +91,7 @@ function __rvm_run {
91
91
  }
92
92
 
93
93
  function __rvm_cleanup-variables {
94
- 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_path rvm_prefix_path rvm_ruby_package_name rvm_gem_path rvm_command rvm_error_message rvm_ruby_home rvm_ruby_binary rvm_gem_set_name rvm_ruby_tag rvm_ruby_rev rvm_url rvm_ruby_make rvm_ruby_configure rvm_ruby_make_install rvm_config_path rvm_ruby_string 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
94
+ 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_path rvm_prefix_path rvm_ruby_package_name rvm_gem_path rvm_command rvm_error_message rvm_ruby_home rvm_ruby_binary rvm_gem_set_name rvm_ruby_tag rvm_ruby_rev rvm_url rvm_ruby_make rvm_ruby_configure rvm_ruby_make_install rvm_config_path rvm_ruby_string 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_install_on_use
95
95
  }
96
96
 
97
97
  # TODO: root user loadng of /etc/rvmrc
@@ -204,7 +204,7 @@ function __rvm_reset {
204
204
  for variable in RUBY_VERSION GEM_HOME MY_RUBY_HOME ; do unset $variable ; done
205
205
 
206
206
  for file in system default ; do
207
- if [ -f $rvm_path/$file ] ; then rm -f $rvm_path/file ; fi
207
+ if [ -f $rvm_path/$file ] ; then rm -f $rvm_path/$file ; fi
208
208
  done
209
209
  __rvm_select "system"
210
210
 
@@ -435,8 +435,6 @@ function __rvm_initialize {
435
435
  rvm_ruby_repo_url="${rvm_ruby_repo_url:-"http://svn.ruby-lang.org/repos/ruby"}"
436
436
  # Rubinius sha1's will be available after RC1.
437
437
  rvm_rubinius_repo_url="${rvm_rubinius_repo_url:-"git://github.com/evanphx/rubinius.git"}"
438
- #rvm_macruby_repo_url="${rvm_macruby_repo_url:-"http://svn.macosforge.org/repository/ruby/MacRuby"}"
439
- rvm_macruby_repo_url="${rvm_macruby_repo_url:-"git://github.com/masterkain/macruby.git"}"
440
438
  rvm_jruby_repo_url="${rvm_jruby_repo_url:-"git://kenai.com/jruby~main"}"
441
439
  rvm_ruby_load_path="."
442
440
  rvm_ruby_require=""
@@ -516,34 +514,36 @@ function __rvm_reload {
516
514
  function __rvm_ruby_do {
517
515
  __rvm_select
518
516
  __rvm_use
519
- #__rvm_
520
517
  binary=`echo $rvm_action | sed 's/do$//'`
521
- lp="$rvm_ruby_home/bin:$rvm_ruby_load_path"
522
- if [ "$binary" = "ruby" ] ; then
523
- rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_require -I$lp -S $rvm_ruby_args"
524
- else
525
- rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_args"
526
- fi
527
- echo "$rvm_ruby_string: $($rvm_ruby_home/bin/$binary -v)"
528
- eval $rvm_command
529
- result=$?
530
- if [ $result -eq 0 ]; then
531
- successes[${#successes[*]}]=$rvm_ruby_string
518
+ if [ -x $rvm_ruby_home/bin/$binary ] ; then
519
+ load_path="$rvm_ruby_home/bin:$rvm_ruby_load_path"
520
+ if [ "$binary" = "ruby" ] ; then
521
+ rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_require -I$load_path -S $rvm_ruby_args"
522
+ else
523
+ rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_args"
524
+ fi
525
+ echo -e "\n$rvm_ruby_string: $($rvm_ruby_home/bin/$binary -v)"
526
+ eval $rvm_command
527
+ result=$?
528
+ if [ $result -eq 0 ]; then
529
+ eval "successes=(${successes[*]} $rvm_ruby_string)"
530
+ else
531
+ eval "errors=(${errors[*]} $rvm_ruby_string)"
532
+ fi
533
+ eval "all=(${all[*]} $rvm_ruby_string)"
534
+ eval "results=(${results[*]} $result)"
535
+ # TODO: keep track of and re-set the previous selected ruby ;)
532
536
  else
533
- errors[${#errors[*]}]=$rvm_ruby_string
537
+ __rvm_log "warn" "'$rvm_ruby_home/bin/$binary' either does not exist or is not executable? :("
534
538
  fi
535
- all[${#all[*]}]=$rvm_ruby_string
536
- results[${#results[*]}]=$result
537
- # TODO: keep track of and re-set the previous selected ruby ;)
538
- unset rvm_ruby_interpreter rvm_ruby_patch_level rvm_ruby_version rvm_ruby_package_name rvm_ruby_home rvm_ruby_irbrc rvm_ruby_binary rvm_ruby_string lp
539
+ 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_rev rvm_ruby_tag rvm_major_version rvm_minor_version rvm_gem_set_name rvm_gem_home rvm_ruby_binary rvm_ruby_package_name rvm_ruby_home rvm_ruby_log_path rvm_ruby_src_path rvm_ruby_irbrc rvm_selected
539
540
  }
540
541
 
541
542
  function __rvm_do {
542
543
  all=() ; successes=() ; errors=() ; results=()
543
544
  # TODO: Extract the common functionality out of the if below
544
545
  if [ ! -z "$rvm_ruby_version" ] ; then
545
- rvm_ruby_selectors=$(echo $rvm_ruby_version | tr ',' ' ')
546
- for rvm_ruby_selector in $rvm_ruby_selectors ; do
546
+ for rvm_ruby_selector in `echo $rvm_ruby_version | tr ',' ' '` ; do
547
547
  temp=$(echo $rvm_ruby_selector | awk '{print substr($1, 0, 1)}')
548
548
  if [ ! -z "$(echo $temp | grep '[0-9]')" ] ; then
549
549
  rvm_ruby_interpreter="ruby"
@@ -556,61 +556,38 @@ function __rvm_do {
556
556
  __rvm_ruby_do
557
557
  done
558
558
  else # all
559
- rvm_ruby_binaries=`/bin/ls $rvm_path/*/bin/ruby 2> /dev/null`
560
- for rvm_ruby_binary in $rvm_ruby_binaries ; do
561
- if [ -x $rvm_ruby_binary ] ; then
562
- rvm_ruby_string=`dirname $rvm_ruby_binary | xargs dirname | xargs basename`
559
+ while read bin_line
560
+ do # Keep this on second line damnit!
561
+ if [ -x $bin_line ] ; then
562
+ rvm_ruby_string="`dirname $bin_line | xargs dirname | xargs basename`"
563
563
  __rvm_ruby_do
564
564
  fi
565
- done
565
+ done < <(/bin/ls $rvm_path/*/bin/ruby 2> /dev/null)
566
566
  fi
567
567
 
568
568
  if [ ! -z "$rvm_summary_flag" ] ; then
569
569
  export successes errors results
570
- echo -e "\n\033[0;32msuccessful (${#successes[*]}) : [ $(echo "${successes[*]}" | sed 's/ /, /g') ]\033[0m"
571
- echo -e "\n\033[0;31merrors (${#errors[*]}) : [ $(echo "${errors[*]}" | sed 's/ /, /g') ]\033[0m"
570
+ echo -e "\nSummary:"
571
+ echo -e "\033[0;32msuccessful (${#successes[*]}) : [ $(echo "${successes[*]}" | sed 's/ /, /g') ]\033[0m"
572
+ echo -e "\033[0;31merrors (${#errors[*]}) : [ $(echo "${errors[*]}" | sed 's/ /, /g') ]\033[0m"
572
573
  echo -e "all (${#all[*]}) : [ $(echo "${all[*]}" | sed 's/ /, /g') ]"
573
574
  echo -e "exit results: [ $(echo "${results[*]}" | sed 's/ /, /g') ]\n"
574
575
  else
575
- unset binary successes errors rvm_summary_flag
576
+ unset bin_line rvm_summary_flag
577
+ # successes errors
576
578
  fi
577
579
  return ${#errors[*]}
578
580
  }
579
581
 
580
- function __rvm_irbrc {
581
- if [ ! -s "$rvm_ruby_irbrc" ] ; then
582
- rvm_irbrc_file=`cat <<-Config
583
- load '$HOME/.irbrc' if File.exists?('$HOME/.irbrc') rescue nil
584
-
585
- require "irb/completion" rescue nil
586
-
587
- @prompt = {
588
- :PROMPT_I => "${rvm_ruby_package_name} > ", # default prompt
589
- :PROMPT_S => "${rvm_ruby_package_name}%l> ", # known continuation
590
- :PROMPT_C => "${rvm_ruby_package_name} > ",
591
- :PROMPT_N => "${rvm_ruby_package_name} ?> ", # unknown continuation
592
- :RETURN => " => %s \n",
593
- :AUTO_INDENT => true
594
- }
595
- @prompt_mode = :DEFAULT
596
- IRB.conf[:PROMPT][@prompt_mode] = @prompt
597
- IRB.conf[:PROMPT_MODE] = @prompt_mode
598
- Config
599
- `
600
- touch $rvm_ruby_home/.irbrc
601
- echo -e "\n$rvm_irbrc_file" > $rvm_ruby_home/.irbrc
602
- fi
603
-
604
- }
605
-
606
582
  function __rvm_ruby_string {
607
583
  if [ "$rvm_ruby_interpreter" = "system" ] ; then
608
- unset rvm_ruby_string
584
+ rvm_ruby_string="system"
609
585
  elif [ ! -z "$rvm_ruby_string" ] ; then
610
- rvm_ruby_string=`echo "$rvm_ruby_string" | sed 's/ruby-enterprise/ree/g'`
586
+ rvm_ruby_string=`echo "$rvm_ruby_string" | sed 's/ruby-enterprise/ree/g'` # dash-antics :)
611
587
  rvm_ruby_interpreter=`echo $rvm_ruby_string | tr '-' ' ' | awk '{print $1}'`
612
- rvm_ruby_vesion=`echo $rvm_ruby_string | awk -F'-' '{print $2}'`
588
+ rvm_ruby_version=`echo $rvm_ruby_string | awk -F'-' '{print $2}'`
613
589
  revision=`echo $rvm_ruby_string | awk -F'-' '{print $3}'`
590
+
614
591
  if [ "$revision" = "head" -o "$revision" = "preview" ] ; then
615
592
  rvm_ruby_revision="$revision"
616
593
  else
@@ -626,6 +603,8 @@ function __rvm_ruby_string {
626
603
  fi
627
604
  fi
628
605
  fi
606
+
607
+ if [ "rvm_ruby_interpreter" = "ree" ] ; then rvm_ruby_interpreter="ruby-enterprise" ; fi
629
608
  fi
630
609
  return 0
631
610
  }
@@ -686,13 +665,13 @@ function __rvm_gemset_load {
686
665
  if [ ! -z "`echo "$rvm_ruby_gem_list" | awk "/$gem_string/{print}"`" ] ; then
687
666
  if [ ! -z "$rvm_force_flag" ] ; then
688
667
  cp $cache_file $rvm_path/tmp/$gem_file_name
689
- gem="$rvm_path/tmp/$gem_file_name -l" # install as a named local gem
668
+ gem="$rvm_path/tmp/$gem_file_name" # install as a named local gem
690
669
  else
691
670
  unset gem
692
671
  __rvm_log "info" "$gem_name $gem_version is already installed, skipping. (use --force to force these to install regardless)"
693
672
  fi
694
673
  else
695
- gem="$cache_file -l"
674
+ gem="$cache_file"
696
675
  fi
697
676
  fi
698
677
 
@@ -708,6 +687,33 @@ function __rvm_gemset_load {
708
687
  done < <(awk '/^[a-zA-Z]/{print}' "$rvm_load_file")
709
688
  }
710
689
 
690
+ function __rvm_irbrc {
691
+ if [ -d $rvm_ruby_home -a ! -s $rvm_ruby_irbrc ] ; then
692
+ rvm_irbrc_file=`cat <<-Config
693
+ load '$HOME/.irbrc' if File.exists?('$HOME/.irbrc') rescue nil
694
+
695
+ require "irb/completion" rescue nil
696
+
697
+ @prompt = {
698
+ :PROMPT_I => "${rvm_ruby_package_name} > ", # default prompt
699
+ :PROMPT_S => "${rvm_ruby_package_name}%l> ", # known continuation
700
+ :PROMPT_C => "${rvm_ruby_package_name} > ",
701
+ :PROMPT_N => "${rvm_ruby_package_name} ?> ", # unknown continuation
702
+ :RETURN => " => %s \n",
703
+ :AUTO_INDENT => true
704
+ }
705
+ @prompt_mode = :DEFAULT
706
+ IRB.conf[:PROMPT][@prompt_mode] = @prompt
707
+ IRB.conf[:PROMPT_MODE] = @prompt_mode
708
+ Config
709
+ `
710
+ touch $rvm_ruby_irbrc
711
+ echo -e "\n$rvm_irbrc_file" > $rvm_ruby_home/.irbrc
712
+ fi
713
+
714
+ }
715
+
716
+
711
717
  #
712
718
  # ruby supporting libraries:
713
719
  #
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.41
4
+ version: 0.0.42
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-09-16 00:00:00 -04:00
12
+ date: 2009-09-17 00:00:00 -04:00
13
13
  default_executable: rvm-install
14
14
  dependencies: []
15
15
 
@@ -27,6 +27,7 @@ files:
27
27
  - README
28
28
  - config/db
29
29
  - examples/rvmrc
30
+ - lib/VERSION.yml
30
31
  - lib/rvm.rb
31
32
  - rvm.gemspec
32
33
  - scripts/rvm