rvm 0.0.49 → 0.0.50

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,16 +17,16 @@
17
17
  #rvm_prefix_path="$HOME/."
18
18
 
19
19
  # Default Install Path
20
- #rvm_install_path="${rvm_prefix_path}rvm"
20
+ #rvm_path="${rvm_prefix_path}rvm"
21
21
 
22
22
  # Default Archives Path
23
- #rvm_archive_path="${rvm_install_path}/archives"
23
+ #rvm_archives_path="${rvm_path}/archives"
24
24
 
25
25
  # Default Source Path
26
- #rvm_source_path="${rvm_install_path}/src"
26
+ #rvm_source_path="${rvm_path}/src"
27
27
 
28
28
  # Default Log Path
29
- #rvm_log_path="${rvm_install_path}/log"
29
+ #rvm_log_path="${rvm_path}/log"
30
30
 
31
31
  # Default gems directory
32
32
  # rvm_gem_path="$HOME/.gem"
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 49
4
+ :patch: 50
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.0.49"
8
+ s.version = "0.0.50"
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-24}
12
+ s.date = %q{2009-09-28}
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}
@@ -107,7 +107,7 @@ function __rvm_parse-args {
107
107
  while [ $# -gt 0 ] ; do
108
108
  rvm_token="$1" ; shift
109
109
  case "$rvm_token" in
110
- install|uninstall|path|info|setup|version|srcdir|list|reset|debug|reload|implode|update|readline|iconv|use|gemsync)
110
+ install|uninstall|path|info|setup|version|srcdir|list|reset|debug|reload|implode|update|readline|iconv|use|gemsync|gemset)
111
111
  rvm_action=$rvm_token
112
112
  ;;
113
113
 
@@ -140,6 +140,22 @@ function __rvm_parse-args {
140
140
  rvm_ruby_interpreter="${rvm_ruby_interpreter:-current}"
141
141
  ;;
142
142
 
143
+ --load|load|dump)
144
+ eval "rvm_${rvm_token}_flag=1"
145
+ if [ ! -z "$1" ] ; then
146
+ if [ ! -z "$(echo $1 | awk '/\.gemset$/')" ] ; then
147
+ rvm_gem_set_name=$(echo $1 | sed 's/\.gemset//')
148
+ else
149
+ rvm_gem_set_name=$1
150
+ fi
151
+ shift
152
+ else
153
+ rvm_gem_set_name="default"
154
+ fi
155
+ rvm_file_name="$rvm_gem_set_name.gemset"
156
+ rvm_action=$rvm_token
157
+ ;;
158
+
143
159
  gemdup)
144
160
  rvm_action=$rvm_token
145
161
  if [ -z "$1" ] ; then
@@ -297,18 +313,6 @@ function __rvm_parse-args {
297
313
  rvm_parse_break=1
298
314
  ;;
299
315
 
300
- --load)
301
- rvm_load_flag=1
302
- if [ ! -z "$1" ] ; then
303
- rvm_load_file="$1"
304
- shift
305
- else
306
- rvm_action="error"
307
- rvm_error_message="--load must be followed by the .gemset file to load."
308
- break;
309
- fi
310
- ;;
311
-
312
316
  default|system)
313
317
  rvm_action="use"
314
318
  rvm_ruby_interpreter="system"
@@ -383,9 +387,9 @@ function rvm {
383
387
  result=0
384
388
  case "$rvm_action" in
385
389
  use) __rvm_use ; result=$? ;;
386
- gemdir) __rvm_gem-dir ; result=$? ;;
387
- gemdup) __rvm_gem-dup ; result=$? ;;
388
- srcdir) __rvm_src-dir ; result=$? ;;
390
+ gemdir) __rvm_gemdir ; result=$? ;;
391
+ gemdup) __rvm_gemdup ; result=$? ;;
392
+ srcdir) __rvm_source_dir ; result=$? ;;
389
393
  list) __rvm_list ; result=$? ;;
390
394
  version) __rvm_version ; result=$? ;;
391
395
  reset) __rvm_reset ; result=$? ;;
@@ -406,6 +410,10 @@ function rvm {
406
410
  result=$?
407
411
  ;;
408
412
 
413
+ load|dump)
414
+ __rvm_gemset_${rvm_action}
415
+ ;;
416
+
409
417
  gemsync)
410
418
  rvm_source_gem_path=`__rvm_select ; echo $rvm_gem_home`
411
419
  __rvm_gem_sync
@@ -76,40 +76,36 @@ function __rvm_install_source {
76
76
  rvm_autoconf=`which autoconf`
77
77
  if [ $? -gt 0 ] ; then __rvm_log "fail" "rvm expects autoconf" ; result=$? ; return $result ; fi
78
78
  __rvm_run "autoconf" "$rvm_autoconf"
79
- if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
79
+ # if [ $? -gt 0 ] ; then result=$? ; return $result ; fi # Don't barf on autoconf fail...
80
80
  fi
81
81
 
82
82
  if [ -s ./Makefile -a -z "$rvm_reconfigure_flag" ] ; then
83
- __rvm_log "warn" "Skipping configure step, Makefile exists so configure must have already been run."
83
+ __rvm_log "debug" "Skipping configure step, Makefile exists so configure must have already been run."
84
84
  elif [ -s ./configure ] ; then
85
85
  __rvm_log "info" "Configuring $rvm_ruby_package_name using $rvm_ruby_configure, this may take a while depending on your cpu(s)..."
86
86
  if [ -d $rvm_path/usr/include/readline/ ] ; then
87
- configure_parameters="$configure_parameters --with-readline-dir=$rvm_path/usr/include/readline/"
87
+ configure_parameters="$configure_parameters --with-readline-dir=$rvm_path/usr/include/readline/ --with-search-path=$rvm_path/usr"
88
88
  fi
89
89
  if [ -d $rvm_path/usr/include/iconv/ ] ; then
90
- configure_parameters="$configure_parameters --with-iconv-dir=$rvm_path/usr/include/iconv/"
90
+ configure_parameters="$configure_parameters --with-iconv-dir=$rvm_path/usr/include/iconv/ --with-search-path=$rvm_path/usr"
91
91
  fi
92
- __rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure $configure_parameters"
93
- unset configure_parameters
92
+ __rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure $configure_parameters --with-search-path=/usr --with-search-path=/usr/local"
94
93
  if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
94
+ unset configure_parameters
95
+ elif [ ! -z "rvm_ruby_configure" ] ; then
96
+ $rvm_ruby_configure
95
97
  else
96
98
  __rvm_log "error" "Skipping configure step, 'configure' script does not exist, did autoconf not run successfully?"
97
99
  fi
98
100
 
99
101
  __rvm_log "info" "Compiling $rvm_ruby_package_name, this may take a while, depending on your cpu(s)..."
100
- if [ -z "$rvm_ruby_make" ] ; then
101
- __rvm_run "make" "/usr/bin/make $rvm_make_flags"
102
- else
103
- __rvm_run "make" "$rvm_ruby_make $rvm_make_flags"
104
- fi
102
+ rvm_ruby_make=${rvm_ruby_make:-"/usr/bin/make"}
103
+ __rvm_run "make" "$rvm_ruby_make $rvm_make_flags"
105
104
  if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
106
105
 
107
- if [ -z "$rvm_ruby_make" ] ; then
108
- __rvm_log "info" "Installing $rvm_ruby_package_name"
109
- __rvm_run "install" "/usr/bin/make install"
110
- else
111
- __rvm_run "install" "$rvm_ruby_make_install"
112
- fi
106
+ __rvm_log "info" "Installing $rvm_ruby_package_name"
107
+ rvm_ruby_make_install=${rvm_ruby_make_install:-"/usr/bin/make install"}
108
+ __rvm_run "install" "$rvm_ruby_make_install"
113
109
  if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
114
110
 
115
111
  __rvm_log "info" "Installation of $rvm_ruby_package_name is complete."
@@ -131,16 +127,21 @@ function __rvm_install_ruby {
131
127
  if [ "`uname`" = "Darwin" ] ; then ARCHFLAGS="-arch x86_64 -arch i386" ; export ARCHFLAGS ; fi
132
128
 
133
129
  case "$rvm_ruby_interpreter" in
134
-
135
130
  macruby)
136
131
  if [ "`uname`" = "Darwin" ] ; then
132
+ rvm_ruby_interpreter="system"
133
+ __rvm_select
134
+ __rvm_use
135
+ rvm_ruby_interpreter="macruby"
136
+ __rvm_gi "rake" # Make sure that rake is present
137
137
  #rvm_macruby_repo_url="${rvm_macruby_repo_url:-"http://svn.macosforge.org/repository/ruby/MacRuby"}"
138
138
  rvm_macruby_repo_url="${rvm_macruby_repo_url:-"git://github.com/masterkain/macruby.git"}"
139
139
  rvm_ruby_repo_url=$rvm_macruby_repo_url
140
140
  #rvm_macruby_nightly_url=`__rvm_db "macruby_nightly_url"`
141
- rvm_ruby_configure=""
142
- rvm_ruby_make="rake macruby:build framework_instdir=$rvm_path/macruby-head framework_name=/macruby-head --trace"
143
- rvm_ruby_make_install="rake framework:install framework_instdir=$rvm_path/macruby-head framework_name=/macruby-head --trace"
141
+ rvm_ruby_configure=" "
142
+ rvm_make_flags=" "
143
+ rvm_ruby_make="cd $rvm_ruby_src_path; /usr/bin/rake macruby:build framework_instdir=$rvm_path/macruby-head framework_name=/macruby-head --trace"
144
+ rvm_ruby_make_install="cd $rvm_ruby_src_path; /usr/bin/rake framework:install"
144
145
  rvm_ruby_rev="${rvm_ruby_rev:-head}" # Hard coding this for now
145
146
  rvm_url=$rvm_ruby_repo_url
146
147
 
@@ -224,7 +225,7 @@ function __rvm_install_ruby {
224
225
  PATH=$rvm_bin_path:$PATH ; export PATH
225
226
 
226
227
  rvm_ruby_repo_url=$rvm_rubinius_repo_url
227
- rvm_ruby_configure=""
228
+ rvm_ruby_configure=" "
228
229
  rvm_ruby_src_path=$rvm_ruby_home
229
230
  rvm_ruby_make="rake"
230
231
  rvm_ruby_make_install="rake install"
@@ -345,17 +346,24 @@ RubyWrapper
345
346
  ;;
346
347
 
347
348
  ruby)
348
- # Merge configure options with user specified options
349
- rvm_ruby_configure="--enable-shared --enable-pthread $rvm_ruby_configure "
350
- if [ "`uname`" = "Darwin" ] ; then ARCHFLAGS="-arch x86_64 -arch i386" ; export ARCHFLAGS ; fi
349
+ if [ "`uname`" = "Darwin" ] ; then
350
+ ARCHFLAGS="-arch x86_64 -arch i386" ; export ARCHFLAGS
351
+ if [ "$(echo $rvm_ruby_version | awk '/1\.8/')" ] ; then
352
+ rvm_ruby_configure="${rvm_ruby_configure:-"--enable-shared --disable-pthread"} "
353
+ else
354
+ rvm_ruby_configure="${rvm_ruby_configure:-"--enable-shared"} "
355
+ fi
356
+ else
357
+ rvm_ruby_configure="${rvm_ruby_configure:-"--enable-shared --enable-pthread"} "
358
+ fi
351
359
  __rvm_install_source $*
352
360
  ;;
353
361
 
354
362
  default)
355
- __rvm_log "fail" "please specify a ruby implementation to install."
363
+ __rvm_log "fail" "must specify a ruby interpreter to install."
356
364
  ;;
357
365
 
358
- *) __rvm_log "fail" "Ruby implementation '$rvm_ruby_interpreter' is not known."
366
+ *) __rvm_log "fail" "Ruby interpreter '$rvm_ruby_interpreter' is not known."
359
367
 
360
368
  esac
361
369
 
@@ -389,7 +397,7 @@ function __rvm_manage_rubies {
389
397
  fi
390
398
  done < <(/bin/ls $rvm_path/*/bin/ruby 2> /dev/null)
391
399
  else
392
- __rvm_log "warn" "Really? Install all? See 'rvm list --all' and limit the selection to something more sane please :)"
400
+ __rvm_log "warn" 'Really? Install all? See "rvm list --all" and limit the selection to something more sane please :)'
393
401
  fi
394
402
  fi
395
403
  __rvm_state
@@ -54,7 +54,7 @@ function __rvm_select {
54
54
  jruby)
55
55
  rvm_ruby_version="${rvm_ruby_version:-`__rvm_db "jruby_version"`}"
56
56
  unset rvm_ruby_patch_level
57
- if [ ! -z "$(echo $rvm_ruby_version | awk '/^1\.2\.0/')" -o ! -z "$(rvm_ruby_version | awk '/^1\.3\.[0-3]/')" ] ; then
57
+ if [ -z "$(echo $rvm_ruby_version | awk '/^1\.2\.0/')" -a -z "$(echo $rvm_ruby_version | awk '/^1\.3\.[0-3]/')" ] ; then
58
58
  __rvm_log "fail" "Unknown jRuby version: $rvm_ruby_version"
59
59
  fi
60
60
  alias jruby_ng="jruby --ng"
@@ -90,8 +90,14 @@ function __rvm_select {
90
90
  default|system|current|user)
91
91
  #no-op?
92
92
  ;;
93
+
93
94
  *)
94
- __rvm_log "fail" "Ruby implementation '$rvm_ruby_interpreter' is not known."
95
+ if [ ! -z "$MY_RUBY_HOME" ] ; then
96
+ rvm_ruby_string=$(basename $MY_RUBY_HOME)
97
+ __rvm_select
98
+ else
99
+ __rvm_log "fail" "Ruby implementation '$rvm_ruby_interpreter' is not known."
100
+ fi
95
101
  esac
96
102
 
97
103
  if [ ! -z "$rvm_ruby_rev" ] ; then
@@ -159,7 +165,7 @@ function __rvm_use {
159
165
  source $rvm_path/default
160
166
  else
161
167
  rvm_ruby_interpreter="system"
162
- __rvm_log "error" "no default rvm specified, defaulting to pre-rvm sytem."
168
+ __rvm_log "warn" "no default rvm specified, defaulting to pre-rvm sytem."
163
169
  unset GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC
164
170
  if [ -s $rvm_path/system ] ; then source $rvm_path/system ; fi
165
171
  fi
@@ -54,7 +54,11 @@ function __rvm_debug {
54
54
  # Logging functions based on level
55
55
  function __rvm_log {
56
56
  case "$1" in
57
- debug) shift ; echo -e "\033[0;35m<debug>\033[0m $* \033[0;35m</debug> \033[0m " ;;
57
+ debug) shift ;
58
+ if [ ! -z "$rvm_debug_flag" ] ; then
59
+ echo -e "\033[0;35m<debug>\033[0m $* \033[0;35m</debug> \033[0m "
60
+ fi
61
+ ;;
58
62
  info) shift ; echo -e "\033[0;32m<info>\033[0m $* \033[0;32m</info> \033[0m " ;;
59
63
  warn) shift ; echo -e "\033[0;33m<warning>\033[0m $* \033[0;33m</warning> \033[0m " ;;
60
64
  error) shift ; echo -e "\033[0;31m<error>\033[0m $* \033[0;31m</error> \033[0m " ;;
@@ -80,7 +84,7 @@ function __rvm_run {
80
84
  command="$*"
81
85
  rvm_ruby_log_path=${rvm_ruby_log_path:-$rvm_path/log}
82
86
  mkdir -p $rvm_ruby_log_path
83
- if [ ! -z "$rvm_debug_flag" ] ; then __rvm_log "debug" "Executing: $command" ; fi
87
+ __rvm_log "debug" "Executing: $command"
84
88
  touch $rvm_ruby_log_path/$log_file_name.log $rvm_ruby_log_path/$log_file_name.error.log # for zsh :(
85
89
  echo "[$(date +'%Y-%m-%d %H:%M:%S')] $command" | tee $rvm_ruby_log_path/$log_file_name.log > $rvm_ruby_log_path/$log_file_name.error.log
86
90
  if [ -z "$rvm_niceness" -o "$rvm_niceness" = "0" ] ; then
@@ -226,7 +230,8 @@ function __rvm_reset {
226
230
  for file in system default ; do
227
231
  if [ -f $rvm_path/$file ] ; then rm -f $rvm_path/$file ; fi
228
232
  done
229
- __rvm_select "system"
233
+ rvm_ruby_interpreter="system"
234
+ __rvm_select
230
235
 
231
236
  for system_config in system_ps1 system_ruby system_gem_path system_user_gem_path ; do
232
237
  __rvm_db "$system_config" "delete"
@@ -259,28 +264,26 @@ function __rvm_implode {
259
264
  done
260
265
  }
261
266
 
262
- function __rvm_gem-dir {
267
+ function __rvm_gemdir {
263
268
  if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
264
269
  mkdir -p $rvm_gem_home
265
270
  echo $rvm_gem_home
266
271
  }
267
272
 
268
- function __rvm_src-dir {
269
-
273
+ function __rvm_source_dir {
270
274
  if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
271
-
272
275
  if [ -z "$rvm_ruby_src_path" ] ; then
273
276
  __rvm_log "fail" "No source directory exists for the default implementation."
274
277
  else
275
278
  echo "$rvm_ruby_src_path"
276
279
  fi
277
-
278
280
  }
279
281
 
280
282
  # clones from source implementation/version to default
281
283
  # TODO: Merge this into 'rvm sync'
282
- function __rvm_gem-dup {
283
- __rvm_log "debug" "$rvm_ruby_interpreter"
284
+ function __rvm_gemdup {
285
+ if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
286
+ __rvm_log "debug" "$rvm_ruby_interpreter"
284
287
  if [ "$rvm_ruby_interpreter" = "default" ] ; then
285
288
  # TODO: ~/.rvm/default first, then system user
286
289
  rvm_source_gem_path="$rvm_system_user_gem_path"
@@ -341,22 +344,15 @@ function __rvm_db {
341
344
  function __rvm_list {
342
345
  if [ "$rvm_all_flag" ] ; then
343
346
  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$//'
344
-
345
- echo "jruby 1.2.0"
346
- echo "jruby 1.3.0"
347
- echo "jruby 1.3.1"
348
- echo "jruby head"
349
- echo "rubinius head"
350
- echo "rbx head"
351
- echo "rbx head --jit"
352
- echo "ree 20090610"
347
+ echo -e "jruby 1.2.0\njruby 1.3.0\njruby 1.3.1\njruby --head"
348
+ echo -e "rbx head (rubinius head)\nrbx head --jit"
349
+ echo -e "ree 20090610\nree --head\nree 1.8.7 --head"
353
350
  else
354
- current=`which ruby | xargs dirname | xargs dirname | xargs basename 2> /dev/null`
355
-
351
+ current_ruby=`which ruby | xargs dirname | xargs dirname | xargs basename 2> /dev/null`
356
352
  echo -e "\nruby:\n"
357
353
  for version in `/bin/ls -l $rvm_path/ 2> /dev/null | awk '/ ruby-[1-2].*/ { print $NF }'` ; do
358
- string=`$rvm_bin_path/$version -v`
359
- if [ "$current" = "$version" ] ; then
354
+ string=`$rvm_path/$version/bin/ruby -v`
355
+ if [ "$current_ruby" = "$version" ] ; then
360
356
  echo -e "=> $version : $string"
361
357
  selected="1"
362
358
  else
@@ -366,8 +362,8 @@ function __rvm_list {
366
362
 
367
363
  echo -e "\njruby:\n"
368
364
  for version in `/bin/ls -l $rvm_path/ 2> /dev/null | awk '/jruby-.*/ { print $NF }'` ; do
369
- string=`$rvm_bin_path/$version -v`
370
- if [ "$current" = "$version" ] ; then
365
+ string=`$rvm_path/$version/bin/ruby -v`
366
+ if [ "$current_ruby" = "$version" ] ; then
371
367
  echo -e "=> $version : $string"
372
368
  selected="1"
373
369
  else
@@ -377,8 +373,8 @@ function __rvm_list {
377
373
 
378
374
  echo -e "\nree:\n"
379
375
  for version in `/bin/ls $rvm_path/ 2> /dev/null | awk '/ruby-enterprise-.*/ { print $NF }'` ; do
380
- string=`$rvm_bin_path/$version -v | tr "\n" ' ' `
381
- if [ "$current" = "$version" ] ; then
376
+ string=`$rvm_path/$version/bin/ruby -v | tr "\n" ' ' `
377
+ if [ "$current_ruby" = "$version" ] ; then
382
378
  echo -e "=> $version : $string"
383
379
  selected="1"
384
380
  else
@@ -390,8 +386,8 @@ function __rvm_list {
390
386
  version=`grep '^MY_RUBY_HOME' ~/.rvm/default | awk -F"'" '{print $2}' | xargs basename`
391
387
  if [ ! -z "$version" ] ; then
392
388
  echo -e "\ndefault:\n"
393
- string=`$rvm_bin_path/$version -v`
394
- if [ "$current" = "$version" ] ; then
389
+ string=`$rvm_path/$version/bin/ruby -v`
390
+ if [ "$current_ruby" = "$version" ] ; then
395
391
  echo -e "=> $version : $string"
396
392
  selected="1"
397
393
  else
@@ -408,7 +404,7 @@ function __rvm_list {
408
404
  else
409
405
  echo -e " $system_version\n"
410
406
  fi
411
- fi ; unset current version selected
407
+ fi ; unset current_ruby version selected
412
408
  fi
413
409
  }
414
410
 
@@ -437,12 +433,13 @@ function __rvm_initialize {
437
433
  else
438
434
  rvm_path="${rvm_prefix_path}/rvm"
439
435
  fi
440
- rvm_archives_path="${rvm_archives_path:-"${rvm_path}/archives"}"
441
- rvm_source_path="${rvm_source_path:-"${rvm_path}/src"}"
442
- rvm_log_path=${rvm_log_path:-"${rvm_path}/log"}
443
- rvm_bin_path=${rvm_bin_path:-"${rvm_path}/bin"}
444
- rvm_gem_path=${rvm_gem_path:-"${rvm_path}/gems"}
445
- rvm_config_path=${rvm_config_path:-"${rvm_path}/config"}
436
+ rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
437
+ rvm_source_path="${rvm_source_path:-"$rvm_path/src"}"
438
+ rvm_log_path=${rvm_log_path:-"$rvm_path/log"}
439
+ rvm_bin_path=${rvm_bin_path:-"$rvm_path/bin"}
440
+ rvm_gem_path=${rvm_gem_path:-"$rvm_path/gems"}
441
+ rvm_config_path=${rvm_config_path:-"$rvm_path/config"}
442
+ rvm_temp_path=${rvm_temp_path:-"$rvm_path/tmp"}
446
443
 
447
444
  rvm_ruby_repo_url="${rvm_ruby_repo_url:-"http://svn.ruby-lang.org/repos/ruby"}"
448
445
  # Rubinius sha1's will be available after RC1.
@@ -457,7 +454,7 @@ function __rvm_initialize {
457
454
  PATH=$rvm_bin_path:$PATH ; export PATH
458
455
  fi
459
456
 
460
- mkdir -p $rvm_source_path $rvm_bin_path $rvm_archives_path $rvm_path/tmp
457
+ mkdir -p $rvm_source_path $rvm_bin_path $rvm_archives_path $rvm_gem_path $rvm_temp_path
461
458
  }
462
459
 
463
460
  function __rvm_update {
@@ -650,18 +647,19 @@ Benchmark.bmbm do|benchmark|
650
647
 
651
648
  RubyCode
652
649
  )"
653
- echo "$rvm_code" > /tmp/$$.rb
654
- cat $rvm_ruby_file >> /tmp/$$.rb
655
- echo -e "\n end\nend\n" >> /tmp/$$.rb
650
+ echo "$rvm_code" > $rvm_temp_path/$$.rb
651
+ cat $rvm_ruby_file >> $rvm_temp_path/$$.rb
652
+ echo -e "\n end\nend\n" >> $rvm_temp_path/$$.rb
656
653
  unset rvm_code
657
- rvm_ruby_args="/tmp/$$.rb"
654
+ rvm_ruby_args="$rvm_temp_path/$$.rb"
658
655
  rvm_action="ruby"
659
- if [ ! -z "$rvm_debug_flag" ] ; then echo -e "/tmp/$$.rb:\n$(cat /tmp/$$.rb)" ; fi
656
+ if [ ! -z "$rvm_debug_flag" ] ; then echo -e "$rvm_temp_path/$$.rb:\n$(cat $rvm_temp_path/$$.rb)" ; fi
660
657
  __rvm_do
661
658
  }
662
659
 
663
660
  function __rvm_gemset_dump {
664
- file_name=${rvm_gem_set_name:-'default'}
661
+ if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
662
+ rvm_file_name=${rvm_file_name:-'default'}
665
663
 
666
664
  echo "# $rvm_gem_set_name.gemset generated gem dump file. Note that any env variable settings will be missing. Append these after using a ';' field separator" > $rvm_gem_set_name.gemset
667
665
 
@@ -670,16 +668,17 @@ function __rvm_gemset_dump {
670
668
  if [ -z "$rvm_latest_flag" ] ; then
671
669
  versions=`echo $gem | awk -F';' '{print $2}' | sed 's/,/ /g'`
672
670
  for version in $versions ; do
673
- echo "$name -v$version" >> $file_name.gemset
671
+ echo "$name -v$version" >> $rvm_file_name
674
672
  done ; unset version versions
675
673
  else
676
- echo "$name" >> $file_name.gemset
674
+ echo "$name" >> $rvm_file_name
677
675
  fi ; unset name
678
676
  done ; unset file_name
679
677
  }
680
678
 
681
679
  function __rvm_gemset_load {
682
- echo "Loading $rvm_load_file file..."
680
+ if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
681
+ echo "Loading $rvm_file file..."
683
682
  rvm_ruby_gem_list=`/bin/ls $rvm_gem_home/specifications/ 2> /dev/null | sed 's/\.gemspec$//' 2> /dev/null`
684
683
  while read line
685
684
  do # Keep this on 2nd line :( bash fail.
@@ -708,8 +707,8 @@ function __rvm_gemset_load {
708
707
  gem_string=`echo "$gem_file_name" | sed 's/\.gem$//'`
709
708
  if [ ! -z "`echo "$rvm_ruby_gem_list" | awk "/$gem_string/{print}"`" ] ; then
710
709
  if [ ! -z "$rvm_force_flag" ] ; then
711
- cp $cache_file $rvm_path/tmp/$gem_file_name
712
- gem="$rvm_path/tmp/$gem_file_name" # install as a named local gem
710
+ cp $cache_file $rvm_temp_path/$gem_file_name
711
+ gem="$rvm_temp_path/$gem_file_name" # install as a named local gem
713
712
  else
714
713
  unset gem
715
714
  __rvm_log "info" "$gem_name $gem_version is already installed, skipping. (use --force to force these to install regardless)"
@@ -728,13 +727,12 @@ function __rvm_gemset_load {
728
727
  fi
729
728
  fi
730
729
  unset gem gem_prefix gem_name gem_version gem_file_name gem_postfix cache_file gem_file_name gem_string
731
- done < <(awk '/^[a-zA-Z]/{print}' "$rvm_load_file")
730
+ done < <(awk '/^[a-zA-Z]/{print}' "$rvm_file_name")
732
731
  }
733
732
 
734
733
  function __rvm_irbrc {
735
734
  if [ -d $rvm_ruby_home -a ! -s $rvm_ruby_irbrc ] ; then
736
- rvm_irbrc_file=`cat <<-Config
737
- load '$HOME/.irbrc' if File.exists?('$HOME/.irbrc') rescue nil
735
+ rvm_ruby_irbrc_file=$(cat <<-Config
738
736
 
739
737
  require "irb/completion" rescue nil
740
738
 
@@ -749,10 +747,14 @@ require "irb/completion" rescue nil
749
747
  @prompt_mode = :DEFAULT
750
748
  IRB.conf[:PROMPT][@prompt_mode] = @prompt
751
749
  IRB.conf[:PROMPT_MODE] = @prompt_mode
750
+
751
+ load '$HOME/.irbrc' if File.exists?('$HOME/.irbrc') rescue nil
752
+
752
753
  Config
753
- `
754
+ )
754
755
  touch $rvm_ruby_irbrc
755
- echo -e "\n$rvm_irbrc_file" > $rvm_ruby_home/.irbrc
756
+ echo -e "\n$rvm_ruby_irbrc_file" > $rvm_ruby_home/.irbrc
757
+ unset rvm_ruby_irbrc_file
756
758
  fi
757
759
  }
758
760
 
@@ -764,44 +766,6 @@ function __rvm_pushpop {
764
766
  fi
765
767
  }
766
768
 
767
- #
768
- # ruby supporting libraries:
769
- #
770
- function __rvm_readline_install {
771
- __rvm_pushpop $rvm_path/src
772
- package=readline
773
- version=5.2
774
- # TODO: Figure out how to list, grab and apply the patches
775
- __rvm_fetch "ftp://ftp.gnu.org/gnu/readline/$package-$version.tar.gz"
776
- __rvm_run "$package.extract" tar zxf $rvm_archives_path/$package-$version.tar.gz -C $rvm_path/src/
777
- cd $rvm_path/src/$package-$version
778
- if [ "`uname`" = "Darwin" ] ; then
779
- sdk=`ls -t /Developer/SDKs/ | head -n 1`
780
- CFLAGS="-isysroot /Developer/SDKs/$sdk -arch i386 -arch x86_64"
781
- LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/$sdk -arch i386 -arch x86_64"
782
- export CFLAGS LDFLAGS
783
- __rvm_run "$package.configure" ./configure --prefix=$rvm_path/usr --disable-dependency-tracking --disable-static --enable-shared
784
- else
785
- __rvm_run "$package.configure" ./configure --prefix=$rvm_path/usr --disable-dependency-tracking --disable-static --enable-shared
786
- fi
787
- __rvm_run "$package.make" make
788
- __rvm_run "$package.make.install" make install
789
- __rvm_pushpop
790
- }
791
-
792
- function __rvm_iconv_install {
793
- __rvm_pushpop $rvm_path/src
794
- package=libiconv
795
- version=1.13.1
796
- __rvm_fetch "http://ftp.gnu.org/pub/gnu/libiconv/$package-$version.tar.gz"
797
- __rvm_run "$package.extract" tar zxf $rvm_archives_path/$package-$version.tar.gz -C $rvm_dir/src/
798
- cd $rvm_path/src/$package-$version
799
- __rvm_run "$package.configure" ./configure --prefix=$rvm_path/usr --disable-shared
800
- __rvm_run "$package.make" make
801
- __rvm_run "$package.make.install" make install
802
- __rvm_pushpop
803
- }
804
-
805
769
  function __rvm_state {
806
770
  if [ -z "$rvm_state" ] ; then
807
771
  if [ -z "$(which ruby | awk /`basename $rvm_path`/)" ] ; then
@@ -830,3 +794,38 @@ function __rvm_inspect {
830
794
  done
831
795
  }
832
796
 
797
+ #
798
+ # ruby supporting libraries:
799
+ #
800
+ function __rvm_readline_install {
801
+ __rvm_pushpop $rvm_source_path
802
+ package="readline" ; version="5.2"
803
+ # TODO: Figure out how to list, grab and apply the patches
804
+ __rvm_fetch "ftp://ftp.gnu.org/gnu/readline/$package-$version.tar.gz"
805
+ __rvm_run "$package.extract" tar zxf $rvm_archives_path/$package-$version.tar.gz -C $rvm_source_path
806
+ cd $rvm_source_path/$package-$version
807
+ if [ "`uname`" = "Darwin" ] ; then
808
+ sdk=`ls -t /Developer/SDKs/ | head -n 1`
809
+ CFLAGS="-isysroot /Developer/SDKs/$sdk -arch i386 -arch x86_64"
810
+ LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/$sdk -arch i386 -arch x86_64"
811
+ export CFLAGS LDFLAGS
812
+ __rvm_run "$package.configure" "./configure --prefix=$rvm_path/usr --disable-dependency-tracking --disable-static --enable-shared"
813
+ else
814
+ __rvm_run "$package.configure" "./configure --prefix=$rvm_path/usr --disable-dependency-tracking --disable-static --enable-shared"
815
+ fi
816
+ __rvm_run "$package.make" "/usr/bin/make $rvm_make_flags"
817
+ __rvm_run "$package.make.install" "/usr/bin/make install"
818
+ __rvm_pushpop
819
+ }
820
+
821
+ function __rvm_iconv_install {
822
+ __rvm_pushpop $rvm_source_path
823
+ package="libiconv" ; version=1.13.1
824
+ __rvm_fetch "http://ftp.gnu.org/pub/gnu/libiconv/$package-$version.tar.gz"
825
+ __rvm_run "$package.extract" "tar zxf $rvm_archives_path/$package-$version.tar.gz -C $rvm_source_path"
826
+ cd $rvm_source_path/$package-$version
827
+ __rvm_run "$package.configure" "./configure --prefix=$rvm_path/usr --disable-shared"
828
+ __rvm_run "$package.make" "/usr/bin/make $rvm_make_flags"
829
+ __rvm_run "$package.make.install" "/usr/bin/make install"
830
+ __rvm_pushpop
831
+ }
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.49
4
+ version: 0.0.50
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-24 00:00:00 -04:00
12
+ date: 2009-09-28 00:00:00 -04:00
13
13
  default_executable: rvm-install
14
14
  dependencies: []
15
15