wayneeseguin-rvm 0.0.44 → 0.0.45

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 44
4
+ :patch: 45
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.0.44"
8
+ s.version = "0.0.45"
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-18}
12
+ s.date = %q{2009-09-20}
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}
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
  "lib/VERSION.yml",
27
27
  "lib/rvm.rb",
28
28
  "rvm.gemspec",
29
+ "scripts/gemsync",
29
30
  "scripts/rvm",
30
31
  "scripts/rvm-aliases",
31
32
  "scripts/rvm-cli",
@@ -0,0 +1,21 @@
1
+ #/bin/bash
2
+ #
3
+ # gemsync - Standalone gemsync utility.
4
+ #
5
+ # Example:
6
+ # gemsync --from 1.8.6 -m foo --to 1.9.1 -m bar
7
+ #
8
+ source ~/.bash_profile # load rvm
9
+
10
+ from_string=`echo "$@" | sed 's/--/;/g' | tr ';' "\n" | awk '/from/ {print}' | sed 's/from//'`
11
+ to_string=`echo "$@" | sed 's/--/;/g' | tr ';' "\n" | awk '/to/ {print}' | sed 's/to//'`
12
+
13
+ if [ -z "$from_string" ] ; then echo "Invalid arguments. Missing --from <ruby selector>" ; exit 1 ; fi
14
+ if [ -z "$to_string" ] ; then echo "Invalid arguments. Missing --to <ruby selector>" ; exit 1 ; fi
15
+
16
+ # first we use where we want.
17
+ rvm $to_string
18
+
19
+ # Then we sync from the source.
20
+ rvm sync $from_string
21
+
@@ -106,10 +106,14 @@ function __rvm_parse-args {
106
106
  while [ $# -gt 0 ] ; do
107
107
  rvm_token="$1" ; shift
108
108
  case "$rvm_token" in
109
- install|uninstall|remove|path|info|setup|version|srcdir|list|symlinks|reset|debug|reload|usage|help|implode|update|readline|iconv|benchmark|bench|use)
109
+ install|uninstall|path|info|setup|version|srcdir|list|symlinks|reset|debug|reload|usage|help|implode|update|readline|iconv|benchmark|bench|use|sync)
110
110
  rvm_action=$rvm_token
111
111
  ;;
112
112
 
113
+ rm|remove)
114
+ rvm_action=remove
115
+ ;;
116
+
113
117
  system|default)
114
118
  rvm_action=${rvm_action:-use}
115
119
  rvm_ruby_interpreter="$rvm_token"
@@ -147,7 +151,7 @@ function __rvm_parse-args {
147
151
 
148
152
  do|rubydo|rakedo|gemdo)
149
153
  rvm_action=$rvm_token
150
- if [ "$rvm_action" = "do" ] ; then rvm_action="do" ; fi
154
+ if [ "$rvm_action" = "do" ] ; then rvm_action="rubydo" ; fi
151
155
  temp=$(echo $1 | awk '{print substr($1, 0, 1)}')
152
156
  if [ "$temp" = "-" ] ; then
153
157
  unset rvm_ruby_version
@@ -298,6 +302,7 @@ function __rvm_parse-args {
298
302
  rvm_ruby_interpreter="system"
299
303
  ;;
300
304
 
305
+ --install) rvm_install_on_use=1 ;;
301
306
  --prefix) rvm_prefix_path="$1" ; shift ;;
302
307
  -G|--gems) rvm_gem_path="$1" ; shift ;;
303
308
  --source) rvm_source_path="$1" ; shift ;;
@@ -352,12 +357,12 @@ function __rvm_parse-args {
352
357
  if [ ! -z "$rvm_parse_break" -o ! -z "$rvm_error_message" ] ; then unset rvm_parse_break; break; fi
353
358
  done
354
359
 
355
- if [ ! -z "$rvm_error_message" ] ; then popd 2> /dev/null ; return 1 ; fi
360
+ if [ ! -z "$rvm_error_message" ] ; then __rvm_pushpop ; return 1 ; fi
356
361
  }
357
362
 
358
363
  function rvm {
359
364
 
360
- __rvm_cleanup-variables
365
+ __rvm_cleanup_variables
361
366
  __rvm_load-rvmrc
362
367
  __rvm_initialize
363
368
  __rvm_load-defaults
@@ -366,7 +371,7 @@ function rvm {
366
371
  if [ -z "$rvm_debug_flag" ] ; then set +x ; else set -x ; fi
367
372
  result=0
368
373
  case "$rvm_action" in
369
- install) __rvm_install-ruby ; result=$? ;;
374
+ install) __rvm_install ; result=$? ;;
370
375
  uninstall) __rvm_uninstall ; result=$? ;;
371
376
  remove) __rvm_remove ; result=$? ;;
372
377
  use) __rvm_use ; result=$? ;;
@@ -388,6 +393,12 @@ function rvm {
388
393
  bench|benchmark) __rvm_benchmark ; result=$? ;;
389
394
  rubydo|rakedo|gemdo) __rvm_do ; result=$? ;;
390
395
 
396
+ sync)
397
+ result=0
398
+ rvm_source_gem_path=`__rvm_select ; echo $rvm_gem_home`
399
+ __rvm_gem_sync
400
+ ;;
401
+
391
402
  tests|specs)
392
403
  rvm_summary_flag=1
393
404
  rvm_action="rake"
@@ -401,7 +412,7 @@ function rvm {
401
412
  result=0
402
413
  ;;
403
414
 
404
- error) __rvm_log "fail" "$rvm_error_message ( see: 'rvm usage' )" ; popd 2> /dev/null ; return 1; ;;
415
+ error) __rvm_log "fail" "$rvm_error_message ( see: 'rvm usage' )" ; __rvm_pushpop ; return 1; ;;
405
416
  *)
406
417
  if [ ! -z "$rvm_action" ] ; then
407
418
  __rvm_log "fail" "unknown action '$rvm_action'"
@@ -15,15 +15,20 @@ source_dir="${source_dir:-$cwd}"
15
15
  rvm_dir=~/.rvm
16
16
 
17
17
  echo -e "\nInstalling rvm to ~/.rvm/ ..."
18
- for dir in src scripts bin log archives config gems examples ; do
19
- mkdir -p $rvm_dir/$dir
18
+ for dir_name in src scripts bin log archives config gems examples ; do
19
+ mkdir -p $rvm_dir/$dir_name
20
20
  done
21
- for dir in config scripts examples lib ; do
22
- mkdir -p $rvm_dir/$dir
23
- /bin/cp -Rf $source_dir/$dir $rvm_dir
24
- done
25
- cp $source_dir/scripts/rvm-prompt $rvm_dir/bin/
26
- chmod +x $rvm_dir/bin/rvm-prompt
21
+
22
+ for dir_name in config scripts examples lib ; do
23
+ mkdir -p $rvm_dir/$dir_name
24
+ /bin/cp -Rf $source_dir/$dir_name $rvm_dir
25
+ done ; unset dir_name
26
+
27
+ for file_name in rvm-prompt gemsync ; do
28
+ mv $rvm_dir/scripts/$file_name $rvm_dir/bin/
29
+ chmod +x $rvm_dir/bin/$file_name
30
+ done ; unset file_name
31
+
27
32
 
28
33
  # State what is required to use rvm
29
34
  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."
@@ -1,6 +1,6 @@
1
1
  #!/bin/bash
2
2
 
3
- function __rvm_install-source {
3
+ function __rvm_install_source {
4
4
 
5
5
  if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
6
6
 
@@ -8,7 +8,7 @@ function __rvm_install-source {
8
8
  __rvm_log "info" "Installing Ruby from source to: $rvm_ruby_home"
9
9
  mkdir -p $rvm_ruby_log_path
10
10
 
11
- pushd $rvm_source_path > /dev/null
11
+ __rvm_pushpop $rvm_source_path
12
12
 
13
13
  if [ ! -z "$rvm_force_flag" ] ; then
14
14
  rm -rf $rvm_ruby_home
@@ -72,7 +72,7 @@ function __rvm_install-source {
72
72
  fi
73
73
 
74
74
  cd $rvm_ruby_src_path
75
- if [ $? -gt 0 ] ; then result=$? ; __rvm_log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log" ; popd > /dev/null ; return $result ; fi
75
+ if [ $? -gt 0 ] ; then result=$? ; __rvm_log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log" ; __rvm_pushpop ; return $result ; fi
76
76
 
77
77
  if [ ! -s "$rvm_ruby_src_path/configure" -a "$rvm_ruby_interpreter" = "ruby" ] ; then
78
78
  rvm_autoconf=`which autoconf`
@@ -122,13 +122,36 @@ function __rvm_install-source {
122
122
  __rvm_rubygems_setup
123
123
  __rvm_bin_script
124
124
  __rvm_run "chmod.bin" chmod +x $rvm_ruby_home/bin/*
125
-
126
- popd > /dev/null
127
-
128
125
  __rvm_post_install
126
+ __rvm_pushpop
127
+ }
128
+
129
+ function __rvm_install {
130
+ # TODO: Extract the outer looping mechanism with ruby_do's
131
+ rubies=() ; successes=() ; errors=() ; statuses=()
132
+ # TODO: Extract the common functionality out of the if below
133
+ if [ ! -z "$(echo "$rvm_ruby_version" | awk '/,/')" ] ; then
134
+ rvm_ruby_versions=`echo $rvm_ruby_version | tr ',' ' '`
135
+ for rvm_ruby_string in $rvm_ruby_versions ; do
136
+ 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
137
+ if [ ! -z "$(echo $rvm_ruby_selector | awk '/^[0-9]/')" ] ; then
138
+ rvm_ruby_interpreter="ruby"
139
+ rvm_ruby_version="$rvm_ruby_selector"
140
+ else
141
+ rvm_ruby_interpreter="$rvm_ruby_selector"
142
+ unset rvm_ruby_version
143
+ fi
144
+ __rvm_log "debug" $rvm_ruby_string
145
+ __rvm_select
146
+ __rvm_install_ruby
147
+ done
148
+ else
149
+ __rvm_select
150
+ __rvm_install_ruby
151
+ fi
129
152
  }
130
153
 
131
- function __rvm_install-ruby {
154
+ function __rvm_install_ruby {
132
155
 
133
156
  if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
134
157
  if [ ! -z "$RUBYOPT" ] ; then ruby_options=$RUBYOPT ; unset RUBYOPT ; fi
@@ -163,18 +186,18 @@ function __rvm_install-ruby {
163
186
  fi
164
187
  #__rvm_fetch $rvm_url
165
188
  #__rvm_run /usr/sbin/installer -pkg $rvm_ruby_package_name.pkg -target "$rvm_path/$rvm_ruby_package_name/"
166
- __rvm_install-source
189
+ __rvm_install_source
167
190
  unset DESTDIR
168
191
  else
169
192
  __rvm_log "fail" "MacRuby can only be installed on a Darwin OS."
170
193
  fi
194
+ __rvm_irbrc
171
195
  ;;
172
196
 
173
197
  ruby-enterprise|ree)
174
- __rvm_select
175
198
  rvm_url="http://rubyforge.org/frs/download.php/58677/$rvm_ruby_package_name.tar.gz"
176
199
  __rvm_log "info" "Installing Ruby Enterprise Edition from source to: $rvm_ruby_home"
177
- pushd $rvm_source_path > /dev/null
200
+ __rvm_pushpop $rvm_source_path
178
201
  if [ -d $rvm_ruby_src_path ] ; then
179
202
  cd $rvm_ruby_src_path
180
203
  else
@@ -204,13 +227,13 @@ function __rvm_install-ruby {
204
227
  __rvm_run "gems" $rvm_ruby_home/bin/gem install $rvm_gem_name --no-rdoc --no-ri -q
205
228
  done
206
229
 
230
+ __rvm_irbrc
207
231
  __rvm_bin_scripts
208
-
209
- popd > /dev/null
232
+ __rvm_post_install
233
+ __rvm_pushpop
210
234
  ;;
211
235
 
212
236
  rbx|rubinius)
213
- # TODO: check if system is 1.8.X otherwise use rvm's 1.8.X and check for parsetree, install if missing
214
237
  unset GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC
215
238
  PATH="$rvm_system_path" ; export PATH
216
239
  rvm_ruby_repo_url=$rvm_rubinius_repo_url
@@ -227,17 +250,25 @@ function __rvm_install-ruby {
227
250
  git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_home
228
251
  fi
229
252
  cd $rvm_ruby_home
253
+
254
+ # prereqs, 1.8.6 w/ParseTree & rake. Yes this could all be one line... not pushing our luck.
255
+ bash -l -c 'rvm 1.8.6 --debug --install' # This should install if missing.
256
+ bash -l -c 'rvm 1.8.6 -m rbx ; $rvm_ruby_home/bin/gem install --no-rdoc --no-ri rake ParseTree' # This should install if missing.
257
+ rake186rbx=`rvm 1.8.6 -m rbx ; which rake`
230
258
  if [ ! -z "$rvm_jit_flag" ]; then
231
- __rvm_run "build" RBX_LLVM=1 rake build
259
+ __rvm_run "build" RBX_LLVM=1 $rake186rbx build
232
260
  else
233
- __rvm_run "build" rake build
261
+ __rvm_run "build" $rake186rbx build
234
262
  fi
263
+ unset rake186rbx
264
+
235
265
  for binary in ruby irb ; do
236
266
  ln -fs $rvm_ruby_home/bin/rbx $rvm_ruby_home/bin/$binary
237
267
  done
238
268
  $rvm_ruby_home/bin/rbx -S gem install rake --no-rdoc --no-ri
239
269
 
240
- ruby_wrapper=$(cat <<RubyWrapper
270
+ for binary_name in gem rake ; do
271
+ ruby_wrapper=$(cat <<RubyWrapper
241
272
  #!/bin/bash
242
273
 
243
274
  GEM_HOME="$rvm_gem_home" ; export GEM_HOME
@@ -245,15 +276,16 @@ GEM_PATH="$rvm_gem_home" ; export GEM_PATH
245
276
  MY_RUBY_HOME="$rvm_ruby_home" ; export MY_RUBY_HOME
246
277
  PATH="$rvm_ruby_home/bin:$rvm_gem_home/bin:\$PATH" ; export PATH
247
278
 
248
- exec $rvm_ruby_home/bin/rbx -S gem "\$@"
279
+ exec $rvm_ruby_home/bin/rbx -S $binary_name "\$@"
249
280
  RubyWrapper
250
281
  )
251
- echo "$ruby_wrapper" > $rvm_bin_path/gem-$rvm_ruby_package_name
252
- echo "$ruby_wrapper" > $rvm_ruby_home/bin/gem
253
- unset ruby_wrapper
254
- chmod +x $rvm_bin_path/$rvm_ruby_package_name
255
- chmod +x $rvm_ruby_home/bin/gem
256
-
282
+ for file_name in $rvm_bin_path/gem-$rvm_ruby_package_name $rvm_ruby_home/bin/gem ; do
283
+ echo "$ruby_wrapper" > $file_name
284
+ if [ -f $file_name ] ; then chmod +x $file_name ; fi
285
+ done
286
+ unset ruby_wrapper binary_name file_name
287
+ done
288
+ __rvm_irbrc
257
289
  __rvm_bin_scripts
258
290
  ;;
259
291
 
@@ -262,9 +294,9 @@ RubyWrapper
262
294
  rvm_url="http://dist.codehaus.org/$rvm_ruby_interpreter/$rvm_ruby_version/$rvm_package_file.zip"
263
295
  rvm_jruby_repo_url="${rvm_jruby_repo_url:-"git://kenai.com/jruby~main"}"
264
296
 
265
- __rvm_log "info" "Installing jRuby to: $rvm_ruby_home"
297
+ __rvm_log "info" "Installing JRuby to: $rvm_ruby_home"
266
298
  mkdir -p $rvm_ruby_log_path
267
- pushd $rvm_source_path > /dev/null
299
+ __rvm_pushpop $rvm_source_path
268
300
 
269
301
  if [ ! -z "$rvm_ruby_rev" ] ; then
270
302
  if [ ! -d $rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version -o ! -d $rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version/.git ] ; then
@@ -275,8 +307,12 @@ RubyWrapper
275
307
  if [ -d $rvm_ruby_src_path ] ; then
276
308
  cd $rvm_ruby_src_path
277
309
  else
278
- __rvm_log "info" "\tDownloading $rvm_package_file, this may take a while depending on your connection..."
279
- __rvm_fetch $rvm_url
310
+ if [ -z "$rvm_force_flag" -a -f $rvm_package_file -a -s $rvm_package_file ] ; then
311
+ __rvm_log "info" "\tIt appears that $rvm_package_file has already been downloaded, skipping. Use --force to force re-download."
312
+ else
313
+ __rvm_log "info" "\tDownloading $rvm_package_file, this may take a while depending on your connection..."
314
+ __rvm_fetch $rvm_url
315
+ fi
280
316
  __rvm_log "info" "\tExtracting $rvm_package_file..."
281
317
  rvm_unzip=`which unzip`
282
318
  if [ $? -ne 0 ] ; then
@@ -292,16 +328,17 @@ RubyWrapper
292
328
  mkdir -p $rvm_ruby_home/bin/
293
329
  __rvm_run "sync" rsync -ag $rvm_ruby_src_path/ $rvm_ruby_home/
294
330
  __rvm_run "nailgun" cd $rvm_ruby_src_path/tool/nailgun && make $rvm_make_flags
295
- popd > /dev/null
331
+ __rvm_pushpop
296
332
  chmod +x $rvm_ruby_home/bin/*
297
333
  for binary in jruby jgem jirb ; do
298
334
  ln -fs $rvm_ruby_home/bin/$binary $rvm_ruby_home/bin/${binary#j}
299
335
  done
300
336
 
337
+ __rvm_irbrc
301
338
  __rvm_bin_scripts
302
339
 
303
340
  ln -fs $rvm_ruby_home/bin/ruby $rvm_path/bin/$rvm_ruby_package_name
304
- for rvm_gem_name in rake jruby-openssl ; do
341
+ for rvm_gem_name in jruby-openssl ; do
305
342
  __rvm_log "info" "Installing $rvm_gem_name"
306
343
  __rvm_run "gems" $rvm_ruby_home/bin/gem install $rvm_gem_name --no-rdoc --no-ri -q
307
344
  done
@@ -311,7 +348,7 @@ RubyWrapper
311
348
  # Merge configure options with user specified options
312
349
  rvm_ruby_configure="--enable-shared=true --enable-pthread $rvm_ruby_configure "
313
350
  if [ "`uname`" = "Darwin" ] ; then ARCHFLAGS="-arch x86_64 -arch i386" ; export ARCHFLAGS ; fi
314
- __rvm_install-source $*
351
+ __rvm_install_source $*
315
352
  ;;
316
353
 
317
354
  default)
@@ -351,7 +388,6 @@ function __rvm_remove {
351
388
  }
352
389
 
353
390
  function __rvm_uninstall {
354
-
355
391
  if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
356
392
 
357
393
  if [ ! -z "$rvm_ruby_package_name" ] ; then
@@ -376,9 +412,11 @@ function __rvm_uninstall {
376
412
  function __rvm_post_install {
377
413
 
378
414
  for binary in gem irb erb ri rdoc testrb rake ; do
379
- if [ -f $rvm_ruby_src_path/bin/$binary ] ; then
380
- if [ "$rvm_ruby_src_path" != "$rvm_ruby_home" ] ; then
381
- cp $rvm_ruby_src_path/bin/$binary $rvm_ruby_home/bin/$binary
415
+ if [ -f $rvm_ruby_home/bin/$binary -o -f $rvm_ruby_src_path/bin/$binary ] ; then
416
+ if [ "$rvm_ruby_src_path" != "$rvm_ruby_home" -a $rvm_ruby_src_path/bin/$binary] ; then
417
+ cp -f $rvm_ruby_src_path/bin/$binary $rvm_ruby_home/bin/$binary
418
+ elif [ -f "$rvm_gem_home/bin/$binary" ] ; then
419
+ cp -f $rvm_gem_home/bin/$binary $rvm_ruby_home/bin/$binary
382
420
  fi
383
421
  string="ENV['GEM_HOME']=ENV['GEM_HOME'] || '$rvm_gem_home'\nENV['GEM_PATH']=ENV['GEM_PATH'] || '$rvm_gem_home'\nENV['PATH']='$rvm_ruby_home/bin:$rvm_gem_home/bin:' + ENV['PATH']"
384
422
  awk "NR==2 {print \"$string\"} {print}" $rvm_ruby_home/bin/$binary > $rvm_ruby_home/bin/$binary.new
@@ -415,7 +453,6 @@ function __rvm_post_install {
415
453
  }
416
454
 
417
455
  function __rvm_rubygems_setup {
418
-
419
456
  if [ "`echo $rvm_ruby_version | awk '{print substr($1, 0, 3)}'`" != "1.9" ] ; then
420
457
  __rvm_log "info" "\tInstalling rubygems dedicated to $rvm_ruby_package_name..."
421
458
  rvm_gem_package_name="rubygems-1.3.5"
@@ -134,9 +134,6 @@ function __rvm_select {
134
134
 
135
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
136
136
 
137
- if [ ! -z "$rvm_load_flag" ] ; then __rvm_gemset_load ; fi
138
- if [ ! -z "$rvm_dump_flag" ] ; then __rvm_gemset_dump ; fi
139
-
140
137
  else
141
138
  rvm_gem_home=$GEM_HOME
142
139
  fi
@@ -218,5 +215,8 @@ function __rvm_use {
218
215
  unset rvm_default_flag
219
216
  fi
220
217
  fi
218
+
219
+ if [ ! -z "$rvm_load_flag" ] ; then __rvm_gemset_load ; fi
220
+ if [ ! -z "$rvm_dump_flag" ] ; then __rvm_gemset_dump ; fi
221
221
  }
222
222
 
@@ -15,15 +15,20 @@ source_dir="${source_dir:-$cwd}"
15
15
  rvm_dir=~/.rvm
16
16
 
17
17
  echo -e "\nInstalling rvm to ~/.rvm/ ..."
18
- for dir in src scripts bin log archives config gems examples ; do
19
- mkdir -p $rvm_dir/$dir
18
+ for dir_name in src scripts bin log archives config gems examples ; do
19
+ mkdir -p $rvm_dir/$dir_name
20
20
  done
21
- for dir in config scripts examples lib ; do
22
- mkdir -p $rvm_dir/$dir
23
- /bin/cp -Rf $source_dir/$dir $rvm_dir
24
- done
25
- cp $source_dir/scripts/rvm-prompt $rvm_dir/bin/
26
- chmod +x $rvm_dir/bin/rvm-prompt
21
+
22
+ for dir_name in config scripts examples lib ; do
23
+ mkdir -p $rvm_dir/$dir_name
24
+ /bin/cp -Rf $source_dir/$dir_name $rvm_dir
25
+ done ; unset dir_name
26
+
27
+ for file_name in rvm-prompt gemsync ; do
28
+ mv $rvm_dir/scripts/$file_name $rvm_dir/bin/
29
+ chmod +x $rvm_dir/bin/$file_name
30
+ done ; unset file_name
31
+
27
32
 
28
33
  # State what is required to use rvm
29
34
  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."
@@ -3,6 +3,9 @@
3
3
  function __rvm_info {
4
4
  cat <<Info
5
5
 
6
+ system:
7
+ uname: "$(uname -a)"
8
+
6
9
  ruby:
7
10
  interpreter: "`ruby -v | awk '{print $1}'`"
8
11
  version: "`ruby -v | awk '{print $2}'`"
@@ -29,34 +32,33 @@ Info
29
32
  }
30
33
 
31
34
  function __rvm_debug {
35
+ __rvm_log "debug" "\nPATH:\n$(echo $PATH | awk -F":" '{print $1":"$2":"$3":"$4":"$5}')"
32
36
 
33
- __rvm_log "info" "PATH:$(echo $PATH | awk -F":" '{print $1":"$2":"$3":"$4":"$5}')"
34
-
35
- for file in .bash_profile .bashrc .zshrc ; do
36
- if [ -s $file ] ; then
37
- __rvm_log "debug" "~/$file:\n$(grep rvm ~/$file)\n"
37
+ for file_name in ~/.bash_profile ~/.bashrc ~/.zshrc ; do
38
+ if [ -s $file_name ] ; then
39
+ __rvm_log "debug" "\n$file_name:\n$(grep 'rvm' $file_name)"
38
40
  fi
39
41
  done
40
42
 
41
- if [ -s $rvm_path/default ] ; then
42
- __rvm_log "debug" "$rvm_path/default:\n$($rvm_path/default)\n"
43
- fi
43
+ for file_name in $rvm_path/default $rvm_path/system $rvm_path/config/db ~/.rvmrc ~/.gemrc; do
44
+ if [ -f $file_name -a -s $file_name ] ; then
45
+ __rvm_log "debug" "$file_name (filtered):\n$(cat $file_name | awk '!/assword|_key/')\n"
46
+ fi
47
+ done
44
48
 
45
- if [ -e $rvm_path/bin/rvm ] ; then
46
- __rvm_log "debug" "rvm script in bin:\n$(ls -laht $rvm_path/bin/rvm)"
49
+ if [ -f $rvm_path/bin/rvm ] ; then
50
+ __rvm_log "error" "rvm script in bin! \n$(ls -laht $rvm_path/bin/rvm)"
47
51
  fi
48
-
49
52
  }
50
53
 
51
54
  # Logging functions based on level
52
55
  function __rvm_log {
53
-
54
56
  case "$1" in
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 ;;
57
+ debug) shift ; echo -e "\033[0;35m<debug> \033[0m $* \033[0;35m</debug> \033[0m " ;;
58
+ info) shift ; echo -e "\033[0;32m<info> \033[0m $* \033[0;32m</info> \033[0m " ;;
59
+ warn) shift ; echo -e "\033[0;33m<warning> \033[0m $* \033[0;33m</warning> \033[0m " ;;
60
+ error) shift ; echo -e "\033[0;31m<error> \033[0m $* \033[0;31m</error> \033[0m " ;;
61
+ fail) shift ; echo -e "\033[0;31m<fail> \033[0m $* \033[0;31m</fail> \033[0m " ; __rvm_pushpop ; return 1 ;;
60
62
  *) echo -e "$*"
61
63
  esac
62
64
  }
@@ -86,12 +88,12 @@ function __rvm_run {
86
88
  else
87
89
  eval "nice -n $rvm_niceness /bin/bash -l -c '$command'" >> $rvm_ruby_log_path/$log_file_name.log 2>> $rvm_ruby_log_path/$log_file_name.error.log
88
90
  fi
89
- if [ $? -gt 0 ] ; then __rvm_log "error" "Error running '$command', please check $rvm_ruby_log_path/$log_file_name.error.log" ; popd 2> /dev/null ; return 1 ; fi
91
+ if [ $? -gt 0 ] ; then __rvm_log "error" "Error running '$command', please check $rvm_ruby_log_path/$log_file_name.error.log" ; __rvm_pushpop ; return 1 ; fi
90
92
  unset log_file command
91
93
  }
92
94
 
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 rvm_install_on_use
95
+ function __rvm_cleanup_variables {
96
+ 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 rvm_json_flag rvm_yaml_flag
95
97
  }
96
98
 
97
99
  # TODO: root user loadng of /etc/rvmrc
@@ -101,7 +103,7 @@ function __rvm_load-rvmrc {
101
103
 
102
104
  function __rvm_bin_scripts {
103
105
  # NOTE: This depends on the forthcoming ruby_string select functionality.
104
- rvm_ruby_binaries=`/bin/ls $rvm_path/*/bin/ruby`
106
+ rvm_ruby_binaries=`/bin/ls $rvm_path/*/bin/ruby 2> /dev/null`
105
107
  for rvm_ruby_binary in $rvm_ruby_binaries ; do
106
108
  if [ -x $rvm_ruby_binary ] ; then
107
109
  rvm_ruby_string=`dirname $rvm_ruby_binary | xargs dirname | xargs basename`
@@ -131,7 +133,7 @@ RubyWrapper
131
133
 
132
134
  function __rvm_fetch {
133
135
 
134
- pushd $rvm_archives_path > /dev/null
136
+ __rvm_pushpop $rvm_archives_path
135
137
  eval $rvm_fetch "$1"
136
138
  result=$?
137
139
  if [ $result -gt 0 ] ; then
@@ -141,7 +143,7 @@ function __rvm_fetch {
141
143
  __rvm_log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log"
142
144
  fi
143
145
  fi
144
- popd 2> /dev/null
146
+ __rvm_pushpop
145
147
  return $result
146
148
  }
147
149
 
@@ -259,33 +261,38 @@ function __rvm_src-dir {
259
261
  }
260
262
 
261
263
  # clones from source implementation/version to default
264
+ # TODO: Merge this into 'rvm sync'
262
265
  function __rvm_gem-dup {
263
266
  __rvm_log "debug" "$rvm_ruby_interpreter"
264
267
  if [ "$rvm_ruby_interpreter" = "default" ] ; then
265
268
  # TODO: ~/.rvm/default first, then system user
266
- rvm_source_gem_dir="$rvm_system_user_gem_path"
269
+ rvm_source_gem_path="$rvm_system_user_gem_path"
267
270
  elif [ "$rvm_ruby_interpreter" = "user" ] ; then
268
- rvm_source_gem_dir="$rvm_system_user_gem_path"
271
+ rvm_source_gem_path="$rvm_system_user_gem_path"
269
272
  elif [ "$rvm_ruby_interpreter" = "system" ] ; then
270
- rvm_source_gem_dir="$rvm_system_gem_path"
273
+ rvm_source_gem_path="$rvm_system_gem_path"
271
274
  else
272
275
  # TODO: use selector for this?
273
- rvm_source_gem_dir=${rvm_gem_home/$rvm_ruby_interpreter/$rvm_ruby_version}
276
+ rvm_source_gem_path=${rvm_gem_home/$rvm_ruby_interpreter/$rvm_ruby_version}
274
277
  fi
278
+ __rvm_gem_sync
279
+ }
275
280
 
276
- if [ ! -z "$rvm_source_gem_dir" ] ; then
277
- for rvm_gem_name_version in `/bin/ls $rvm_source_gem_dir/gems` ; do
281
+ function __rvm_gem_sync {
282
+ if [ ! -z "$rvm_source_gem_path" ] ; then
283
+ for rvm_gem_name_version in `/bin/ls $rvm_source_gem_path/gems 2> /dev/null` ; do
278
284
  rvm_gem_name=${rvm_gem_name_version%-*}
279
285
  rvm_gem_version=${rvm_gem_name_version##*-}
280
286
  if [ -d $GEM_HOME/gems/$rvm_gem_name_version ] ; then
281
287
  echo "$rvm_gem_name_version already installed."
282
288
  else
283
- __rvm_gi $rvm_source_gem_dir/cache/$rvm_gem_name-$rvm_gem_version.gem
289
+ __rvm_gi $rvm_source_gem_path/cache/$rvm_gem_name-$rvm_gem_version.gem
284
290
  fi
285
291
  done
286
292
  unset rvm_gem_name_version rvm_gem_name rvm_gem_version
287
293
  else
288
- __rvm_log "fail" "Unknown $rvm_ruby_interpreter version: $rvm_ruby_version"
294
+ __rvm_log "fail" "Unknown ruby selected :("
295
+ result=1
289
296
  fi
290
297
  }
291
298
 
@@ -319,7 +326,7 @@ function __rvm_symlinks {
319
326
  # TODO: Account for the ruby wrapper script files
320
327
 
321
328
  mkdir -p ${rvm_path}/bin
322
- for release in `/bin/ls $rvm_path | grep 'ruby-'` ; do
329
+ for release in `/bin/ls $rvm_path 2> /dev/null | grep 'ruby-'` ; do
323
330
  for binary in irb gem rdoc ri erb ; do
324
331
  if [ -x $rvm_path/$release/bin/$binary ] ; then
325
332
  ln -fs $rvm_path/$release/bin/$binary $rvm_path/bin/$binary-${release#ruby-}
@@ -345,7 +352,7 @@ function __rvm_list {
345
352
  else
346
353
  current=`which ruby | xargs dirname | xargs dirname | xargs basename`
347
354
  echo -e "\nruby:\n"
348
- for version in `/bin/ls -l $rvm_path/ | awk '/ ruby-[1-2].*/ { print $NF }'` ; do
355
+ for version in `/bin/ls -l $rvm_path/ 2> /dev/null | awk '/ ruby-[1-2].*/ { print $NF }'` ; do
349
356
  string=`$rvm_bin_path/$version -v`
350
357
  if [ "$current" = "$version" ] ; then
351
358
  echo -e "=> $version : $string"
@@ -357,7 +364,7 @@ function __rvm_list {
357
364
  unset version
358
365
 
359
366
  echo -e "\njruby:\n"
360
- for version in `/bin/ls -l $rvm_path/ | awk '/jruby-.*/ { print $NF }'` ; do
367
+ for version in `/bin/ls -l $rvm_path/ 2> /dev/null | awk '/jruby-.*/ { print $NF }'` ; do
361
368
  string=`$rvm_bin_path/$version -v`
362
369
  if [ "$current" = "$version" ] ; then
363
370
  echo -e "=> $version : $string"
@@ -369,7 +376,7 @@ function __rvm_list {
369
376
  unset version
370
377
 
371
378
  echo -e "\nree:\n"
372
- for version in `/bin/ls $rvm_path/ | awk '/ruby-enterprise-.*/ { print $NF }'` ; do
379
+ for version in `/bin/ls $rvm_path/ 2> /dev/null | awk '/ruby-enterprise-.*/ { print $NF }'` ; do
373
380
  string=`$rvm_bin_path/$version -v | tr "\n" ' ' `
374
381
  if [ "$current" = "$version" ] ; then
375
382
  echo -e "=> $version : $string"
@@ -394,10 +401,13 @@ function __rvm_list {
394
401
  fi
395
402
 
396
403
  echo -e "\nsystem:\n"
397
- if [ "$selected" = "1" ] ; then
398
- echo -e " $($rvm_system_ruby -v)\n"
399
- else
400
- echo -e "=> $($rvm_system_ruby -v)\n"
404
+ system_version=`bash -l -c 'rvm system ; ruby -v 2> /dev/null'`
405
+ if [ ! -z "$system_version" ] ; then
406
+ if [ "$selected" = "1" ] ; then
407
+ echo -e " $system_version\n"
408
+ else
409
+ echo -e "=> $system_version\n"
410
+ fi
401
411
  fi
402
412
  unset current version selected
403
413
  fi
@@ -541,23 +551,23 @@ function __rvm_ruby_do {
541
551
  else
542
552
  __rvm_log "warn" "'$rvm_ruby_home/bin/$binary' either does not exist or is not executable? :("
543
553
  fi
544
- 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
554
+ 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
545
555
  }
546
556
 
547
557
  function __rvm_do {
558
+ # TODO: Extract the outer looping mechanism with rvm_install's
548
559
  rubies=() ; successes=() ; errors=() ; statuses=()
549
560
  # TODO: Extract the common functionality out of the if below
550
561
  if [ ! -z "$rvm_ruby_version" ] ; then
551
562
  for rvm_ruby_selector in `echo $rvm_ruby_version | tr ',' ' '` ; do
552
- temp=$(echo $rvm_ruby_selector | awk '{print substr($1, 0, 1)}')
553
- if [ ! -z "$(echo $temp | grep '[0-9]')" ] ; then
563
+ if [ ! -z "$(echo $rvm_ruby_selector | awk '/^[0-9]/')" ] ; then
554
564
  rvm_ruby_interpreter="ruby"
555
565
  rvm_ruby_version="$rvm_ruby_selector"
556
566
  else
557
567
  rvm_ruby_interpreter="$rvm_ruby_selector"
558
568
  unset rvm_ruby_version
559
569
  fi
560
- unset temp
570
+ unset rvm_ruby_string
561
571
  __rvm_ruby_do
562
572
  done
563
573
  else # all
@@ -569,7 +579,11 @@ function __rvm_do {
569
579
  fi
570
580
  done < <(/bin/ls $rvm_path/*/bin/ruby 2> /dev/null)
571
581
  fi
582
+ __rvm_summary
583
+ return ${#errors[*]}
584
+ }
572
585
 
586
+ function __rvm_summary {
573
587
  if [ ! -z "$rvm_summary_flag" ] ; then
574
588
  export successes errors statuses
575
589
  echo -e "\nSummary:"
@@ -581,43 +595,45 @@ function __rvm_do {
581
595
 
582
596
  if [ ! -z "$rvm_yaml_flag" ] ; then
583
597
  export successes errors statuses
584
- echo -e "\nYAML:"
585
- echo -e " totals:"
586
- echo -e " rubies: ${#rubies[*]}"
587
- echo -e " successes: ${#successes[*]}"
588
- echo -e " errors: ${#errors[*]}"
589
- echo -e " successes:"
598
+ yaml="\nYAML:\n totals:\n rubies: ${#rubies[*]}\n successes: ${#successes[*]}\n errors: ${#errors[*]}\n successes:"
590
599
  for var in ${successes[*]} ; do
591
- echo -e " - $var"
600
+ yaml="$yaml\n - $var"
592
601
  done
593
- echo -e " errors:"
602
+ yaml="$yaml\n errors:"
594
603
  for var in ${errors[*]} ; do
595
- echo -e " - $var"
596
- done
597
- echo -e " rubies:"
598
- for var in ${rubies[*]} ; do
599
- echo -e " - $var"
600
- done
601
- echo -e " statuses:"
602
- for var in ${statuses[*]} ; do
603
- echo -e " - $var"
604
+ yaml="$yaml\n - $var"
604
605
  done
606
+ yaml="$yaml\n rubies:"
607
+ total=${#rubies[*]}
608
+ if [ ! -z "$ZSH_VERSION" ] ; then array_start=1 ; else array_start=0 ; fi
609
+ for (( index = $array_start ; index < $total + $array_start ; index++ )) ; do
610
+ echo "${rubies[$index]}: ${statuses[$index]}"
611
+ yaml="$yaml\n \"${rubies[$index]}\": ${statuses[$index]}"
612
+ done ; unset index array_start
613
+ echo -e "$yaml"
605
614
  fi
606
615
 
607
616
  if [ ! -z "$rvm_json_flag" ] ; then
608
- summary=$(cat <<-Summary
609
- \nSummary:
610
- JSON:
611
- {
612
- "totals": { "rubies": ${#rubies[*]}, "successes": ${#successes[*]}, "errors": ${#errors[*]}},
613
- "successful": [ "$(echo ${successes[*]} | sed 's/ /", "/g')" ],
614
- "errors": [ "$(echo ${errors[*]} | sed 's/ /", "/g')" ],
615
- "rubies": [ "$(echo ${rubies[*]} | sed 's/ /", "/g')" ],
616
- "statuses": [ $(echo ${statuses[*]} | sed 's/ /, /g') ]
617
- }
618
- Summary
619
- )
620
- echo -e "$summary"
617
+ #
618
+ # TODO: Merge statuses & rubies:
619
+ # rubies:
620
+ # "jruby...": 0
621
+ # "1.9.1...": 1
622
+ #
623
+ json="JSON:\n{"
624
+ json="$json\n \"totals\": { \"rubies\": ${#rubies[*]}, \"successes\": ${#successes[*]}, \"errors\": ${#errors[*]}},"
625
+ json="$json\n \"successful\": [ "$(echo ${successes[*]} | sed 's/ /", "/g')" ],"
626
+ json="$json\n \"errors\": [ "$(echo ${errors[*]} | sed 's/ /", "/g')" ],"
627
+ json="$json\n \"rubies\": {"
628
+ total=${#rubies[*]}
629
+ if [ ! -z "$ZSH_VERSION" ] ; then array_start=1 ; else array_start=0 ; fi
630
+ for (( index = $array_start ; index < $total + $array_start ; index++ )) ; do
631
+ echo "${rubies[$index]}: ${statuses[$index]}"
632
+ json="$json\n {\"${rubies[$index]}\": ${statuses[$index]}}"
633
+ if (( $index + 1 < $total + $array_start )) ; then json="$json, " ; fi
634
+ done ; unset index array_start
635
+ json="$json\n }\n}"
636
+ echo -e "$json"
621
637
  else
622
638
  unset bin_line rvm_summary_flag
623
639
  fi
@@ -674,34 +690,26 @@ function __rvm_ruby_string {
674
690
  }
675
691
 
676
692
  function __rvm_gemset_dump {
677
- if [ -z "$rvm_gem_set_name" ] ; then
678
- file_name="default"
679
- else
680
- file_name="$rvm_gem_set_name"
681
- fi
693
+ file_name=${rvm_gem_set_name:-'default'}
682
694
 
683
695
  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
684
696
 
685
- gems="`gem list | sed 's/[\(|\)]//g' | sed 's/, /,/g' | tr ' ' ';'`"
686
- for gem in $gems ; do
697
+ for gem in `gem list | sed 's/[\(|\)]//g' | sed 's/, /,/g' | tr ' ' ';'` ; do
687
698
  name=`echo $gem | awk -F';' '{print $1}'`
688
699
  if [ -z "$rvm_latest_flag" ] ; then
689
700
  versions=`echo $gem | awk -F';' '{print $2}' | sed 's/,/ /g'`
690
701
  for version in $versions ; do
691
702
  echo "$name -v$version" >> $file_name.gemset
692
- done
693
- unset version
703
+ done ; unset version versions
694
704
  else
695
705
  echo "$name" >> $file_name.gemset
696
- fi
697
- unset name
698
- done
699
- unset file_name gems versions
706
+ fi ; unset name
707
+ done ; unset file_name
700
708
  }
701
709
 
702
710
  function __rvm_gemset_load {
703
711
  echo "Loading $rvm_load_file file..."
704
- rvm_ruby_gem_list=`/bin/ls $rvm_gem_home/specifications/ | sed 's/\.gemspec$//' 2> /dev/null`
712
+ rvm_ruby_gem_list=`/bin/ls $rvm_gem_home/specifications/ 2> /dev/null | sed 's/\.gemspec$//' 2> /dev/null`
705
713
  while read line
706
714
  do # Keep this on 2nd line :( bash fail.
707
715
  # TODO: Switch to a different field separator than ; to allow for evals
@@ -716,7 +724,8 @@ function __rvm_gemset_load {
716
724
  else # version
717
725
  gem_file_name="$gem_name-$gem_version.gem"
718
726
  fi
719
- cache_file=`/bin/ls -t $rvm_gem_path/*/*/cache/${gem_file_name}* | head -n1 2> /dev/null`
727
+
728
+ cache_file=`/bin/ls -t $rvm_gem_path/*/*/cache/${gem_file_name}* 2> /dev/null | head -n1`
720
729
  if [ -z "$cache_file" ] ; then
721
730
  if [ -z "$gem_version" ] ; then
722
731
  gem="$gem_name"
@@ -774,15 +783,21 @@ Config
774
783
  touch $rvm_ruby_irbrc
775
784
  echo -e "\n$rvm_irbrc_file" > $rvm_ruby_home/.irbrc
776
785
  fi
777
-
778
786
  }
779
787
 
788
+ function __rvm_pushpop {
789
+ if [ -z "$1" ] ; then
790
+ popd > /dev/null 2>&1
791
+ else
792
+ pushd $1 > /dev/null 2>&1
793
+ fi
794
+ }
780
795
 
781
796
  #
782
797
  # ruby supporting libraries:
783
798
  #
784
799
  function __rvm_readline_install {
785
- pushd $rvm_path/src > /dev/null
800
+ __rvm_pushpop $rvm_path/src
786
801
  package=readline
787
802
  version=5.2
788
803
  # TODO: Figure out how to list, grab and apply the patches
@@ -800,11 +815,11 @@ function __rvm_readline_install {
800
815
  fi
801
816
  __rvm_run "$package.make" make
802
817
  __rvm_run "$package.make.install" make install
803
- popd > /dev/null
818
+ __rvm_pushpop
804
819
  }
805
820
 
806
821
  function __rvm_iconv_install {
807
- pushd $rvm_path/src > /dev/null
822
+ __rvm_pushpop $rvm_path/src
808
823
  package=libiconv
809
824
  version=1.13.1
810
825
  __rvm_fetch "http://ftp.gnu.org/pub/gnu/libiconv/$package-$version.tar.gz"
@@ -813,7 +828,5 @@ function __rvm_iconv_install {
813
828
  __rvm_run "$package.configure" ./configure --prefix=$rvm_path/usr --disable-shared
814
829
  __rvm_run "$package.make" make
815
830
  __rvm_run "$package.make.install" make install
816
-
817
- popd > /dev/null
831
+ __rvm_pushpop
818
832
  }
819
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wayneeseguin-rvm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.44
4
+ version: 0.0.45
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-18 00:00:00 -07:00
12
+ date: 2009-09-20 00:00:00 -07:00
13
13
  default_executable: rvm-install
14
14
  dependencies: []
15
15
 
@@ -30,6 +30,7 @@ files:
30
30
  - lib/VERSION.yml
31
31
  - lib/rvm.rb
32
32
  - rvm.gemspec
33
+ - scripts/gemsync
33
34
  - scripts/rvm
34
35
  - scripts/rvm-aliases
35
36
  - scripts/rvm-cli