rvm 0.0.57 → 0.0.58

Sign up to get free protection for your applications and to get access to all the features.
data/scripts/utility CHANGED
@@ -8,11 +8,11 @@ system:
8
8
  uname: "$(uname -a)"
9
9
 
10
10
  ruby:
11
- interpreter: "`echo $full_version | awk '{print $1}'`"
12
- version: "`echo $full_version | awk '{print $2}'`"
13
- date: "`echo $full_version | sed 's/^.*(\([0-9]\{4\}\(-[0-9][0-9]\)\{2\}\).*$/\1/'`"
14
- platform: "`echo $full_version | sed 's/^.*\[//' | sed 's/\].*$//'`"
15
- patchlevel: "`echo $full_version | sed 's/^.*(//' | sed 's/).*$//'`"
11
+ interpreter: "$(echo $full_version | awk '{print $1}')"
12
+ version: "$(echo $full_version | awk '{print $2}')"
13
+ date: "$(echo $full_version | sed 's/^.*(\([0-9]\{4\}\(-[0-9][0-9]\)\{2\}\).*$/\1/')"
14
+ platform: "$(echo $full_version | sed 's/^.*\[//' | sed 's/\].*$//')"
15
+ patchlevel: "$(echo $full_version | sed 's/^.*(//' | sed 's/).*$//')"
16
16
  full_version: "$full_version"
17
17
 
18
18
  homes:
@@ -20,10 +20,10 @@ homes:
20
20
  ruby: "${MY_RUBY_HOME:-'not set'}"
21
21
 
22
22
  binaries:
23
- ruby: "`which ruby`"
24
- irb: "`which irb`"
25
- gem: "`which gem`"
26
- rake: "`which rake`"
23
+ ruby: "$(which ruby)"
24
+ irb: "$(which irb)"
25
+ gem: "$(which gem)"
26
+ rake: "$(which rake)"
27
27
 
28
28
  environment:
29
29
  GEM_HOME: "$GEM_HOME"
@@ -64,13 +64,13 @@ function __rvm_log {
64
64
  case "$level" in
65
65
  debug) shift ;
66
66
  if [ ! -z "$rvm_debug_flag" ] ; then
67
- echo -e "\033[0;35m<d>\033[0m $message \033[0;35m</d> \033[0m "
67
+ echo -e "$(tput setaf 5)<d>$(tput sgr0) $message $(tput setaf 5)</d> $(tput sgr0) "
68
68
  fi
69
69
  ;;
70
- info) shift ; echo -e "\033[0;32m<i>\033[0m $message \033[0;32m</i> \033[0m " ;;
71
- warn) shift ; echo -e "\033[0;33m<w>\033[0m $message \033[0;33m</w> \033[0m " ;;
72
- error) shift ; echo -e "\033[0;31m<e>\033[0m $message \033[0;31m</e> \033[0m " ;;
73
- fail) shift ; echo -e "\033[0;31m<f>\033[0m $message \033[0;31m</f> \033[0m " ; __rvm_pushpop ; return 1 ;;
70
+ info) shift ; echo -e "$(tput setaf 2)<i>$(tput sgr0) $message $(tput setaf 2)</i> $(tput sgr0) " ;;
71
+ warn) shift ; echo -e "$(tput setaf 3)<w>$(tput sgr0) $message $(tput setaf 3)</w> $(tput sgr0) " ;;
72
+ error) shift ; echo -e "$(tput setaf 1)<e>$(tput sgr0) $message $(tput setaf 1)</e> $(tput sgr0) " ;;
73
+ fail) shift ; echo -e "$(tput setaf 1)<f>$(tput sgr0) $message $(tput setaf 1)</f> $(tput sgr0) " ; __rvm_pushpop ; return 1 ;;
74
74
  *) echo -e "$message"
75
75
  esac
76
76
  }
@@ -105,10 +105,10 @@ function __rvm_run {
105
105
  __rvm_log "debug" "Executing: $command"
106
106
  touch "$rvm_ruby_log_path/$log_file_name.log" "$rvm_ruby_log_path/$log_file_name.error.log" # for zsh :(
107
107
  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"
108
- if [ -z "$rvm_niceness" -o "$rvm_niceness" = "0" ] ; then
108
+ if [ -z "$rvm_niceness" -o "0" = "$rvm_niceness" ] ; then
109
109
  eval "$command" >> "$rvm_ruby_log_path/$log_file_name.log" 2>> "$rvm_ruby_log_path/$log_file_name.error.log"
110
110
  else
111
- eval "nice -n $rvm_niceness \`$command\`" >> $rvm_ruby_log_path/$log_file_name.log 2>> $rvm_ruby_log_path/$log_file_name.error.log
111
+ eval "nice -n $rvm_niceness \$($command)" >> $rvm_ruby_log_path/$log_file_name.log 2>> $rvm_ruby_log_path/$log_file_name.error.log
112
112
  fi
113
113
  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
114
114
  unset log_file command
@@ -273,8 +273,8 @@ function __rvm_implode {
273
273
  while : ; do
274
274
  __rvm_log "warn" "Are you SURE you wish for rvm to implode? This will remove $rvm_path ? (type 'yes' or 'no')"
275
275
  read response
276
- if [ "$response" = "yes" ] ; then
277
- if [ "$rvm_path" = "/" ] ; then
276
+ if [ "yes" = "$response" ] ; then
277
+ if [ "/" = "$rvm_path" ] ; then
278
278
  __rvm_log "error" "remove '/' ?!... NO!"
279
279
  else
280
280
  if [ -d $rvm_path ] ; then
@@ -286,7 +286,7 @@ function __rvm_implode {
286
286
  fi
287
287
  fi
288
288
  break
289
- elif [ "$response" = "no" ] ; then
289
+ elif [ "no" = "$response" ] ; then
290
290
  __rvm_log "info" "Cancelling implosion, no harm done :)"
291
291
  break
292
292
  fi
@@ -313,12 +313,12 @@ function __rvm_source_dir {
313
313
  function __rvm_gemdup {
314
314
  if [ -z "$rvm_selected_flag" ] ; then __rvm_select $* ; fi
315
315
  __rvm_log "debug" "$rvm_ruby_interpreter"
316
- if [ "$rvm_ruby_interpreter" = "default" ] ; then
316
+ if [ "default" = "$rvm_ruby_interpreter" ] ; then
317
317
  # TODO: ~/.rvm/default first, then system user
318
318
  rvm_source_gem_path="$rvm_system_user_gem_path"
319
- elif [ "$rvm_ruby_interpreter" = "user" ] ; then
319
+ elif [ "user" = "$rvm_ruby_interpreter" ] ; then
320
320
  rvm_source_gem_path="$rvm_system_user_gem_path"
321
- elif [ "$rvm_ruby_interpreter" = "system" ] ; then
321
+ elif [ "system" = "$rvm_ruby_interpreter" ] ; then
322
322
  rvm_source_gem_path="$rvm_system_gem_path"
323
323
  else
324
324
  # TODO: use selector for this?
@@ -354,7 +354,7 @@ function __rvm_db {
354
354
  __rvm_log "fail" "__rvm_db must be called with at least one argument: __rvm_db key [value]"
355
355
  else
356
356
  value="$*"
357
- if [ "$value" = "unset" -o "$value" = "delete" ] ; then
357
+ if [ "unset" = "$value" -o "delete" = "$value" ] ; then
358
358
  sed -i.tmp "s/^$key=.*$//" $rvm_hash_file
359
359
  else
360
360
  if [ -z "$value" ] ; then # get
@@ -381,7 +381,7 @@ function __rvm_list {
381
381
  echo -e "\nruby:\n"
382
382
  for version in $(/bin/ls -l $rvm_path/ 2> /dev/null | awk '/ ruby-[1-2].*/ { print $NF }') ; do
383
383
  string=$($rvm_path/$version/bin/ruby -v)
384
- if [ "$current_ruby" = "$version" ] ; then
384
+ if [[ "$version" = "$current_ruby" ]] ; then
385
385
  echo -e "=> $version : $string"
386
386
  selected="1"
387
387
  else
@@ -392,7 +392,7 @@ function __rvm_list {
392
392
  echo -e "\njruby:\n"
393
393
  for version in $(/bin/ls -l $rvm_path/ 2> /dev/null | awk '/jruby-.*/ { print $NF }') ; do
394
394
  string=$($rvm_path/$version/bin/ruby -v)
395
- if [ "$current_ruby" = "$version" ] ; then
395
+ if [[ "$version" = "$current_ruby" ]] ; then
396
396
  echo -e "=> $version : $string"
397
397
  selected="1"
398
398
  else
@@ -403,7 +403,7 @@ function __rvm_list {
403
403
  echo -e "\nree:\n"
404
404
  for version in $(/bin/ls $rvm_path/ 2> /dev/null | awk '/ree-.*/ { print $NF }') ; do
405
405
  string="$($rvm_path/$version/bin/ruby -v | tr "\n" ' ' )"
406
- if [ "$current_ruby" = "$version" ] ; then
406
+ if [[ "$version" = "$current_ruby" ]] ; then
407
407
  echo -e "=> $version : $string"
408
408
  selected="1"
409
409
  else
@@ -416,7 +416,7 @@ function __rvm_list {
416
416
  if [ ! -z "$version" ] ; then
417
417
  echo -e "\ndefault:\n"
418
418
  string=$($rvm_path/$version/bin/ruby -v)
419
- if [ "$current_ruby" = "$version" ] ; then
419
+ if [[ "$version" = "$current_ruby" ]] ; then
420
420
  echo -e "=> $version : $string"
421
421
  selected="1"
422
422
  else
@@ -428,7 +428,7 @@ function __rvm_list {
428
428
  echo -e "\nsystem:\n"
429
429
  system_version=$(rvm system ; ruby -v 2> /dev/null)
430
430
  if [ ! -z "$system_version" ] ; then
431
- if [ "$($(which ruby) -v)" = "$system_version" ] ; then
431
+ if [[ "$($(which ruby) -v)" = "$system_version" ]] ; then
432
432
  echo -e "=> $system_version\n"
433
433
  else
434
434
  echo -e " $system_version\n"
@@ -446,7 +446,7 @@ function __rvm_initialize {
446
446
  fi
447
447
 
448
448
  # TODO: Sanitize user input, ensure that there is a / a the end...
449
- if [ "$(whoami)" = "root" ] ; then
449
+ if [ "root" = "$(whoami)" ] ; then
450
450
  __rvm_log "fail" "root user support is not yet implemented."
451
451
  rvm_prefix_path="${rvm_prefix_path:-/usr/local/}"
452
452
  else
@@ -472,7 +472,7 @@ function __rvm_initialize {
472
472
  rvm_ruby_load_path="."
473
473
  rvm_ruby_require=""
474
474
 
475
- if [ "$(uname)" = "Darwin" ] ; then rvm_archflags="${rvm_archflags:-'-arch i386 -arch x86_64'}" ; fi
475
+ if [ "Darwin" = "$(uname)" ] ; then rvm_archflags="${rvm_archflags:-'-arch i386 -arch x86_64'}" ; fi
476
476
 
477
477
  __rvm_clean-path
478
478
  rvm_result=$(echo $PATH | grep 'rvm\/bin:')
@@ -484,7 +484,7 @@ function __rvm_initialize {
484
484
  }
485
485
 
486
486
  function __rvm_update {
487
- if [ "$rvm_ruby_revision" = "head" -o ! -z "$rvm_self_flag" -o "$rvm_action" = "update" -o ! -z "$rvm_update_flag" ] ; then
487
+ if [ "head" = "$rvm_ruby_revision" -o ! -z "$rvm_self_flag" -o "update" = "$rvm_action" -o ! -z "$rvm_update_flag" ] ; then
488
488
  __rvm_version
489
489
  __rvm_update_rvm
490
490
  __rvm_version
@@ -497,7 +497,7 @@ function __rvm_update {
497
497
 
498
498
  function __rvm_update_rvm {
499
499
  mkdir -p $rvm_src_path
500
- if [ "$rvm_ruby_revision" = "head" ] ; then
500
+ if [ "head" = "$rvm_ruby_revision" ] ; then
501
501
  if [ -d $rvm_src_path/rvm/.git ] ; then
502
502
  cd $rvm_src_path/rvm/ && git pull origin master && ./scripts/install
503
503
  else
@@ -513,11 +513,11 @@ function __rvm_update_rvm {
513
513
  function __rvm_reboot {
514
514
  __rvm_log "warn" "Do you wish to reset rvm? ('yes', or 'no')"
515
515
  read response
516
- if [ "$response" = "yes" ] ; then
516
+ if [ "yes" = "$response" ] ; then
517
517
  cd
518
518
  __rvm_reset
519
519
  mv ~/.rvm/archives ~/.archives
520
- if [ "$rvm_path" = "/" ] ; then
520
+ if [ "/" = "$rvm_path" ] ; then
521
521
  __rvm_log "error" "remove '/' ?!... NO!"
522
522
  else
523
523
  if [ -d $rvm_path ] ; then
@@ -548,10 +548,10 @@ function __rvm_reload {
548
548
  function __rvm_ruby_do {
549
549
  __rvm_select
550
550
  __rvm_use
551
- binary=`echo $rvm_action | sed 's/do$//'`
551
+ binary="$(echo $rvm_action | sed 's/do$//')"
552
552
  if [ -x $rvm_ruby_home/bin/$binary ] ; then
553
553
  load_path="$rvm_ruby_home/bin:$rvm_ruby_load_path"
554
- if [ "$binary" = "ruby" ] ; then
554
+ if [ "ruby" = "$binary" ] ; then
555
555
  if [ -z "$(echo $rvm_ruby_args | awk '/\.rb$/')" ] ; then
556
556
  rvm_ruby_args="-S $rvm_ruby_args"
557
557
  fi
@@ -591,7 +591,7 @@ function __rvm_do {
591
591
  unset rvm_ruby_interpreter rvm_ruby_version
592
592
  __rvm_ruby_do
593
593
  elif [ ! -z "$rvm_ruby_version" ] ;then
594
- for rvm_ruby_selector in `echo $rvm_ruby_version | tr ',' ' '` ; do
594
+ for rvm_ruby_selector in $(echo $rvm_ruby_version | tr ',' ' ') ; do
595
595
  unset rvm_ruby_string
596
596
  __rvm_ruby_do
597
597
  done
@@ -602,7 +602,7 @@ function __rvm_do {
602
602
  while read bin_line
603
603
  do # Keep this on second line damnit!
604
604
  if [ -x $bin_line ] ; then
605
- rvm_ruby_string="`dirname $bin_line | xargs dirname | xargs basename`"
605
+ rvm_ruby_string="$(dirname $bin_line | xargs dirname | xargs basename)"
606
606
  __rvm_ruby_do
607
607
  fi
608
608
  done < <(/bin/ls $rvm_path/*/bin/ruby 2> /dev/null)
@@ -723,10 +723,10 @@ function __rvm_pushpop {
723
723
 
724
724
  function __rvm_state {
725
725
  if [ -z "$rvm_state" ] ; then
726
- if [ -z "$(which ruby | awk /`basename $rvm_path`/)" ] ; then
726
+ if [ -z "$(which ruby | awk /$(basename $rvm_path)/)" ] ; then
727
727
  rvm_state=system
728
728
  else
729
- rvm_state="$(dirname `which ruby` | xargs dirname | xargs basename)"
729
+ rvm_state="$(dirname $(which ruby) | xargs dirname | xargs basename)"
730
730
  fi
731
731
  else
732
732
  rvm_ruby_string="$rvm_state"
@@ -760,7 +760,7 @@ function __rvm_readline_install {
760
760
  __rvm_fetch "ftp://ftp.gnu.org/gnu/readline/$package-$version.$archive_format"
761
761
  __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
762
762
  cd "$rvm_src_path/$package-$version"
763
- if [ "$(uname)" = "Darwin" ] ; then
763
+ if [ "Darwin" = "$(uname)" ] ; then
764
764
  sdk=$(ls -t /Developer/SDKs/ | head -n 1)
765
765
  CFLAGS="-isysroot /Developer/SDKs/$sdk -arch i386 -arch x86_64"
766
766
  LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/$sdk -arch i386 -arch x86_64"
@@ -788,19 +788,18 @@ function __rvm_iconv_install {
788
788
  }
789
789
 
790
790
  __rvm_monitor() {
791
- if [ -d test/ ] ; then
792
- :
793
- elif [ -d spec/ ] ; then
794
- :
795
- fi
796
- #
797
- # timestamp() {
798
- # if [ "$(uname)" = "Darwin" ] ; then
799
- # $(stat -c "%Y" $1)
800
- # else
801
- # echo $(stat -f "%m" $1)
802
- # fi
803
- # }
804
- #
791
+ if [ -d test/ ] ; then
792
+ :
793
+ elif [ -d spec/ ] ; then
794
+ :
795
+ fi
796
+ }
797
+
798
+ timestamp() {
799
+ if [ "Darwin" = "$(uname)" ] ; then
800
+ echo $(stat -c "%Y" $1)
801
+ else
802
+ echo $(stat -f "%m" $1)
803
+ fi
805
804
  }
806
805
 
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.57
4
+ version: 0.0.58
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wayne E. Seguin
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-10 00:00:00 -04:00
12
+ date: 2009-10-12 00:00:00 -04:00
13
13
  default_executable: rvm-install
14
14
  dependencies: []
15
15