rvm 0.0.81 → 0.0.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/install CHANGED
@@ -36,7 +36,7 @@ cp -f "$source_dir/README" "$rvm_path/"
36
36
  # Scripts
37
37
  #
38
38
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
39
- for dir_name in config scripts examples lib ; do
39
+ for dir_name in config scripts examples lib hooks ; do
40
40
  mkdir -p "$rvm_path/$dir_name"
41
41
  cp -Rf "$source_dir/$dir_name" "$rvm_path"
42
42
  done ; unset dir_name
@@ -44,27 +44,31 @@ done ; unset dir_name
44
44
  #
45
45
  # Bin Scripts
46
46
  #
47
- cp -Rf "$source_dir/binscripts" $rvm_path/bin
47
+ cp -Rf "$source_dir/binscripts/" $rvm_path/bin
48
48
  chmod +x $rvm_path/bin/*
49
49
  ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
50
50
 
51
51
  #
52
52
  # RC Files
53
53
  #
54
- for rcfile in $(echo $rvm_rc_files) ; do
55
- if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
56
- if [[ -z "$(awk "/$(echo "$rvm_path/scripts/rvm" | sed 's#/#\\/#g')/" $rcfile)" ]] ; then
57
- echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] && [[ "\$rvm_loaded_flag" -le 0 ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
58
- echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] && [[ "\$rvm_loaded_flag" != "1" ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
59
- else
60
- : # it exists... remove it and append at the end
61
- fi
62
- done
54
+ if [[ "$rvm_loaded_flag" != "1" ]] ; then
55
+ for rcfile in $(echo $rvm_rc_files) ; do
56
+ if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
57
+ if [[ -z "$(awk "/scripts\/rvm/" $rcfile)" ]] ; then
58
+ echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
59
+ echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
60
+ else
61
+ : # it exists... remove it and append at the end
62
+ fi
63
+ done
64
+ fi
63
65
 
64
66
  if [[ "root" = "$(whoami)" ]] ; then
65
67
  ln -nfs $rvm_path/scripts/rvm /usr/local/bin/rvm
66
- chmod +x /usr/local/bin/rvm
68
+ else
69
+ ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
67
70
  fi
71
+ chmod +x $rvm_path/scripts/rvm
68
72
 
69
73
  #
70
74
  # System Checks
@@ -102,7 +106,8 @@ if [[ "Linux" = "$system" ]] ; then
102
106
  echo -e " The SUN java runtime environment and development kit."
103
107
  fi
104
108
  elif [[ "Darwin" = "$system" ]] ; then
105
- echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
109
+ echo -e " $item Be sure that you have XCode Tools (Version 3.2.1 (1613) or later) installed in order to use rvm."
110
+ echo -e " $item You can download the latest XCode tools from developer.apple.com. This will be necessary with the dvd install for Snow Leopard which has bugs."
106
111
  echo -e " $item If you intend on installing MacRuby you must install LLVM first."
107
112
  fi
108
113
 
@@ -114,6 +119,6 @@ echo -e "\n$(tput setaf 2)RTFM:\n $(tput sgr0) http://rvm.beginrescueend.com/
114
119
  echo -e "$(tput setaf 2)w⦿‿⦿t!$(tput sgr0)"
115
120
  echo -e "\n ~ Wayne\n"
116
121
 
117
- $rvm_path/bin/rvm -v
122
+ $cwd/scripts/rvm -v
118
123
 
119
124
  exit 0
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 81
4
+ :patch: 82
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.0.81"
8
+ s.version = "0.0.82"
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-11-19}
12
+ s.date = %q{2009-11-21}
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}
@@ -32,6 +32,7 @@ Gem::Specification.new do |s|
32
32
  "lib/rvm/version.rb",
33
33
  "rvm.gemspec",
34
34
  "scripts/aliases",
35
+ "scripts/array",
35
36
  "scripts/cli",
36
37
  "scripts/color",
37
38
  "scripts/completion",
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Usage: contains "a_string" "${an_array[@]}"
4
+ array_contains() {
5
+ local pattern="$1" ; shift
6
+ local index list
7
+ list=("$@")
8
+ for index in "${!list[@]}" ; do
9
+ [[ ${list[index]} = $pattern ]] && { echo $index ; return 0 ; }
10
+ done
11
+ echo -1 ; return 1
12
+ }
13
+
14
+ array_length() {
15
+ array=$1 ; return "${#array[*]}"
16
+ }
17
+
18
+ array_push() {
19
+ array=$1 ; shift ; item=$2
20
+ # TODO: allow loop over more arguments.
21
+ eval "index=\$((\${#${array}[*]} + $__array_start))"
22
+ eval "${array}[${index}]=${item}"
23
+ }
24
+
@@ -17,7 +17,7 @@ __rvm_parse_args() {
17
17
  while [[ $# -gt 0 ]] ; do
18
18
  rvm_token="$1" ; shift
19
19
  case "$rvm_token" in
20
- install|uninstall|path|info|setup|version|srcdir|list|reset|debug|reload|implode|readline|update|iconv|curl|openssl|ncurses|zlib|readline)
20
+ install|uninstall|path|info|setup|version|srcdir|list|reset|debug|reload|implode|readline|update|iconv|curl|openssl|ncurses|zlib|readline|monitor)
21
21
  rvm_action=$rvm_token
22
22
  ;;
23
23
 
@@ -338,24 +338,24 @@ rvm() {
338
338
  if [[ -z "$rvm_trace_flag" ]] ; then set +x ; else set -x ; fi
339
339
  result=0
340
340
  case "$rvm_action" in
341
- use) __rvm_use ; result=$? ;;
342
- gemdir) __rvm_gemdir ; result=$? ;;
343
- srcdir) __rvm_source_dir ; result=$? ;;
344
- list) __rvm_list ; result=$? ;;
345
- version) __rvm_version ; result=$? ;;
346
- reset) __rvm_reset ; result=$? ;;
347
- implode) __rvm_implode ; result=$? ;;
348
- update) __rvm_update ; result=$? ;;
349
- readline) __rvm_readline_install ; result=$? ;;
350
- reboot) __rvm_reboot ; result=$? ;;
351
- usage|help) __rvm_usage ; result=$? ;;
352
- benchmark) __rvm_benchmark ; result=$? ;;
353
- inspect) __rvm_inspect ; result=$? ;;
354
- gems) __rvm_gems ; result=$? ;;
355
- remove) __rvm_remove_ruby ; result=$? ;;
356
- ruby|gem|rake) __rvm_do ; result=$? ;;
341
+ use) __rvm_use ; result=$? ;;
342
+ gemdir) __rvm_gemdir ; result=$? ;;
343
+ srcdir) __rvm_source_dir ; result=$? ;;
344
+ list) __rvm_list ; result=$? ;;
345
+ version) __rvm_version ; result=$? ;;
346
+ reset) __rvm_reset ; result=$? ;;
347
+ implode) __rvm_implode ; result=$? ;;
348
+ update) __rvm_update ; result=$? ;;
349
+ reboot) __rvm_reboot ; result=$? ;;
350
+ usage|help) __rvm_usage ; result=$? ;;
351
+ benchmark) __rvm_benchmark ; result=$? ;;
352
+ inspect) __rvm_inspect ; result=$? ;;
353
+ gems) __rvm_gems ; result=$? ;;
354
+ remove) __rvm_remove_ruby ; result=$? ;;
355
+ ruby|gem|rake) __rvm_do ; result=$? ;;
356
+ monitor) $rvm_scripts_path/monitor ; result=$? ;;
357
357
  reload) source "$rvm_path/scripts/rvm" ;;
358
- install|uninstall) __rvm_manage_rubies ; result=$? ;;
358
+ install|uninstall) __rvm_manage_rubies ; result=$? ;;
359
359
  tests|specs) rvm_action="rake" ; __rvm_do ; result=$? ;;
360
360
 
361
361
  iconv|openssl|ncurses|zlib|readline|curl)
@@ -13,6 +13,7 @@ rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
13
13
  rvm_bin_path="${rvm_bin_path:-"$rvm_path/bin"}"
14
14
  rvm_gem_path="${rvm_gem_path:-"$rvm_path/gems"}"
15
15
  rvm_config_path="${rvm_config_path:-"$rvm_path/config"}"
16
+ rvm_hooks_path="${rvm_hooks_path:-"$rvm_path/hooks"}"
16
17
  rvm_temp_path="${rvm_temp_path:-"$rvm_path/tmp"}"
17
18
 
18
19
  export rvm_path rvm_scripts_path rvm_archives_path rvm_src_path rvm_log_path rvm_bin_path rvm_gem_path rvm_config_path rvm_temp_path
@@ -36,7 +36,7 @@ cp -f "$source_dir/README" "$rvm_path/"
36
36
  # Scripts
37
37
  #
38
38
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
39
- for dir_name in config scripts examples lib ; do
39
+ for dir_name in config scripts examples lib hooks ; do
40
40
  mkdir -p "$rvm_path/$dir_name"
41
41
  cp -Rf "$source_dir/$dir_name" "$rvm_path"
42
42
  done ; unset dir_name
@@ -44,27 +44,31 @@ done ; unset dir_name
44
44
  #
45
45
  # Bin Scripts
46
46
  #
47
- cp -Rf "$source_dir/binscripts" $rvm_path/bin
47
+ cp -Rf "$source_dir/binscripts/" $rvm_path/bin
48
48
  chmod +x $rvm_path/bin/*
49
49
  ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
50
50
 
51
51
  #
52
52
  # RC Files
53
53
  #
54
- for rcfile in $(echo $rvm_rc_files) ; do
55
- if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
56
- if [[ -z "$(awk "/$(echo "$rvm_path/scripts/rvm" | sed 's#/#\\/#g')/" $rcfile)" ]] ; then
57
- echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] && [[ "\$rvm_loaded_flag" -le 0 ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
58
- echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] && [[ "\$rvm_loaded_flag" != "1" ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
59
- else
60
- : # it exists... remove it and append at the end
61
- fi
62
- done
54
+ if [[ "$rvm_loaded_flag" != "1" ]] ; then
55
+ for rcfile in $(echo $rvm_rc_files) ; do
56
+ if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
57
+ if [[ -z "$(awk "/scripts\/rvm/" $rcfile)" ]] ; then
58
+ echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
59
+ echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
60
+ else
61
+ : # it exists... remove it and append at the end
62
+ fi
63
+ done
64
+ fi
63
65
 
64
66
  if [[ "root" = "$(whoami)" ]] ; then
65
67
  ln -nfs $rvm_path/scripts/rvm /usr/local/bin/rvm
66
- chmod +x /usr/local/bin/rvm
68
+ else
69
+ ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
67
70
  fi
71
+ chmod +x $rvm_path/scripts/rvm
68
72
 
69
73
  #
70
74
  # System Checks
@@ -102,7 +106,8 @@ if [[ "Linux" = "$system" ]] ; then
102
106
  echo -e " The SUN java runtime environment and development kit."
103
107
  fi
104
108
  elif [[ "Darwin" = "$system" ]] ; then
105
- echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
109
+ echo -e " $item Be sure that you have XCode Tools (Version 3.2.1 (1613) or later) installed in order to use rvm."
110
+ echo -e " $item You can download the latest XCode tools from developer.apple.com. This will be necessary with the dvd install for Snow Leopard which has bugs."
106
111
  echo -e " $item If you intend on installing MacRuby you must install LLVM first."
107
112
  fi
108
113
 
@@ -114,6 +119,6 @@ echo -e "\n$(tput setaf 2)RTFM:\n $(tput sgr0) http://rvm.beginrescueend.com/
114
119
  echo -e "$(tput setaf 2)w⦿‿⦿t!$(tput sgr0)"
115
120
  echo -e "\n ~ Wayne\n"
116
121
 
117
- $rvm_path/bin/rvm -v
122
+ $cwd/scripts/rvm -v
118
123
 
119
124
  exit 0
@@ -3,11 +3,11 @@
3
3
  if [[ ! -z "$2" ]] ; then level=$1 ; shift ; else level="info" ; fi
4
4
  message=$1
5
5
  case "$level" in
6
- debug) shift ; echo -e "$(tput setaf 5)<d>$(tput sgr0) $message $(tput setaf 5)</d> $(tput sgr0) " ;;
7
- info) shift ; echo -e "$(tput setaf 2)<i>$(tput sgr0) $message $(tput setaf 2)</i> $(tput sgr0) " ;;
8
- warn) shift ; echo -e "$(tput setaf 3)<w>$(tput sgr0) $message $(tput setaf 3)</w> $(tput sgr0) " ;;
9
- error) shift ; echo -e "$(tput setaf 1)<e>$(tput sgr0) $message $(tput setaf 1)</e> $(tput sgr0) " ;;
10
- fail) shift ; echo -e "$(tput setaf 1)<f>$(tput sgr0) $message $(tput setaf 1)</f> $(tput sgr0) " ;;
6
+ debug) shift ; echo -e "$(tput setaf 5)<d>$(tput sgr0) $message $(tput setaf 5)</d> $(tput sgr0) " ;;
7
+ info) shift ; echo -e "$(tput setaf 2)<i>$(tput sgr0) $message $(tput setaf 2)</i> $(tput sgr0) " ;;
8
+ warn) shift ; echo -e "$(tput setaf 3)<w>$(tput sgr0) $message $(tput setaf 3)</w> $(tput sgr0) " ;;
9
+ error) shift ; echo -e "$(tput setaf 1)<e>$(tput sgr0) $message $(tput setaf 1)</e> $(tput sgr0) " >&2 ;;
10
+ fail) shift ; echo -e "$(tput setaf 1)<f>$(tput sgr0) $message $(tput setaf 1)</f> $(tput sgr0) " >&2 ;;
11
11
  *) echo -e "$message"
12
12
  esac
13
13
 
@@ -1 +1,41 @@
1
1
  #!/usr/bin/env bash
2
+
3
+ timestamp() {
4
+ if [[ "Darwin" = "$(uname)" ]] ; then
5
+ echo $(stat -f "%m" $1)
6
+ else
7
+ echo $(stat -c "%Y" $1)
8
+ fi
9
+ }
10
+
11
+ if [[ -d "test/" ]] ; then test_timestamp=$(timestamp "test/") ; fi
12
+ if [[ -d "spec/" ]] ; then spec_timestamp=$(timestamp "spec/") ; fi
13
+
14
+ while : ; do
15
+ changed_test_files=() ; changed_spec_files=()
16
+
17
+ if [[ -d "test/" ]] ; then
18
+ while read -r line ; do
19
+ if [[ $(timestamp $file) -gt $timestamp ]] ; then
20
+ array_push $changed_test_files $file
21
+ fi
22
+ done < <($(\ls test/**/*_test.rb))
23
+ fi
24
+
25
+ if [[ -d "spec/" ]] ; then
26
+ while read -r line ; do
27
+ if [[ $(timestamp $file) -gt $timestamp ]] ; then
28
+ array_push $changed_spec_files $file
29
+ fi
30
+ done < <($(\ls spec/**/*_spec.rb))
31
+ fi
32
+
33
+ if [[ $(array_length $changed_test_files) -gt 0 ]] ; then
34
+ testrb "${myarray[*]}"
35
+ fi
36
+
37
+ if [[ $(array_length $changed_spec_files) -gt 0 ]] ; then
38
+ spec "${myarray[*]}"
39
+ fi
40
+ done
41
+
@@ -16,6 +16,7 @@ else
16
16
  rvm_path="${rvm_path:-$HOME/.rvm}"
17
17
  fi
18
18
 
19
+ source $rvm_path/scripts/array
19
20
  source $rvm_path/scripts/initialize
20
21
  source $rvm_path/scripts/utility
21
22
  source $rvm_path/scripts/selector
@@ -36,7 +36,7 @@ cp -f "$source_dir/README" "$rvm_path/"
36
36
  # Scripts
37
37
  #
38
38
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
39
- for dir_name in config scripts examples lib ; do
39
+ for dir_name in config scripts examples lib hooks ; do
40
40
  mkdir -p "$rvm_path/$dir_name"
41
41
  cp -Rf "$source_dir/$dir_name" "$rvm_path"
42
42
  done ; unset dir_name
@@ -44,27 +44,31 @@ done ; unset dir_name
44
44
  #
45
45
  # Bin Scripts
46
46
  #
47
- cp -Rf "$source_dir/binscripts" $rvm_path/bin
47
+ cp -Rf "$source_dir/binscripts/" $rvm_path/bin
48
48
  chmod +x $rvm_path/bin/*
49
49
  ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
50
50
 
51
51
  #
52
52
  # RC Files
53
53
  #
54
- for rcfile in $(echo $rvm_rc_files) ; do
55
- if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
56
- if [[ -z "$(awk "/$(echo "$rvm_path/scripts/rvm" | sed 's#/#\\/#g')/" $rcfile)" ]] ; then
57
- echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] && [[ "\$rvm_loaded_flag" -le 0 ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
58
- echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] && [[ "\$rvm_loaded_flag" != "1" ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
59
- else
60
- : # it exists... remove it and append at the end
61
- fi
62
- done
54
+ if [[ "$rvm_loaded_flag" != "1" ]] ; then
55
+ for rcfile in $(echo $rvm_rc_files) ; do
56
+ if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
57
+ if [[ -z "$(awk "/scripts\/rvm/" $rcfile)" ]] ; then
58
+ echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
59
+ echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
60
+ else
61
+ : # it exists... remove it and append at the end
62
+ fi
63
+ done
64
+ fi
63
65
 
64
66
  if [[ "root" = "$(whoami)" ]] ; then
65
67
  ln -nfs $rvm_path/scripts/rvm /usr/local/bin/rvm
66
- chmod +x /usr/local/bin/rvm
68
+ else
69
+ ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
67
70
  fi
71
+ chmod +x $rvm_path/scripts/rvm
68
72
 
69
73
  #
70
74
  # System Checks
@@ -102,7 +106,8 @@ if [[ "Linux" = "$system" ]] ; then
102
106
  echo -e " The SUN java runtime environment and development kit."
103
107
  fi
104
108
  elif [[ "Darwin" = "$system" ]] ; then
105
- echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
109
+ echo -e " $item Be sure that you have XCode Tools (Version 3.2.1 (1613) or later) installed in order to use rvm."
110
+ echo -e " $item You can download the latest XCode tools from developer.apple.com. This will be necessary with the dvd install for Snow Leopard which has bugs."
106
111
  echo -e " $item If you intend on installing MacRuby you must install LLVM first."
107
112
  fi
108
113
 
@@ -114,6 +119,6 @@ echo -e "\n$(tput setaf 2)RTFM:\n $(tput sgr0) http://rvm.beginrescueend.com/
114
119
  echo -e "$(tput setaf 2)w⦿‿⦿t!$(tput sgr0)"
115
120
  echo -e "\n ~ Wayne\n"
116
121
 
117
- $rvm_path/bin/rvm -v
122
+ $cwd/scripts/rvm -v
118
123
 
119
124
  exit 0
@@ -287,6 +287,8 @@ __rvm_use() {
287
287
 
288
288
  if [[ ! -z "$rvm_load_flag" ]] ; then __rvm_gems_load ; fi
289
289
  if [[ ! -z "$rvm_dump_flag" ]] ; then __rvm_gems_dump ; fi
290
+
291
+ __rvm_hook "after_use"
290
292
  }
291
293
 
292
294
  __rvm_ruby_string() {
@@ -36,7 +36,7 @@ cp -f "$source_dir/README" "$rvm_path/"
36
36
  # Scripts
37
37
  #
38
38
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
39
- for dir_name in config scripts examples lib ; do
39
+ for dir_name in config scripts examples lib hooks ; do
40
40
  mkdir -p "$rvm_path/$dir_name"
41
41
  cp -Rf "$source_dir/$dir_name" "$rvm_path"
42
42
  done ; unset dir_name
@@ -44,27 +44,31 @@ done ; unset dir_name
44
44
  #
45
45
  # Bin Scripts
46
46
  #
47
- cp -Rf "$source_dir/binscripts" $rvm_path/bin
47
+ cp -Rf "$source_dir/binscripts/" $rvm_path/bin
48
48
  chmod +x $rvm_path/bin/*
49
49
  ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
50
50
 
51
51
  #
52
52
  # RC Files
53
53
  #
54
- for rcfile in $(echo $rvm_rc_files) ; do
55
- if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
56
- if [[ -z "$(awk "/$(echo "$rvm_path/scripts/rvm" | sed 's#/#\\/#g')/" $rcfile)" ]] ; then
57
- echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] && [[ "\$rvm_loaded_flag" -le 0 ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
58
- echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] && [[ "\$rvm_loaded_flag" != "1" ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
59
- else
60
- : # it exists... remove it and append at the end
61
- fi
62
- done
54
+ if [[ "$rvm_loaded_flag" != "1" ]] ; then
55
+ for rcfile in $(echo $rvm_rc_files) ; do
56
+ if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
57
+ if [[ -z "$(awk "/scripts\/rvm/" $rcfile)" ]] ; then
58
+ echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
59
+ echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
60
+ else
61
+ : # it exists... remove it and append at the end
62
+ fi
63
+ done
64
+ fi
63
65
 
64
66
  if [[ "root" = "$(whoami)" ]] ; then
65
67
  ln -nfs $rvm_path/scripts/rvm /usr/local/bin/rvm
66
- chmod +x /usr/local/bin/rvm
68
+ else
69
+ ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
67
70
  fi
71
+ chmod +x $rvm_path/scripts/rvm
68
72
 
69
73
  #
70
74
  # System Checks
@@ -102,7 +106,8 @@ if [[ "Linux" = "$system" ]] ; then
102
106
  echo -e " The SUN java runtime environment and development kit."
103
107
  fi
104
108
  elif [[ "Darwin" = "$system" ]] ; then
105
- echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
109
+ echo -e " $item Be sure that you have XCode Tools (Version 3.2.1 (1613) or later) installed in order to use rvm."
110
+ echo -e " $item You can download the latest XCode tools from developer.apple.com. This will be necessary with the dvd install for Snow Leopard which has bugs."
106
111
  echo -e " $item If you intend on installing MacRuby you must install LLVM first."
107
112
  fi
108
113
 
@@ -114,6 +119,6 @@ echo -e "\n$(tput setaf 2)RTFM:\n $(tput sgr0) http://rvm.beginrescueend.com/
114
119
  echo -e "$(tput setaf 2)w⦿‿⦿t!$(tput sgr0)"
115
120
  echo -e "\n ~ Wayne\n"
116
121
 
117
- $rvm_path/bin/rvm -v
122
+ $cwd/scripts/rvm -v
118
123
 
119
124
  exit 0
@@ -101,7 +101,7 @@ __rvm_run() {
101
101
  if [[ -z "$rvm_niceness" ]] || [[ "0" = "$rvm_niceness" ]] ; then
102
102
  eval "$command" >> "$rvm_ruby_log_path/$log_file_name.log" 2>> "$rvm_ruby_log_path/$log_file_name.error.log"
103
103
  else
104
- eval "nice -n $rvm_niceness \$($command)" >> $rvm_ruby_log_path/$log_file_name.log 2>> $rvm_ruby_log_path/$log_file_name.error.log
104
+ eval "nice -n $rvm_niceness $command" >> $rvm_ruby_log_path/$log_file_name.log 2>> $rvm_ruby_log_path/$log_file_name.error.log
105
105
  fi
106
106
  if [[ $? -gt 0 ]] ; then $rvm_scripts_path/log "error" "Error running '$command', please check $rvm_ruby_log_path/$log_file_name.error.log" ; __rvm_pushpop ; return 1 ; fi
107
107
  unset log_file command
@@ -260,40 +260,40 @@ __rvm_list() {
260
260
  for version in $(\ls -l $rvm_path/ 2> /dev/null | awk '/ ruby-[1-2].*/ { print $NF }') ; do
261
261
  string=$($rvm_path/$version/bin/ruby -v)
262
262
  if [[ "$version" = "$current_ruby" ]] ; then
263
- echo -e "=> $(tput setaf 2)$version$(tput sgr0): $string"
263
+ echo -e "=> $(tput setaf 2)$version$(tput sgr0) ( ruby -v # => $string) )"
264
264
  selected="1"
265
265
  else
266
- echo -e " $(tput setaf 2)$version$(tput sgr0): $string"
266
+ echo -e " $(tput setaf 2)$version$(tput sgr0) ( ruby -v # => $string) )"
267
267
  fi
268
268
  done ; unset version
269
269
 
270
270
  for version in $(\ls $rvm_path/ 2> /dev/null | awk '/ree-.*/ { print $NF }') ; do
271
271
  string="$($rvm_path/$version/bin/ruby -v | tr "\n" ' ' )"
272
272
  if [[ "$version" = "$current_ruby" ]] ; then
273
- echo -e "=> $(tput setaf 2)$version$(tput sgr0): $string"
273
+ echo -e "=> $(tput setaf 2)$version$(tput sgr0) ( ruby -v # => $string) )"
274
274
  selected="1"
275
275
  else
276
- echo -e " $(tput setaf 2)$version$(tput sgr0): $string"
276
+ echo -e " $(tput setaf 2)$version$(tput sgr0) ( ruby -v # => $string) )"
277
277
  fi
278
278
  done ; unset version
279
279
 
280
280
  for version in $(\ls $rvm_path/ 2> /dev/null | awk '/mput-.*/ { print $NF }') ; do
281
281
  string="$($rvm_path/$version/bin/ruby -v | tr "\n" ' ' )"
282
282
  if [[ "$version" = "$current_ruby" ]] ; then
283
- echo -e "=> $(tput setaf 2)$version$(tput sgr0): $string"
283
+ echo -e "=> $(tput setaf 2)$version$(tput sgr0) ( ruby -v # => $string) )"
284
284
  selected="1"
285
285
  else
286
- echo -e " $(tput setaf 2)$version$(tput sgr0): $string"
286
+ echo -e " $(tput setaf 2)$version$(tput sgr0) ( ruby -v # => $string) )"
287
287
  fi
288
288
  done ; unset version
289
289
 
290
290
  for version in $(\ls $rvm_path/ 2> /dev/null | awk '/jruby-.*/ { print $NF }') ; do
291
291
  string=$($rvm_path/$version/bin/ruby -v)
292
292
  if [[ "$version" = "$current_ruby" ]] ; then
293
- echo -e "=> $(tput setaf 2)$version$(tput sgr0): $string"
293
+ echo -e "=> $(tput setaf 2)$version$(tput sgr0) ( ruby -v # => $string) )"
294
294
  selected="1"
295
295
  else
296
- echo -e " $(tput setaf 2)$version$(tput sgr0): $string"
296
+ echo -e " $(tput setaf 2)$version$(tput sgr0) ( ruby -v # => $string) )"
297
297
  fi
298
298
  done ; unset version
299
299
 
@@ -302,10 +302,10 @@ __rvm_list() {
302
302
  if [[ -f "$rvm_path/$version/bin/ruby" ]] ; then
303
303
  string="$($rvm_path/$version/bin/ruby -v | tr "\n" ' ' )"
304
304
  if [[ "$version" = "$current_ruby" ]] ; then
305
- echo -e "=> $(tput setaf 2)$version$(tput sgr0): $string"
305
+ echo -e "=> $(tput setaf 2)$version$(tput sgr0) ( ruby -v # => $string) )"
306
306
  selected="1"
307
307
  else
308
- echo -e " $(tput setaf 2)$version$(tput sgr0): $string"
308
+ echo -e " $(tput setaf 2)$version$(tput sgr0) ( ruby -v # => $string) )"
309
309
  fi
310
310
  fi
311
311
  done ; unset version
@@ -315,10 +315,10 @@ __rvm_list() {
315
315
  for version in $(\ls $rvm_path/ 2> /dev/null | awk '/macruby-.*/ { print $NF }') ; do
316
316
  string="$($rvm_path/$version/bin/ruby -v | tr "\n" ' ' )"
317
317
  if [[ "$version" = "$current_ruby" ]] ; then
318
- echo -e "=> $(tput setaf 2)$version$(tput sgr0): $string"
318
+ echo -e "=> $(tput setaf 2)$version$(tput sgr0) ( ruby -v # => $string) )"
319
319
  selected="1"
320
320
  else
321
- echo -e " $(tput setaf 2)$version$(tput sgr0): $string"
321
+ echo -e " $(tput setaf 2)$version$(tput sgr0) ( ruby -v # => $string) )"
322
322
  fi
323
323
  done ; unset version
324
324
  fi
@@ -328,10 +328,10 @@ __rvm_list() {
328
328
  if [[ ! -z "$version" ]] ; then
329
329
  string=$($rvm_path/$version/bin/ruby -v)
330
330
  if [[ "$version" = "$current_ruby" ]] ; then
331
- echo -e "=> $(tput setaf 3)(default)$(tput sgr0) $(tput setaf 2)$version$(tput sgr0): $string"
331
+ echo -e "=> $(tput setaf 3)(default)$(tput sgr0) $(tput setaf 2)$version$(tput sgr0) ( ruby -v # => $string) )"
332
332
  selected="1"
333
333
  else
334
- echo -e " $(tput setaf 3)(default)$(tput sgr0) $(tput setaf 2)$version$(tput sgr0): $string"
334
+ echo -e " $(tput setaf 3)(default)$(tput sgr0) $(tput setaf 2)$version$(tput sgr0) ( ruby -v # => $string) )"
335
335
  fi
336
336
  fi ; unset version
337
337
  fi
@@ -339,9 +339,9 @@ __rvm_list() {
339
339
  system_version=$(rvm system ; ruby -v 2> /dev/null)
340
340
  if [[ ! -z "$system_version" ]] ; then
341
341
  if [[ "$($(which ruby) -v)" = "$system_version" ]] ; then
342
- echo -e "=> $(tput setaf 2)system$(tput sgr0): $system_version\n"
342
+ echo -e "=> $(tput setaf 2)system$(tput sgr0) ( ruby -v # => $system_version )\n"
343
343
  else
344
- echo -e " $(tput setaf 2)system$(tput sgr0): $system_version\n"
344
+ echo -e " $(tput setaf 2)system$(tput sgr0) ( ruby -v # => $system_version )\n"
345
345
  fi
346
346
  fi ; unset current_ruby version selected
347
347
  fi
@@ -368,6 +368,7 @@ __rvm_update() {
368
368
  fi
369
369
  if [[ ! -z "$rvm_bin_flag" ]] ; then __rvm_bin_scripts ; fi
370
370
  if [[ ! -z "$rvm_rubygems_flag" ]] ; then __rvm_rubygems_setup ; fi
371
+ __rvm_hook "after_update"
371
372
  }
372
373
 
373
374
  __rvm_update_rvm() {
@@ -491,6 +492,8 @@ __rvm_do() {
491
492
 
492
493
  __rvm_state
493
494
 
495
+ __rvm_hook "after_do"
496
+
494
497
  return ${#errors[*]}
495
498
  }
496
499
 
@@ -749,65 +752,12 @@ __rvm_make_flags() {
749
752
  fi
750
753
  }
751
754
 
752
- __rvm_monitor() {
753
- if [[ -d "test/" ]] ; then test_timestamp=$(timestamp "test/") ; fi
754
- if [[ -d "spec/" ]] ; then spec_timestamp=$(timestamp "spec/") ; fi
755
- while : ; do
756
- changed_test_files=() ; changed_spec_files=()
757
-
758
- if [[ -d "test/" ]] ; then
759
- while read -r line ; do
760
- if [[ $(timestamp $file) -gt $timestamp ]] ; then
761
- array_push $changed_test_files $file
762
- fi
763
- done < <($(\ls test/**/*_test.rb))
764
- fi
765
-
766
- if [[ -d "spec/" ]] ; then
767
- while read -r line ; do
768
- if [[ $(timestamp $file) -gt $timestamp ]] ; then
769
- array_push $changed_spec_files $file
770
- fi
771
- done < <($(\ls spec/**/*_spec.rb))
755
+ __rvm_hook() {
756
+ if [[ ! -z "$1" ]] ; then
757
+ if [[ -s "$rvm_hooks_path/$1" ]] ; then
758
+ if [[ "$rvm_verbose_flag" -eq 1 ]] || [[ "$rvm_debug_flag" -eq 1 ]] ; then $rvm_scripts_path/log "info" "running hook $1" ; fi
759
+ source "$rvm_hooks_path/$1"
772
760
  fi
773
- if [[ $(array_length $changed_test_files) -gt 0 ]] ; then
774
- testrb "${myarray[*]}"
775
- fi
776
- if [[ $(array_length $changed_spec_files) -gt 0 ]] ; then
777
- spec "${myarray[*]}"
778
- fi
779
- done
780
- }
781
-
782
- #
783
- # Actual Utility functions.
784
- #
785
- timestamp() {
786
- if [[ "Darwin" = "$(uname)" ]] ; then
787
- echo $(stat -f "%m" $1)
788
- else
789
- echo $(stat -c "%Y" $1)
790
761
  fi
791
762
  }
792
763
 
793
- # Usage: contains "a_string" "${an_array[@]}"
794
- contains() {
795
- local pattern="$1" ; shift
796
- local index list
797
- list=("$@")
798
- for index in "${!list[@]}" ; do
799
- [[ ${list[index]} = $pattern ]] && { echo $index ; return 0 ; }
800
- done
801
- echo -1 ; return 1
802
- }
803
-
804
- array_length() {
805
- array=$1 ; return "${#array[*]}"
806
- }
807
-
808
- array_push() {
809
- array=$1 ; shift ; item=$2
810
- # TODO: allow loop over more arguments.
811
- eval "index=\$((\${#${array}[*]} + $__array_start))"
812
- eval "${array}[${index}]=${item}"
813
- }
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.81
4
+ version: 0.0.82
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-11-19 00:00:00 -05:00
12
+ date: 2009-11-21 00:00:00 -05:00
13
13
  default_executable: rvm-install
14
14
  dependencies: []
15
15
 
@@ -36,6 +36,7 @@ files:
36
36
  - lib/rvm/version.rb
37
37
  - rvm.gemspec
38
38
  - scripts/aliases
39
+ - scripts/array
39
40
  - scripts/cli
40
41
  - scripts/color
41
42
  - scripts/completion