rvm 0.0.74 → 0.0.75

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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # Hot potato!!! Bash it!
4
- exec "bash -l -c 'cd #{File.dirname(File.dirname(__FILE__))} && ./install #{ARGV.join(' ')} && source ~/.rvm/scripts/rvm'"
4
+ exec "bash -l -c 'cd #{File.dirname(File.dirname(__FILE__))} && ./install #{ARGV.join(' ')}'"
5
5
 
File without changes
File without changes
data/install CHANGED
@@ -1,79 +1,68 @@
1
1
  #!/bin/bash
2
2
 
3
- user="$(whoami)"
4
- if [[ "root" = "$user" ]] ; then
5
- echo -e "$(tput setaf 1) <e> root user support is not yet implemented.$(tput sgr0)"
6
- exit 1
3
+ rc_files="$HOME/.bash_profile $HOME/.bashrc $HOME/.zshrc"
4
+ if [[ "root" = "$(whoami)" ]] ; then
5
+ rvm_path=/usr/local/rvm
6
+ rc_files="$rc_files /etc/profile /etc/zshenv"
7
+ else
8
+ rvm_path=$HOME/.rvm
7
9
  fi
8
10
 
11
+ #
12
+ # Setup
13
+ #
9
14
  item="$(tput setaf 2)* $(tput sgr0)"
10
15
  question="\n$(tput setaf 2)<?>$(tput sgr0)"
11
16
  cwd=$(pwd)
12
17
  source_dir="${source_dir:-"$(dirname $0 | xargs dirname)"}"
13
18
  if [[ ! -d "$source_dir" ]] ; then unset source_dir ; fi
14
19
  source_dir="${source_dir:-$cwd}"
15
- rvm_path=~/.rvm
16
20
 
17
21
  # State what is required to use rvm
18
22
  echo -e "\n$(tput setaf 2)rvm$(tput sgr0)\n\n shell scripts that allows a user to manage multiple ruby versions in their own account."
19
- echo -e "\n Installing rvm to ~/.rvm/ ..."
23
+ echo -e "\n Installing rvm to $rvm_path ..."
20
24
  for dir_name in src scripts bin log archives config gems examples ; do
21
- mkdir -p $rvm_path/$dir_name
25
+ mkdir -p "$rvm_path/$dir_name"
22
26
  done
27
+ cp -f "$source_dir/README" "$rvm_path/"
23
28
 
29
+ #
30
+ # Scripts
31
+ #
24
32
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
25
33
  for dir_name in config scripts examples lib ; do
26
34
  mkdir -p "$rvm_path/$dir_name"
27
35
  cp -Rf "$source_dir/$dir_name" "$rvm_path"
28
36
  done ; unset dir_name
29
37
 
30
- for file_name in rvm-prompt gemsync ; do
31
- mv $rvm_path/scripts/$file_name $rvm_path/bin/
32
- chmod +x $rvm_path/bin/$file_name
33
- done ; unset file_name
34
-
35
- cp -f $source_dir/README $rvm_path/
38
+ #
39
+ # Bin Scripts
40
+ #
41
+ cp -Rf "$source_dir/binscripts" $rvm_path/bin
42
+ chmod +x $rvm_path/bin/*
43
+ ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
36
44
 
45
+ #
46
+ # RC Files
47
+ #
37
48
  if [[ -z "$rvm_loaded_flag" ]] ; then
38
- for rcfile in .bash_profile .bashrc .zshrc ; do
39
- if [[ ! -e ~/$rcfile ]] ; then touch ~/$rcfile ; fi
40
- if [[ -z "$(awk '/\.rvm\/scripts\/rvm/' ~/$rcfile)" ]] ; then
41
- echo "Adding 'if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/$rcfile."
42
- echo -e "\n# rvm-install added line:\nif [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi\n" >> ~/$rcfile
49
+ for rcfile in $(echo $rc_files) ; do
50
+ if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
51
+ if [[ -z "$(awk '/\.rvm\/scripts\/rvm/' $rcfile)" ]] ; then
52
+ echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
53
+ echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
43
54
  fi
44
55
  done
45
56
  fi
46
57
 
47
- echo -e "\n Ensuring that rvm script location in $file is scripts/rvm not bin/rvm for: ~/.bash_profile, ~/.bashrc, ~/.zshrc..."
48
- for file in ~/.bash_profile ~/.bashrc ~/.zshrc ; do
49
- if [[ -s $file ]] ; then
50
- if [[ -L $file ]] ; then # If the file is a symlink,
51
- actual_file="$(readlink $file)" # read the link target so we can preserve it.
52
- else
53
- actual_file="$file"
54
- fi
55
-
56
- grep 'rvm\/bin\/rvm' "$actual_file" > /dev/null
57
- if [[ $? -eq 0 ]] ; then
58
- sed -i.orig 's#rvm/bin/rvm #rvm/scripts/rvm #g' "$actual_file"
59
- rm -f "$actual_file.orig"
60
- fi
61
-
62
- if [[ -f ~/.profile ]] ; then
63
- grep '.profile' "$actual_file" > /dev/null
64
- if [[ $? -gt 0 ]] ; then
65
- profile=~/.profile
66
- echo -e "\nsource ${profile}" >> "$actual_file"
67
- fi
68
- fi
69
- fi
70
- done
71
-
72
- if [[ -f ~/.rvm/bin/rvm ]] ; then
73
- echo -e "\n Removing old rvm file from ~/.rvm/bin/rvm..."
74
- rm -f ~/.rvm/bin/rvm
58
+ if [[ "root" = "$(whoami)" ]] ; then
59
+ ln -nfs $rvm_path/scripts/rvm /usr/local/bin/rvm
60
+ chmod +x /usr/local/bin/rvm
75
61
  fi
76
62
 
63
+ #
64
+ # System Checks
65
+ #
77
66
  system="$(uname)"
78
67
  echo -e "\n $(tput setaf 3)NOTES: $(tput sgr0)\n"
79
68
  if [[ "Linux" = "$system" ]] ; then
@@ -83,28 +72,28 @@ if [[ "Linux" = "$system" ]] ; then
83
72
  rvm_yum_binary="$(which yum 2> /dev/null)"
84
73
 
85
74
  if [[ ! -z "$rvm_apt_get_binary" ]] ; then
86
- echo -e " $item For jRuby (if you wish to use it) you will need:"
87
- echo -e " $ sudo aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
88
- echo -e " $item For ree (if you wish to use it) you will need:"
89
- echo -e " $ sudo aptitude install libreadline5-dev libssl-dev bison"
90
- echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
91
- echo -e " $ sudo aptitude install libxml2-dev"
75
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
76
+ echo -e " $ sudo aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
77
+ echo -e " $item For ree (if you wish to use it) you will need:"
78
+ echo -e " $ sudo aptitude install libreadline5-dev libssl-dev bison"
79
+ echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
80
+ echo -e " $ sudo aptitude install libxml2-dev"
92
81
 
93
82
  elif [[ ! -z "$rvm_emerge_binary" ]] ; then
94
- echo -e " $item For jRuby (if you wish to use it) you will need:"
95
- echo -e " $ sudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
83
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
84
+ echo -e " $ sudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
96
85
 
97
86
  elif [[ ! -z "$rvm_pacman_binary" ]] ; then
98
- echo -e " $item For jRuby (if you wish to use it) you will need:"
99
- echo -e " $ sudo pacman -Sy jdk jre"
87
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
88
+ echo -e " $ sudo pacman -Sy jdk jre"
100
89
 
101
90
  elif [[ ! -z "$rvm_yum_binary" ]] ; then
102
- echo -e " $item For ree (if you wish to use it) you will need:"
103
- echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
91
+ echo -e " $item For ree (if you wish to use it) you will need:"
92
+ echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
104
93
 
105
94
  else
106
- echo -e " $item For jRuby (if you wish to use it) you will need:"
107
- echo -e " The SUN java runtime environment and development kit."
95
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
96
+ echo -e " The SUN java runtime environment and development kit."
108
97
  fi
109
98
  elif [[ "Darwin" = "$system" ]] ; then
110
99
  echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
@@ -112,7 +101,7 @@ elif [[ "Darwin" = "$system" ]] ; then
112
101
  fi
113
102
 
114
103
  echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
115
- echo -e " $item if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi"
104
+ echo -e " $item if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
116
105
  echo -e " $item CLOSE THIS SHELL AND OPEN A NEW ONE in order to use rvm."
117
106
 
118
107
  echo -e "\n \033[0;33mRTFM: $(tput sgr0) http://rvm.beginrescueend.com/ \n"
@@ -123,3 +112,4 @@ source $rvm_path/scripts/rvm
123
112
  rvm -v
124
113
  echo
125
114
 
115
+ exit 0
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 74
4
+ :patch: 75
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.0.74"
8
+ s.version = "0.0.75"
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-03}
12
+ s.date = %q{2009-11-05}
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}
@@ -20,6 +20,8 @@ Gem::Specification.new do |s|
20
20
  s.files = [
21
21
  "LICENCE",
22
22
  "README",
23
+ "binscripts/gemsync",
24
+ "binscripts/rvm-prompt",
23
25
  "config/db",
24
26
  "examples/rvmrc",
25
27
  "install",
@@ -36,14 +38,12 @@ Gem::Specification.new do |s|
36
38
  "scripts/completion",
37
39
  "scripts/functions",
38
40
  "scripts/gems",
39
- "scripts/gemsync",
40
41
  "scripts/install",
41
42
  "scripts/irbrc",
42
43
  "scripts/irbrc.rb",
43
44
  "scripts/ruby-installer",
44
45
  "scripts/rvm",
45
46
  "scripts/rvm-install",
46
- "scripts/rvm-prompt",
47
47
  "scripts/selector",
48
48
  "scripts/update",
49
49
  "scripts/utility"
@@ -1,17 +1,17 @@
1
1
  #!/bin/bash
2
2
 
3
- function __rvm_meta {
3
+ __rvm_meta() {
4
4
  rvm_meta_author="Wayne E. Seguin"
5
5
  rvm_meta_author_email="wayneeseguin@gmail.com"
6
6
  rvm_meta_website="http://rvm.beginrescueend.com/"
7
7
  rvm_meta_version="${rvm_version}"
8
8
  }
9
9
 
10
- function __rvm_version { __rvm_meta ; echo "rvm ${rvm_meta_version} by ${rvm_meta_author} (${rvm_meta_author_email}) [${rvm_meta_website}]" ; }
10
+ __rvm_version() { __rvm_meta ; echo "rvm ${rvm_meta_version} by ${rvm_meta_author} (${rvm_meta_author_email}) [${rvm_meta_website}]" ; }
11
11
 
12
- function __rvm_usage { cat "${rvm_path:-$HOME/.rvm}/README" | ${PAGER:-less} ; }
12
+ __rvm_usage() { cat "${rvm_path:-$HOME/.rvm}/README" | ${PAGER:-less} ; }
13
13
 
14
- function __rvm_parse_args {
14
+ __rvm_parse_args() {
15
15
  if [[ ! -z "$(echo "$*" | awk '/trace/')" ]] ; then echo "$*" ; fi
16
16
 
17
17
  while [[ $# -gt 0 ]] ; do
@@ -170,7 +170,12 @@ function __rvm_parse_args {
170
170
  ;;
171
171
 
172
172
  --ree-options)
173
- rvm_ree_options="$rvm_token"
173
+ if [[ ! -z "$1" ]] ; then
174
+ rvm_ree_options="$(echo $1 | tr ',' ' ')" ; shift
175
+ else
176
+ rvm_action="error"
177
+ rvm_error_message="--ree-options *must* be followed by... well... options."
178
+ fi
174
179
  ;;
175
180
 
176
181
  -t|--tag)
@@ -347,7 +352,7 @@ function __rvm_parse_args {
347
352
  if [[ ! -z "$rvm_error_message" ]] ; then __rvm_pushpop ; return 1 ; fi
348
353
  }
349
354
 
350
- function rvm {
355
+ rvm() {
351
356
 
352
357
  trap '__rvm_cleanup_variables ; rm -rf "/tmp/rvm/$$" >/dev/null 2>&1' 0 1 2 3 15
353
358
 
@@ -156,7 +156,6 @@ function _rvm {
156
156
  usage|help) __rvm_usage ; result=$? ;;
157
157
  bench|benchmark) __rvm_benchmark ; result=$? ;;
158
158
  rubydo|rakedo|gemdo) __rvm_do ; result=$? ;;
159
- reload) source ~/.rvm/scripts/rvm ; result=$? ;;
160
159
 
161
160
  gemsync)
162
161
  result=0
@@ -1,79 +1,68 @@
1
1
  #!/bin/bash
2
2
 
3
- user="$(whoami)"
4
- if [[ "root" = "$user" ]] ; then
5
- echo -e "$(tput setaf 1) <e> root user support is not yet implemented.$(tput sgr0)"
6
- exit 1
3
+ rc_files="$HOME/.bash_profile $HOME/.bashrc $HOME/.zshrc"
4
+ if [[ "root" = "$(whoami)" ]] ; then
5
+ rvm_path=/usr/local/rvm
6
+ rc_files="$rc_files /etc/profile /etc/zshenv"
7
+ else
8
+ rvm_path=$HOME/.rvm
7
9
  fi
8
10
 
11
+ #
12
+ # Setup
13
+ #
9
14
  item="$(tput setaf 2)* $(tput sgr0)"
10
15
  question="\n$(tput setaf 2)<?>$(tput sgr0)"
11
16
  cwd=$(pwd)
12
17
  source_dir="${source_dir:-"$(dirname $0 | xargs dirname)"}"
13
18
  if [[ ! -d "$source_dir" ]] ; then unset source_dir ; fi
14
19
  source_dir="${source_dir:-$cwd}"
15
- rvm_path=~/.rvm
16
20
 
17
21
  # State what is required to use rvm
18
22
  echo -e "\n$(tput setaf 2)rvm$(tput sgr0)\n\n shell scripts that allows a user to manage multiple ruby versions in their own account."
19
- echo -e "\n Installing rvm to ~/.rvm/ ..."
23
+ echo -e "\n Installing rvm to $rvm_path ..."
20
24
  for dir_name in src scripts bin log archives config gems examples ; do
21
- mkdir -p $rvm_path/$dir_name
25
+ mkdir -p "$rvm_path/$dir_name"
22
26
  done
27
+ cp -f "$source_dir/README" "$rvm_path/"
23
28
 
29
+ #
30
+ # Scripts
31
+ #
24
32
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
25
33
  for dir_name in config scripts examples lib ; do
26
34
  mkdir -p "$rvm_path/$dir_name"
27
35
  cp -Rf "$source_dir/$dir_name" "$rvm_path"
28
36
  done ; unset dir_name
29
37
 
30
- for file_name in rvm-prompt gemsync ; do
31
- mv $rvm_path/scripts/$file_name $rvm_path/bin/
32
- chmod +x $rvm_path/bin/$file_name
33
- done ; unset file_name
34
-
35
- cp -f $source_dir/README $rvm_path/
38
+ #
39
+ # Bin Scripts
40
+ #
41
+ cp -Rf "$source_dir/binscripts" $rvm_path/bin
42
+ chmod +x $rvm_path/bin/*
43
+ ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
36
44
 
45
+ #
46
+ # RC Files
47
+ #
37
48
  if [[ -z "$rvm_loaded_flag" ]] ; then
38
- for rcfile in .bash_profile .bashrc .zshrc ; do
39
- if [[ ! -e ~/$rcfile ]] ; then touch ~/$rcfile ; fi
40
- if [[ -z "$(awk '/\.rvm\/scripts\/rvm/' ~/$rcfile)" ]] ; then
41
- echo "Adding 'if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/$rcfile."
42
- echo -e "\n# rvm-install added line:\nif [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi\n" >> ~/$rcfile
49
+ for rcfile in $(echo $rc_files) ; do
50
+ if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
51
+ if [[ -z "$(awk '/\.rvm\/scripts\/rvm/' $rcfile)" ]] ; then
52
+ echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
53
+ echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
43
54
  fi
44
55
  done
45
56
  fi
46
57
 
47
- echo -e "\n Ensuring that rvm script location in $file is scripts/rvm not bin/rvm for: ~/.bash_profile, ~/.bashrc, ~/.zshrc..."
48
- for file in ~/.bash_profile ~/.bashrc ~/.zshrc ; do
49
- if [[ -s $file ]] ; then
50
- if [[ -L $file ]] ; then # If the file is a symlink,
51
- actual_file="$(readlink $file)" # read the link target so we can preserve it.
52
- else
53
- actual_file="$file"
54
- fi
55
-
56
- grep 'rvm\/bin\/rvm' "$actual_file" > /dev/null
57
- if [[ $? -eq 0 ]] ; then
58
- sed -i.orig 's#rvm/bin/rvm #rvm/scripts/rvm #g' "$actual_file"
59
- rm -f "$actual_file.orig"
60
- fi
61
-
62
- if [[ -f ~/.profile ]] ; then
63
- grep '.profile' "$actual_file" > /dev/null
64
- if [[ $? -gt 0 ]] ; then
65
- profile=~/.profile
66
- echo -e "\nsource ${profile}" >> "$actual_file"
67
- fi
68
- fi
69
- fi
70
- done
71
-
72
- if [[ -f ~/.rvm/bin/rvm ]] ; then
73
- echo -e "\n Removing old rvm file from ~/.rvm/bin/rvm..."
74
- rm -f ~/.rvm/bin/rvm
58
+ if [[ "root" = "$(whoami)" ]] ; then
59
+ ln -nfs $rvm_path/scripts/rvm /usr/local/bin/rvm
60
+ chmod +x /usr/local/bin/rvm
75
61
  fi
76
62
 
63
+ #
64
+ # System Checks
65
+ #
77
66
  system="$(uname)"
78
67
  echo -e "\n $(tput setaf 3)NOTES: $(tput sgr0)\n"
79
68
  if [[ "Linux" = "$system" ]] ; then
@@ -83,28 +72,28 @@ if [[ "Linux" = "$system" ]] ; then
83
72
  rvm_yum_binary="$(which yum 2> /dev/null)"
84
73
 
85
74
  if [[ ! -z "$rvm_apt_get_binary" ]] ; then
86
- echo -e " $item For jRuby (if you wish to use it) you will need:"
87
- echo -e " $ sudo aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
88
- echo -e " $item For ree (if you wish to use it) you will need:"
89
- echo -e " $ sudo aptitude install libreadline5-dev libssl-dev bison"
90
- echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
91
- echo -e " $ sudo aptitude install libxml2-dev"
75
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
76
+ echo -e " $ sudo aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
77
+ echo -e " $item For ree (if you wish to use it) you will need:"
78
+ echo -e " $ sudo aptitude install libreadline5-dev libssl-dev bison"
79
+ echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
80
+ echo -e " $ sudo aptitude install libxml2-dev"
92
81
 
93
82
  elif [[ ! -z "$rvm_emerge_binary" ]] ; then
94
- echo -e " $item For jRuby (if you wish to use it) you will need:"
95
- echo -e " $ sudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
83
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
84
+ echo -e " $ sudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
96
85
 
97
86
  elif [[ ! -z "$rvm_pacman_binary" ]] ; then
98
- echo -e " $item For jRuby (if you wish to use it) you will need:"
99
- echo -e " $ sudo pacman -Sy jdk jre"
87
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
88
+ echo -e " $ sudo pacman -Sy jdk jre"
100
89
 
101
90
  elif [[ ! -z "$rvm_yum_binary" ]] ; then
102
- echo -e " $item For ree (if you wish to use it) you will need:"
103
- echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
91
+ echo -e " $item For ree (if you wish to use it) you will need:"
92
+ echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
104
93
 
105
94
  else
106
- echo -e " $item For jRuby (if you wish to use it) you will need:"
107
- echo -e " The SUN java runtime environment and development kit."
95
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
96
+ echo -e " The SUN java runtime environment and development kit."
108
97
  fi
109
98
  elif [[ "Darwin" = "$system" ]] ; then
110
99
  echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
@@ -112,7 +101,7 @@ elif [[ "Darwin" = "$system" ]] ; then
112
101
  fi
113
102
 
114
103
  echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
115
- echo -e " $item if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi"
104
+ echo -e " $item if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
116
105
  echo -e " $item CLOSE THIS SHELL AND OPEN A NEW ONE in order to use rvm."
117
106
 
118
107
  echo -e "\n \033[0;33mRTFM: $(tput sgr0) http://rvm.beginrescueend.com/ \n"
@@ -123,3 +112,4 @@ source $rvm_path/scripts/rvm
123
112
  rvm -v
124
113
  echo
125
114
 
115
+ exit 0
@@ -76,7 +76,7 @@ __rvm_install_source() {
76
76
  cd $rvm_ruby_src_path
77
77
  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
78
78
 
79
- if [[ ! -s "$rvm_ruby_src_path/configure" ]] ; then
79
+ if [[ -z "$rvm_ruby_configure" ]] && [[ ! -s "$rvm_ruby_src_path/configure" ]] ; then
80
80
  rvm_autoconf="$(which autoconf)"
81
81
  if [[ $? -gt 0 ]] ; then __rvm_log "fail" "rvm expects autoconf" ; result=$? ; return $result ; fi
82
82
  __rvm_run "autoconf" "$rvm_autoconf" "Running autoconf"
@@ -126,6 +126,7 @@ __rvm_install_ruby() {
126
126
  macruby)
127
127
  if [[ "Darwin" = "$(uname)" ]] ; then
128
128
  if [[ "$rvm_head_flag" = 1 ]] ; then
129
+ __rvm_install_llvm
129
130
  macruby_path="/usr/local/bin"
130
131
  # TODO: configure & make variables should be set here.
131
132
  rvm_ruby_configure=" true "
@@ -649,3 +650,15 @@ __rvm_actual_file() {
649
650
  fi
650
651
  }
651
652
 
653
+ __rvm_install_llvm() {
654
+ cd "$rvm_src_path"
655
+ if [[ ! -d "$rvm_src_path/llvm/.svn" ]] ; then
656
+ rm -rf "$rvm_src_path/llvm"
657
+ svn co -r 82747 https://llvm.org/svn/llvm-project/llvm/trunk llvm
658
+ cd "$rvm_src_path/llvm"
659
+ ./configure --enable-bindings=none
660
+ UNIVERSAL=1 UNIVERSAL_ARCH="i386 x86_64" ENABLE_OPTIMIZED=1 make -j2
661
+ sudo env UNIVERSAL=1 UNIVERSAL_ARCH="i386 x86_64" ENABLE_OPTIMIZED=1 make install
662
+ fi
663
+ }
664
+
@@ -6,8 +6,17 @@
6
6
  # http://gitub.com/wayneeseguin/rvm
7
7
  #
8
8
 
9
- if [[ -s ~/.rvmrc ]] ; then source ~/.rvmrc ; fi
10
- eval rvm_path="${rvm_path:-~/.rvm}"
9
+ if [[ "root" = "$(whoami)" ]] ; then
10
+ rvm_prefix_path="${rvm_prefix_path:-/usr/local/}"
11
+ else
12
+ rvm_prefix_path="${rvm_prefix_path:-"$HOME/."}"
13
+ fi
14
+
15
+ if [[ "${rvm_prefix_path#${rvm_prefix_path%?}}" = '.' ]] || [[ "${rvm_prefix_path#${rvm_prefix_path%?}}" = '/' ]] ; then
16
+ rvm_path="${rvm_prefix_path}rvm"
17
+ else
18
+ rvm_path="${rvm_prefix_path}/rvm"
19
+ fi
11
20
 
12
21
  source $rvm_path/scripts/color
13
22
  source $rvm_path/scripts/utility
@@ -17,9 +26,13 @@ source $rvm_path/scripts/cli
17
26
  source $rvm_path/scripts/gems
18
27
 
19
28
  rvm_loaded_flag=1 ; export rvm_loaded_flag
29
+
20
30
  rvm_version="$(cat "${rvm_path}/lib/VERSION.yml" | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//')" ; export rvm_version
21
31
 
22
32
  alias rvm-restart="source \"${rvm_path}/scripts/rvm\""
23
33
 
24
- if [[ -f "$rvm_path/default" ]] ; then source $rvm_path/default ; fi
34
+ if [[ -f "$rvm_path/default" ]] ; then source "$rvm_path/default" ; fi
35
+
36
+ # Ok now we determine if we were called or sourced... under assumption of course ;)
37
+ if [[ $# -gt 0 ]] ; then rvm "$*" ; fi
25
38
 
@@ -1,79 +1,68 @@
1
1
  #!/bin/bash
2
2
 
3
- user="$(whoami)"
4
- if [[ "root" = "$user" ]] ; then
5
- echo -e "$(tput setaf 1) <e> root user support is not yet implemented.$(tput sgr0)"
6
- exit 1
3
+ rc_files="$HOME/.bash_profile $HOME/.bashrc $HOME/.zshrc"
4
+ if [[ "root" = "$(whoami)" ]] ; then
5
+ rvm_path=/usr/local/rvm
6
+ rc_files="$rc_files /etc/profile /etc/zshenv"
7
+ else
8
+ rvm_path=$HOME/.rvm
7
9
  fi
8
10
 
11
+ #
12
+ # Setup
13
+ #
9
14
  item="$(tput setaf 2)* $(tput sgr0)"
10
15
  question="\n$(tput setaf 2)<?>$(tput sgr0)"
11
16
  cwd=$(pwd)
12
17
  source_dir="${source_dir:-"$(dirname $0 | xargs dirname)"}"
13
18
  if [[ ! -d "$source_dir" ]] ; then unset source_dir ; fi
14
19
  source_dir="${source_dir:-$cwd}"
15
- rvm_path=~/.rvm
16
20
 
17
21
  # State what is required to use rvm
18
22
  echo -e "\n$(tput setaf 2)rvm$(tput sgr0)\n\n shell scripts that allows a user to manage multiple ruby versions in their own account."
19
- echo -e "\n Installing rvm to ~/.rvm/ ..."
23
+ echo -e "\n Installing rvm to $rvm_path ..."
20
24
  for dir_name in src scripts bin log archives config gems examples ; do
21
- mkdir -p $rvm_path/$dir_name
25
+ mkdir -p "$rvm_path/$dir_name"
22
26
  done
27
+ cp -f "$source_dir/README" "$rvm_path/"
23
28
 
29
+ #
30
+ # Scripts
31
+ #
24
32
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
25
33
  for dir_name in config scripts examples lib ; do
26
34
  mkdir -p "$rvm_path/$dir_name"
27
35
  cp -Rf "$source_dir/$dir_name" "$rvm_path"
28
36
  done ; unset dir_name
29
37
 
30
- for file_name in rvm-prompt gemsync ; do
31
- mv $rvm_path/scripts/$file_name $rvm_path/bin/
32
- chmod +x $rvm_path/bin/$file_name
33
- done ; unset file_name
34
-
35
- cp -f $source_dir/README $rvm_path/
38
+ #
39
+ # Bin Scripts
40
+ #
41
+ cp -Rf "$source_dir/binscripts" $rvm_path/bin
42
+ chmod +x $rvm_path/bin/*
43
+ ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
36
44
 
45
+ #
46
+ # RC Files
47
+ #
37
48
  if [[ -z "$rvm_loaded_flag" ]] ; then
38
- for rcfile in .bash_profile .bashrc .zshrc ; do
39
- if [[ ! -e ~/$rcfile ]] ; then touch ~/$rcfile ; fi
40
- if [[ -z "$(awk '/\.rvm\/scripts\/rvm/' ~/$rcfile)" ]] ; then
41
- echo "Adding 'if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/$rcfile."
42
- echo -e "\n# rvm-install added line:\nif [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi\n" >> ~/$rcfile
49
+ for rcfile in $(echo $rc_files) ; do
50
+ if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
51
+ if [[ -z "$(awk '/\.rvm\/scripts\/rvm/' $rcfile)" ]] ; then
52
+ echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
53
+ echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
43
54
  fi
44
55
  done
45
56
  fi
46
57
 
47
- echo -e "\n Ensuring that rvm script location in $file is scripts/rvm not bin/rvm for: ~/.bash_profile, ~/.bashrc, ~/.zshrc..."
48
- for file in ~/.bash_profile ~/.bashrc ~/.zshrc ; do
49
- if [[ -s $file ]] ; then
50
- if [[ -L $file ]] ; then # If the file is a symlink,
51
- actual_file="$(readlink $file)" # read the link target so we can preserve it.
52
- else
53
- actual_file="$file"
54
- fi
55
-
56
- grep 'rvm\/bin\/rvm' "$actual_file" > /dev/null
57
- if [[ $? -eq 0 ]] ; then
58
- sed -i.orig 's#rvm/bin/rvm #rvm/scripts/rvm #g' "$actual_file"
59
- rm -f "$actual_file.orig"
60
- fi
61
-
62
- if [[ -f ~/.profile ]] ; then
63
- grep '.profile' "$actual_file" > /dev/null
64
- if [[ $? -gt 0 ]] ; then
65
- profile=~/.profile
66
- echo -e "\nsource ${profile}" >> "$actual_file"
67
- fi
68
- fi
69
- fi
70
- done
71
-
72
- if [[ -f ~/.rvm/bin/rvm ]] ; then
73
- echo -e "\n Removing old rvm file from ~/.rvm/bin/rvm..."
74
- rm -f ~/.rvm/bin/rvm
58
+ if [[ "root" = "$(whoami)" ]] ; then
59
+ ln -nfs $rvm_path/scripts/rvm /usr/local/bin/rvm
60
+ chmod +x /usr/local/bin/rvm
75
61
  fi
76
62
 
63
+ #
64
+ # System Checks
65
+ #
77
66
  system="$(uname)"
78
67
  echo -e "\n $(tput setaf 3)NOTES: $(tput sgr0)\n"
79
68
  if [[ "Linux" = "$system" ]] ; then
@@ -83,28 +72,28 @@ if [[ "Linux" = "$system" ]] ; then
83
72
  rvm_yum_binary="$(which yum 2> /dev/null)"
84
73
 
85
74
  if [[ ! -z "$rvm_apt_get_binary" ]] ; then
86
- echo -e " $item For jRuby (if you wish to use it) you will need:"
87
- echo -e " $ sudo aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
88
- echo -e " $item For ree (if you wish to use it) you will need:"
89
- echo -e " $ sudo aptitude install libreadline5-dev libssl-dev bison"
90
- echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
91
- echo -e " $ sudo aptitude install libxml2-dev"
75
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
76
+ echo -e " $ sudo aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
77
+ echo -e " $item For ree (if you wish to use it) you will need:"
78
+ echo -e " $ sudo aptitude install libreadline5-dev libssl-dev bison"
79
+ echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
80
+ echo -e " $ sudo aptitude install libxml2-dev"
92
81
 
93
82
  elif [[ ! -z "$rvm_emerge_binary" ]] ; then
94
- echo -e " $item For jRuby (if you wish to use it) you will need:"
95
- echo -e " $ sudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
83
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
84
+ echo -e " $ sudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
96
85
 
97
86
  elif [[ ! -z "$rvm_pacman_binary" ]] ; then
98
- echo -e " $item For jRuby (if you wish to use it) you will need:"
99
- echo -e " $ sudo pacman -Sy jdk jre"
87
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
88
+ echo -e " $ sudo pacman -Sy jdk jre"
100
89
 
101
90
  elif [[ ! -z "$rvm_yum_binary" ]] ; then
102
- echo -e " $item For ree (if you wish to use it) you will need:"
103
- echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
91
+ echo -e " $item For ree (if you wish to use it) you will need:"
92
+ echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
104
93
 
105
94
  else
106
- echo -e " $item For jRuby (if you wish to use it) you will need:"
107
- echo -e " The SUN java runtime environment and development kit."
95
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
96
+ echo -e " The SUN java runtime environment and development kit."
108
97
  fi
109
98
  elif [[ "Darwin" = "$system" ]] ; then
110
99
  echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
@@ -112,7 +101,7 @@ elif [[ "Darwin" = "$system" ]] ; then
112
101
  fi
113
102
 
114
103
  echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
115
- echo -e " $item if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi"
104
+ echo -e " $item if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
116
105
  echo -e " $item CLOSE THIS SHELL AND OPEN A NEW ONE in order to use rvm."
117
106
 
118
107
  echo -e "\n \033[0;33mRTFM: $(tput sgr0) http://rvm.beginrescueend.com/ \n"
@@ -123,3 +112,4 @@ source $rvm_path/scripts/rvm
123
112
  rvm -v
124
113
  echo
125
114
 
115
+ exit 0
@@ -192,6 +192,12 @@ __rvm_use() {
192
192
  fi
193
193
  fi
194
194
 
195
+ if [[ "root" = "$(whoami)" ]] ; then
196
+ for binary in erb gem irb rake rdoc ri ruby testrb ; do
197
+ rm -f /usr/local/bin/$binary
198
+ done
199
+ fi
200
+
195
201
  else
196
202
  GEM_HOME=$rvm_ruby_gem_home ; export GEM_HOME
197
203
  GEM_PATH=$rvm_ruby_gem_home ; export GEM_PATH
@@ -213,6 +219,12 @@ __rvm_use() {
213
219
  PATH=$rvm_bin_path:$PATH ; export PATH
214
220
  PATH=$MY_RUBY_HOME/bin:$GEM_HOME/bin:$rvm_path/bin:$PATH ; export PATH
215
221
 
222
+ if [[ "root" = "$(whoami)" ]] ; then
223
+ for binary in erb gem irb rake rdoc ri ruby testrb ; do
224
+ rm -f /usr/local/bin/$binary
225
+ ln -nfs $rvm_ruby_home/bin/$binary /usr/local/bin/$binary
226
+ done
227
+ fi
216
228
  fi
217
229
 
218
230
  if [[ ! -z "$rvm_default_flag" ]] && [[ "default" != "$rvm_ruby_interpreter" ]] ; then
@@ -1,79 +1,68 @@
1
1
  #!/bin/bash
2
2
 
3
- user="$(whoami)"
4
- if [[ "root" = "$user" ]] ; then
5
- echo -e "$(tput setaf 1) <e> root user support is not yet implemented.$(tput sgr0)"
6
- exit 1
3
+ rc_files="$HOME/.bash_profile $HOME/.bashrc $HOME/.zshrc"
4
+ if [[ "root" = "$(whoami)" ]] ; then
5
+ rvm_path=/usr/local/rvm
6
+ rc_files="$rc_files /etc/profile /etc/zshenv"
7
+ else
8
+ rvm_path=$HOME/.rvm
7
9
  fi
8
10
 
11
+ #
12
+ # Setup
13
+ #
9
14
  item="$(tput setaf 2)* $(tput sgr0)"
10
15
  question="\n$(tput setaf 2)<?>$(tput sgr0)"
11
16
  cwd=$(pwd)
12
17
  source_dir="${source_dir:-"$(dirname $0 | xargs dirname)"}"
13
18
  if [[ ! -d "$source_dir" ]] ; then unset source_dir ; fi
14
19
  source_dir="${source_dir:-$cwd}"
15
- rvm_path=~/.rvm
16
20
 
17
21
  # State what is required to use rvm
18
22
  echo -e "\n$(tput setaf 2)rvm$(tput sgr0)\n\n shell scripts that allows a user to manage multiple ruby versions in their own account."
19
- echo -e "\n Installing rvm to ~/.rvm/ ..."
23
+ echo -e "\n Installing rvm to $rvm_path ..."
20
24
  for dir_name in src scripts bin log archives config gems examples ; do
21
- mkdir -p $rvm_path/$dir_name
25
+ mkdir -p "$rvm_path/$dir_name"
22
26
  done
27
+ cp -f "$source_dir/README" "$rvm_path/"
23
28
 
29
+ #
30
+ # Scripts
31
+ #
24
32
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
25
33
  for dir_name in config scripts examples lib ; do
26
34
  mkdir -p "$rvm_path/$dir_name"
27
35
  cp -Rf "$source_dir/$dir_name" "$rvm_path"
28
36
  done ; unset dir_name
29
37
 
30
- for file_name in rvm-prompt gemsync ; do
31
- mv $rvm_path/scripts/$file_name $rvm_path/bin/
32
- chmod +x $rvm_path/bin/$file_name
33
- done ; unset file_name
34
-
35
- cp -f $source_dir/README $rvm_path/
38
+ #
39
+ # Bin Scripts
40
+ #
41
+ cp -Rf "$source_dir/binscripts" $rvm_path/bin
42
+ chmod +x $rvm_path/bin/*
43
+ ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
36
44
 
45
+ #
46
+ # RC Files
47
+ #
37
48
  if [[ -z "$rvm_loaded_flag" ]] ; then
38
- for rcfile in .bash_profile .bashrc .zshrc ; do
39
- if [[ ! -e ~/$rcfile ]] ; then touch ~/$rcfile ; fi
40
- if [[ -z "$(awk '/\.rvm\/scripts\/rvm/' ~/$rcfile)" ]] ; then
41
- echo "Adding 'if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/$rcfile."
42
- echo -e "\n# rvm-install added line:\nif [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi\n" >> ~/$rcfile
49
+ for rcfile in $(echo $rc_files) ; do
50
+ if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
51
+ if [[ -z "$(awk '/\.rvm\/scripts\/rvm/' $rcfile)" ]] ; then
52
+ echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
53
+ echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
43
54
  fi
44
55
  done
45
56
  fi
46
57
 
47
- echo -e "\n Ensuring that rvm script location in $file is scripts/rvm not bin/rvm for: ~/.bash_profile, ~/.bashrc, ~/.zshrc..."
48
- for file in ~/.bash_profile ~/.bashrc ~/.zshrc ; do
49
- if [[ -s $file ]] ; then
50
- if [[ -L $file ]] ; then # If the file is a symlink,
51
- actual_file="$(readlink $file)" # read the link target so we can preserve it.
52
- else
53
- actual_file="$file"
54
- fi
55
-
56
- grep 'rvm\/bin\/rvm' "$actual_file" > /dev/null
57
- if [[ $? -eq 0 ]] ; then
58
- sed -i.orig 's#rvm/bin/rvm #rvm/scripts/rvm #g' "$actual_file"
59
- rm -f "$actual_file.orig"
60
- fi
61
-
62
- if [[ -f ~/.profile ]] ; then
63
- grep '.profile' "$actual_file" > /dev/null
64
- if [[ $? -gt 0 ]] ; then
65
- profile=~/.profile
66
- echo -e "\nsource ${profile}" >> "$actual_file"
67
- fi
68
- fi
69
- fi
70
- done
71
-
72
- if [[ -f ~/.rvm/bin/rvm ]] ; then
73
- echo -e "\n Removing old rvm file from ~/.rvm/bin/rvm..."
74
- rm -f ~/.rvm/bin/rvm
58
+ if [[ "root" = "$(whoami)" ]] ; then
59
+ ln -nfs $rvm_path/scripts/rvm /usr/local/bin/rvm
60
+ chmod +x /usr/local/bin/rvm
75
61
  fi
76
62
 
63
+ #
64
+ # System Checks
65
+ #
77
66
  system="$(uname)"
78
67
  echo -e "\n $(tput setaf 3)NOTES: $(tput sgr0)\n"
79
68
  if [[ "Linux" = "$system" ]] ; then
@@ -83,28 +72,28 @@ if [[ "Linux" = "$system" ]] ; then
83
72
  rvm_yum_binary="$(which yum 2> /dev/null)"
84
73
 
85
74
  if [[ ! -z "$rvm_apt_get_binary" ]] ; then
86
- echo -e " $item For jRuby (if you wish to use it) you will need:"
87
- echo -e " $ sudo aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
88
- echo -e " $item For ree (if you wish to use it) you will need:"
89
- echo -e " $ sudo aptitude install libreadline5-dev libssl-dev bison"
90
- echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
91
- echo -e " $ sudo aptitude install libxml2-dev"
75
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
76
+ echo -e " $ sudo aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
77
+ echo -e " $item For ree (if you wish to use it) you will need:"
78
+ echo -e " $ sudo aptitude install libreadline5-dev libssl-dev bison"
79
+ echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
80
+ echo -e " $ sudo aptitude install libxml2-dev"
92
81
 
93
82
  elif [[ ! -z "$rvm_emerge_binary" ]] ; then
94
- echo -e " $item For jRuby (if you wish to use it) you will need:"
95
- echo -e " $ sudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
83
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
84
+ echo -e " $ sudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
96
85
 
97
86
  elif [[ ! -z "$rvm_pacman_binary" ]] ; then
98
- echo -e " $item For jRuby (if you wish to use it) you will need:"
99
- echo -e " $ sudo pacman -Sy jdk jre"
87
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
88
+ echo -e " $ sudo pacman -Sy jdk jre"
100
89
 
101
90
  elif [[ ! -z "$rvm_yum_binary" ]] ; then
102
- echo -e " $item For ree (if you wish to use it) you will need:"
103
- echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
91
+ echo -e " $item For ree (if you wish to use it) you will need:"
92
+ echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
104
93
 
105
94
  else
106
- echo -e " $item For jRuby (if you wish to use it) you will need:"
107
- echo -e " The SUN java runtime environment and development kit."
95
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
96
+ echo -e " The SUN java runtime environment and development kit."
108
97
  fi
109
98
  elif [[ "Darwin" = "$system" ]] ; then
110
99
  echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
@@ -112,7 +101,7 @@ elif [[ "Darwin" = "$system" ]] ; then
112
101
  fi
113
102
 
114
103
  echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
115
- echo -e " $item if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi"
104
+ echo -e " $item if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
116
105
  echo -e " $item CLOSE THIS SHELL AND OPEN A NEW ONE in order to use rvm."
117
106
 
118
107
  echo -e "\n \033[0;33mRTFM: $(tput sgr0) http://rvm.beginrescueend.com/ \n"
@@ -123,3 +112,4 @@ source $rvm_path/scripts/rvm
123
112
  rvm -v
124
113
  echo
125
114
 
115
+ exit 0
@@ -47,13 +47,19 @@ __rvm_debug() {
47
47
  __rvm_log "debug" "/Developer/SDKs/*:$(basename -a /Developer/SDKs/* | tr "\n" ',')"
48
48
  fi
49
49
 
50
- for file_name in ~/.bash_profile ~/.bashrc ~/.zshrc ; do
50
+ for file_name in $(echo $rc_files) ; do
51
51
  if [[ -s "$file_name" ]] ; then
52
52
  __rvm_log "debug" "$file_name:\n$(grep 'rvm' $file_name)"
53
53
  fi
54
54
  done
55
55
 
56
- for file_name in $rvm_path/default $rvm_path/system $rvm_path/config/db ~/.rvmrc ~/.gemrc; do
56
+ if [[ "root" = "$(whoami)" ]] ; then
57
+ debug_files="$rvm_path/default $rvm_path/system $rvm_path/config/db /etc/rvmrc /etc/gemrc"
58
+ else
59
+ debug_files="$rvm_path/default $rvm_path/system $rvm_path/config/db $HOME/.rvmrc $HOME/.gemrc"
60
+ fi
61
+
62
+ for file_name in $(echo $debug_files); do
57
63
  if [[ -f "$file_name" ]] && [[ -s "$file_name" ]] ; then
58
64
  __rvm_log "debug" "$file_name (filtered):\n$(cat $file_name | awk '!/assword|_key/')\n"
59
65
  fi
@@ -131,9 +137,9 @@ __rvm_unset_ruby_variables() {
131
137
  unset rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_ruby_binary rvm_ruby_home rvm_ruby_log_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string rvm_ruby_string rvm_ruby_src_path rvm_ruby_repo_url rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_head_flag rvm_ruby_configure_flags rvm_ruby_configure
132
138
  }
133
139
 
134
- # TODO: root user loadng of /etc/rvmrc
135
140
  __rvm_load_rvmrc() {
136
- if [[ -s ~/.rvmrc ]] ; then source ~/.rvmrc ; fi
141
+ if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
142
+ if [[ -f $HOME/.rvmrc ]] ; then source $HOME/.rvmrc ; fi
137
143
  }
138
144
 
139
145
  __rvm_bin_scripts() {
@@ -325,7 +331,7 @@ __rvm_gemdup() {
325
331
  if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select $* ; fi
326
332
  __rvm_log "debug" "$rvm_ruby_interpreter"
327
333
  if [[ "default" = "$rvm_ruby_interpreter" ]] ; then
328
- # TODO: ~/.rvm/default first, then system user
334
+ # TODO: $rvm_path/default first, then system user
329
335
  rvm_source_gem_path="$rvm_system_user_gem_path"
330
336
  elif [[ "user" = "$rvm_ruby_interpreter" ]] ; then
331
337
  rvm_source_gem_path="$rvm_system_user_gem_path"
@@ -466,7 +472,7 @@ __rvm_list() {
466
472
  fi
467
473
 
468
474
  if [[ -f "$rvm_path/default" ]] && [[ -s $rvm_path/default ]] ; then
469
- version=$(grep '^MY_RUBY_HOME' ~/.rvm/default | awk -F"'" '{print $2}' | xargs basename)
475
+ version=$(grep '^MY_RUBY_HOME' $rvm_path/default | awk -F"'" '{print $2}' | xargs basename)
470
476
  if [[ ! -z "$version" ]] ; then
471
477
  echo -e "\ndefault:\n"
472
478
  string=$($rvm_path/$version/bin/ruby -v)
@@ -492,25 +498,21 @@ __rvm_list() {
492
498
  }
493
499
 
494
500
  __rvm_initialize() {
495
- rvm_fetch=$(which curl)
496
- if [[ $? -ne 0 ]] ; then
497
- __rvm_log "fail" "rvm requires curl, which does not seem to exist in your path :("
498
- else
499
- rvm_fetch="$rvm_fetch -O -L --create-dirs -C - " # -s for silent
500
- fi
501
-
502
501
  # TODO: Sanitize user input, ensure that there is a / a the end...
503
502
  if [[ "root" = "$(whoami)" ]] ; then
504
- __rvm_log "fail" "root user support is not yet implemented."
505
503
  rvm_prefix_path="${rvm_prefix_path:-/usr/local/}"
504
+ rc_files="/etc/profile /etc/zshenv"
506
505
  else
507
506
  rvm_prefix_path="${rvm_prefix_path:-"$HOME/."}"
507
+ rc_files="$HOME/.bash_profile $HOME/.bashrc $HOME/.zshrc"
508
508
  fi
509
+
509
510
  if [[ "${rvm_prefix_path#${rvm_prefix_path%?}}" = '.' ]] || [[ "${rvm_prefix_path#${rvm_prefix_path%?}}" = '/' ]] ; then
510
511
  rvm_path="${rvm_prefix_path}rvm"
511
512
  else
512
513
  rvm_path="${rvm_prefix_path}/rvm"
513
514
  fi
515
+
514
516
  rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
515
517
  rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
516
518
  rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
@@ -528,6 +530,14 @@ __rvm_initialize() {
528
530
  rvm_ruby_require=""
529
531
 
530
532
  __rvm_clean_path
533
+
534
+ rvm_fetch=$(which curl)
535
+ if [[ $? -ne 0 ]] ; then
536
+ __rvm_log "fail" "rvm requires curl, which does not seem to exist in your path :("
537
+ else
538
+ rvm_fetch="$rvm_fetch -O -L --create-dirs -C - " # -s for silent
539
+ fi
540
+
531
541
  rvm_result=$(echo $PATH | grep 'rvm\/bin:')
532
542
  if [[ -z "$rvm_result" ]] ; then
533
543
  PATH=$rvm_bin_path:$PATH ; export PATH
@@ -556,7 +566,7 @@ __rvm_update_rvm() {
556
566
  fi
557
567
  else
558
568
  # TODO: rvm_install_path:
559
- gem install rvm --no-rdoc --no-ri -q rvm && $(gem env gemdir user)/bin/rvm-install && source ~/.rvm/scripts/rvm
569
+ gem install rvm --no-rdoc --no-ri -q rvm && $(gem env gemdir user)/bin/rvm-install && source $rvm_path/scripts/rvm
560
570
  fi
561
571
  __rvm_pushpop
562
572
  }
@@ -565,25 +575,16 @@ __rvm_reboot() {
565
575
  __rvm_log "warn" "Do you wish to reset rvm? ('yes', or 'no')"
566
576
  read response
567
577
  if [[ "yes" = "$response" ]] ; then
568
- cd
578
+ cd $rvm_path
569
579
  __rvm_reset
570
- mv ~/.rvm/archives ~/.archives
580
+ mv $rvm_path/archives ~/.archives
571
581
  if [[ "/" = "$rvm_path" ]] ; then
572
582
  __rvm_log "error" "remove '/' ?!... NO!"
573
583
  else
574
584
  if [[ -d "$rvm_path" ]] ; then rm -rf "$rvm_path/" ; fi
575
585
  fi
576
586
  gem install rvm --no-rdoc --no-ri -q
577
- which rvm-install 2> /dev/null
578
- if [[ $? -gt 0 ]] ; then
579
- if [[ -x "~/.gem/ruby/1.8/bin/rvm-install" ]] ; then
580
- ~/.gem/ruby/1.8/bin/rvm-install
581
- else
582
- __rvm_log "error" "Could not find an executable rvm-install in your path :("
583
- fi
584
- else
585
- rvm-install
586
- fi
587
+ __rvm_update_rvm
587
588
  source ~/.rvm/scripts/rvm
588
589
  else
589
590
  __rvm_log "info" "Carry on then..."
@@ -605,6 +606,8 @@ __rvm_ruby_do() {
605
606
  fi
606
607
  fi
607
608
  rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_require -I$load_path $rvm_ruby_args"
609
+ elif [[ "gem" = "$binary" ]] && match "$rvm_ruby_args" 'install' ; then
610
+ rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_args --no-rdoc --no-ri"
608
611
  else
609
612
  rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_args"
610
613
  fi
@@ -875,7 +878,7 @@ __rvm_make_flags() {
875
878
  fi
876
879
 
877
880
  if [[ "-arch x86_64" = "$rvm_archflags" ]] ; then
878
- rvm_ruby_configure_flags="${rvm_ruby_configure_flags} --build=x86_64-apple-darwin$(uname -r) --host=x86_64-apple-darwin$(uname -r)"
881
+ rvm_ruby_configure_flags="${rvm_ruby_configure_flags} --build=i686-apple-darwin$(uname -r) --host=i686-apple-darwin$(uname -r)"
879
882
  elif [[ "-arch i386" = "$rvm_archflags" ]] ; then
880
883
  rvm_ruby_configure_flags="${rvm_ruby_configure_flags} --build=i386-apple-darwin$(uname -r) --host=i386-apple-darwin$(uname -r)"
881
884
  fi
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.74
4
+ version: 0.0.75
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-03 00:00:00 -05:00
12
+ date: 2009-11-05 00:00:00 -05:00
13
13
  default_executable: rvm-install
14
14
  dependencies: []
15
15
 
@@ -24,6 +24,8 @@ extra_rdoc_files:
24
24
  files:
25
25
  - LICENCE
26
26
  - README
27
+ - binscripts/gemsync
28
+ - binscripts/rvm-prompt
27
29
  - config/db
28
30
  - examples/rvmrc
29
31
  - install
@@ -40,14 +42,12 @@ files:
40
42
  - scripts/completion
41
43
  - scripts/functions
42
44
  - scripts/gems
43
- - scripts/gemsync
44
45
  - scripts/install
45
46
  - scripts/irbrc
46
47
  - scripts/irbrc.rb
47
48
  - scripts/ruby-installer
48
49
  - scripts/rvm
49
50
  - scripts/rvm-install
50
- - scripts/rvm-prompt
51
51
  - scripts/selector
52
52
  - scripts/update
53
53
  - scripts/utility