wayneeseguin-rvm 0.0.35 → 0.0.36

Sign up to get free protection for your applications and to get access to all the features.
data/config/db CHANGED
@@ -12,7 +12,6 @@ ree_interpreter=ruby-enterprise
12
12
  ree_version=1.8.6
13
13
  ree_patch_level=20090610
14
14
  macruby_version=2009-09-04
15
- ruby_version=1.8.6
16
15
  ruby_1.9.1_patch_level=p243
17
16
  ruby_1.9.2_patch_level=preview1
18
17
  ruby_1.8.5_patch_level=p115
data/scripts/rvm-cli CHANGED
@@ -49,8 +49,9 @@ function __rvm_parse-args {
49
49
  fi
50
50
  ;;
51
51
 
52
- do|rubydo)
52
+ do|rubydo|rakedo|gemdo)
53
53
  rvm_action=$rvm_token
54
+ if [ "$rvm_action" = "do" ] ; then rvm_action="do" ; fi
54
55
  temp=$(echo $1 | awk '{print substr($1, 0, 1)}')
55
56
  if [ "$temp" != "-" ] ; then
56
57
  if [ ! -z "$(echo $temp | grep '[0-9]')" ] ; then
@@ -116,6 +117,10 @@ function __rvm_parse-args {
116
117
  -l|--level) rvm_ruby_patch_level="$1" ; shift ;;
117
118
  -n|--nice) rvm_niceness="$1" ; shift ;;
118
119
  -f|--file) rvm_ruby_args="$1" ; shift ;;
120
+ -e|--execute)
121
+ rvm_ruby_args="$@"
122
+ rvm_parse_break=1
123
+ ;;
119
124
  -h|--help) rvm_action=help ; shift ;;
120
125
  -d|--default) rvm_set_default=1 ;;
121
126
  --head) rvm_ruby_rev="head" ;;
@@ -132,11 +137,11 @@ function __rvm_parse-args {
132
137
  rvm_ruby_interpreter="system"
133
138
  ;;
134
139
  *)
135
- rvm_action="error"
136
- rvm_error_message="Unrecognized command line argument(s): '$rvm_token $*'"
137
- break;
140
+ rvm_action="error"
141
+ rvm_error_message="Unrecognized command line argument(s): '$rvm_token $@'"
142
+ break;
138
143
  esac
139
- if [ ! -z "$rvm_ruby_args" -o ! -z "$rvm_error_message" ] ; then break; fi
144
+ if [ ! -z "$rvm_parse_break" -o ! -z "$rvm_error_message" ] ; then unset rvm_parse_break; break; fi
140
145
  done
141
146
 
142
147
  if [ ! -z "$rvm_error_message" ] ; then popd 2> /dev/null ; return 1 ; fi
@@ -150,7 +155,7 @@ function rvm {
150
155
  __rvm_load-rvmrc
151
156
  __rvm_initialize
152
157
  __rvm_load-defaults
153
- __rvm_parse-args $*
158
+ __rvm_parse-args $@
154
159
 
155
160
  case "$rvm_action" in
156
161
  install) __rvm_install-ruby $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level ;;
@@ -162,7 +167,7 @@ function rvm {
162
167
  gemdup) __rvm_gem-dup $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level ;;
163
168
  symlinks) __rvm_symlinks ;;
164
169
  version) __rvm_version ;;
165
- rubydo)
170
+ rubydo|rakedo|gemdo)
166
171
  if [ ! -z "$rvm_ruby_version" ] ; then
167
172
  rvm_ruby_versions=$(echo $rvm_ruby_version | tr ',' ' ')
168
173
  for rvm_ruby_version in $rvm_ruby_versions ; do
@@ -175,14 +180,14 @@ function rvm {
175
180
  fi
176
181
  unset temp
177
182
  __rvm_select $rvm_ruby_interpreter $rvm_ruby_version
178
-
179
- rvm_command="$rvm_ruby_binary $rvm_ruby_args"
180
- echo "$(basename $rvm_ruby_binary):"
183
+ binary=`echo $rvm_action | sed 's/do$//'`
184
+ rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_args"
185
+ echo "$(basename $rvm_ruby_home/bin/$binary):"
181
186
  eval $rvm_command
182
187
  unset rvm_ruby_interpreter rvm_ruby_patch_level rvm_ruby_version rvm_ruby_package_name rvm_ruby_home rvm_ruby_irbrc rvm_ruby_binary
183
188
  done
184
189
  else # all
185
- rvm_ruby_versions=`/bin/ls $rvm_install_path/bin/ruby-*`
190
+ rvm_ruby_versions=`/bin/ls $rvm_bin_path/ruby-*`
186
191
  for rvm_ruby_binary in $rvm_ruby_versions ; do
187
192
  if [ -x $rvm_ruby_binary ] ; then
188
193
  rvm_command="$rvm_ruby_binary $rvm_ruby_args"
@@ -199,14 +204,13 @@ function rvm {
199
204
  update)
200
205
  if [ "$rvm_ruby_rev" = "head" ] ; then
201
206
  if [ -d $rvm_source_path/rvm/.git ] ; then
202
- cd $rvm_source_path/rvm/ && git pull origin master
207
+ cd $rvm_source_path/rvm/ && git pull origin master && ./scripts/rvm-install
203
208
  else
204
- cd $rvm_source_path && git clone git://github.com/wayneeseguin/rvm.git && cd rvm/
209
+ cd $rvm_source_path && git clone git://github.com/wayneeseguin/rvm.git && cd rvm/ && ./scripts/rvm-install
205
210
  fi
206
- ./scripts/rvm-update
207
211
  else
208
212
  # TODO: rvm_install_path:
209
- gem install rvm --no-rdoc --no-ri -q && rvm-update && source ~/.rvm/scripts/rvm
213
+ gem install rvm --no-rdoc --no-ri -q && rvm-install && source ~/.rvm/scripts/rvm
210
214
  fi
211
215
  ;;
212
216
  error) __rvm_log "fail" "$rvm_error_message ( see: rvm usage )" ; popd 2> /dev/null ; return 1; ;;
data/scripts/rvm-install CHANGED
@@ -15,86 +15,134 @@ source_dir="${source_dir:-$cwd}"
15
15
  rvm_dir=~/.rvm
16
16
 
17
17
  echo -e "Installing rvm source to ~/.rvm/scripts/rvm..."
18
- mkdir -p $rvm_dir
19
-
20
18
  for dir in src scripts bin log archives config gems examples ; do
21
19
  mkdir -p $rvm_dir/$dir
22
20
  done
23
21
 
24
- for file in ~/.bash_profile ~/.bashrc ~/.zshrc ; do
25
- if [ -s $file ] ; then
26
- echo -e "\n\033[0;32m<i>\033[0m Ensuring that rvm script location in $file is scripts/rvm not bin/rvm"
27
- actual_file=$(file ~/.zshrc | awk '{print $5}')
28
- sed -i.orig 's/rvm\/bin\/rvm/rvm\/scripts\/rvm/g' $actual_file
29
- fi
30
- done
31
-
32
- for dir in config scripts examples ; do
33
- mkdir -p $rvm_dir/$dir
34
- for file in `/bin/ls $source_dir/$dir/`; do
35
- cp $source_dir/$dir/$file $rvm_dir/$dir/$file
36
- done
37
- done
38
-
39
22
  # State what is required to use rvm
40
23
  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."
41
24
  echo -e "$info In order to use rvm the following line must occur in your shell's loading files:"
42
25
  echo -e "\n\033[0;32m (a)\033[0m if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi"
43
26
 
44
- while : ; do
45
- echo -n -e "$question Do you want this (s)cript to set this up for you, or do it (m)anually yourself ('s' or 'm')? "
46
- read response
47
- if [ "${response:0:1}" = "s" ] ; then
48
- echo 'w00t!'
49
- break
50
- elif [ "${response:0:1}" = "m" ] ; then
51
- echo -e "$info Please make sure that this line is in place."
52
- break
53
- fi
54
- done
55
-
56
- if [ "${response:0:1}" = "s" ] ; then
57
-
27
+ results=$(grep 'scripts/rvm' ~/.bash_profile ~/.bashrc ~/.zshrc > /dev/null)
28
+ if [ $? -gt 0 ] ; then
58
29
  while : ; do
59
- echo -n -e "$question Do you use b(a)sh or (z)sh or b(o)th for your shell (the default on most *nix systems is bash, press control + C to cancel the installation)\n(a/z/o)? "
30
+ echo -n -e "$question Do you want this (s)cript to set this up for you, or do it (m)anually yourself ('s' or 'm')? "
60
31
  read response
61
- if [ "${response:0:1}" = "a" ] ; then
62
- user_shell="bash"
63
- break
64
- elif [ "${response:0:1}" = "z" ] ; then
65
- user_shell="zsh"
32
+ if [ "${response:0:1}" = "s" ] ; then
33
+ echo 'w00t!'
66
34
  break
67
- elif [ "${response:0:1}" = "o" ] ; then
68
- user_shell="both"
35
+ elif [ "${response:0:1}" = "m" ] ; then
36
+ echo -e "$info Please make sure that this line is in place."
69
37
  break
70
38
  fi
71
39
  done
72
40
 
73
- if [ "$user_shell" = "bash" -o "$user_shell" = "both" ] ; then
41
+ if [ "${response:0:1}" = "s" ] ; then
42
+
43
+ while : ; do
44
+ echo -n -e "$question Do you use b(a)sh or (z)sh or b(o)th for your shell (the default on most *nix systems is bash, press control + C to cancel the installation)\n(a/z/o)? "
45
+ read response
46
+ if [ "${response:0:1}" = "a" ] ; then
47
+ user_shell="bash"
48
+ break
49
+ elif [ "${response:0:1}" = "z" ] ; then
50
+ user_shell="zsh"
51
+ break
52
+ elif [ "${response:0:1}" = "o" ] ; then
53
+ user_shell="both"
54
+ break
55
+ fi
56
+ done
57
+
58
+ if [ "$user_shell" = "bash" -o "$user_shell" = "both" ] ; then
59
+
60
+ touch ~/.bash_profile
61
+ if [ -z "`grep '\.rvm/scripts/rvm' ~/.bash_profile`" ] ; then
62
+ echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.bash_profile."
63
+ echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.bash_profile
64
+ fi
65
+ touch ~/.bashrc
66
+ if [ -z "`grep '\.rvm/scripts/rvm' ~/.bashrc`" ] ; then
67
+ echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.bashrc."
68
+ echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.bashrc
69
+ fi
74
70
 
75
- touch ~/.bash_profile
76
- if [ -z "`grep '\.rvm/scripts/rvm' ~/.bash_profile`" ] ; then
77
- echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.bash_profile."
78
- echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.bash_profile
79
71
  fi
80
- touch ~/.bashrc
81
- if [ -z "`grep '\.rvm/scripts/rvm' ~/.bashrc`" ] ; then
82
- echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.bashrc."
83
- echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.bashrc
72
+
73
+ if [ "$user_shell" = "zsh" -o "$user_shell" = "both" ] ; then
74
+
75
+ touch ~/.zshrc
76
+ if [ -z "`grep '\.rvm/scripts/rvm' ~/.zshrc`" ] ; then
77
+ echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.zshrc."
78
+ echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.zshrc
79
+ fi
84
80
  fi
85
81
 
86
82
  fi
83
+ fi
87
84
 
88
- if [ "$user_shell" = "zsh" -o "$user_shell" = "both" ] ; then
89
-
90
- touch ~/.zshrc
91
- if [ -z "`grep '\.rvm/scripts/rvm' ~/.zshrc`" ] ; then
92
- echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.zshrc."
93
- echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.zshrc
85
+ echo -e "\n\033[0;32m<i>\033[0m Ensuring that rvm script location in $file is scripts/rvm not bin/rvm for: ~/.bash_profile, ~/.bashrc, ~/.zshrc"
86
+ for file in ~/.bash_profile ~/.bashrc ~/.zshrc ; do
87
+ if [ -s $file ] ; then
88
+ if [ -L $file ] ; then # If the file is a symlink,
89
+ actual_file=`readlink $file` # read the link target so we can preserve it.
90
+ else
91
+ actual_file="$file"
94
92
  fi
93
+ sed -i.orig 's/rvm\/bin\/rvm/rvm\/scripts\/rvm/g' $actual_file
95
94
  fi
95
+ done
96
96
 
97
+ if [ -f ~/.rvm/bin/rvm ] ; then
98
+ echo -e "\n\033[0;32m<i>\033[0m Removing old rvm file from ~/.rvm/bin/rvm"
99
+ rm -f ~/.rvm/bin/rvm
97
100
  fi
98
101
 
99
- source $rvm_dir/scripts/rvm-update
102
+ for dir in config scripts examples ; do
103
+ mkdir -p $rvm_dir/$dir
104
+ for file in `/bin/ls $source_dir/$dir/`; do
105
+ cp $source_dir/$dir/$file $rvm_dir/$dir/$file
106
+ done
107
+ done
108
+
109
+ system=`uname`
110
+ if [ "$system" = "Linux" ] ; then
111
+ rvm_apt_get_binary=`which apt-get 2> /dev/null`
112
+ rvm_emerge_binary=`which emerge 2> /dev/null`
113
+ rvm_pacman_binary=`which pacman 2> /dev/null`
114
+ rvm_yum_binary=`which yum 2> /dev/null`
115
+
116
+ echo -e "\033[0;33m <w> \033[0mFor jRuby & ree (if you wish to use it) you will need:"
117
+ if [ ! -z "$rvm_apt_get_binary" ] ; then
118
+ echo -e "\033[0;32m <i> \033[0msudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk libreadline5-dev libssl-dev "
119
+
120
+ elif [ ! -z "$rvm_emerge_binary" ] ; then
121
+ echo -e "\033[0;32m <i> \033[0msudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
122
+
123
+ elif [ ! -z "$rvm_pacman_binary" ] ; then
124
+ echo -e "\033[0;32m <i> \033[0msudo pacman -Sy jdk jre"
125
+
126
+ elif [ ! -z "$rvm_yum_binary" ] ; then
127
+ echo -e "\033[0;32m <i> \033[0myum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
128
+
129
+ else
130
+ echo -e "\033[0;32m <i> \033[0mThe SUN java runtime environment and development kit."
131
+ fi
132
+ elif [ "$sytem" = "Darwin" ] ; then
133
+ echo -e "\033[0;32m <i> \033[0mIf you intend on installing MacRuby you must install LLVM first."
134
+ fi
135
+
136
+ echo -e "$info There have been a great many updates since previous releases, please:"
137
+ echo -e "$info * remove sourcing of ~/.rvm/current from your shell profiles."
138
+ echo -e "$info * note that ruby gems are now all installed into ~/.rvm/gems"
139
+
140
+ echo -e "\n$info Please visit the website for much more information: http://rvm.beginrescueend.com/\n"
141
+ echo ' w⦿‿⦿t! '
142
+ echo -e "\n ~ Wayne"
143
+
144
+ source $rvm_dir/scripts/rvm
145
+ rvm symlinks
146
+ echo
147
+ rvm -v
100
148
 
@@ -102,7 +102,9 @@ function __rvm_install-source {
102
102
  __rvm_bin_scripts
103
103
  __rvm_log "info" "Installation of $rvm_ruby_package_name is complete."
104
104
 
105
+
105
106
  __rvm_log "info" "\tInstalling rubygems dedicated to $rvm_ruby_package_name..."
107
+ GEM_HOME="$rvm_gem_home" ; export GEM_HOME
106
108
  rvm_gem_package_name="rubygems-1.3.5"
107
109
  rvm_gem_url="http://rubyforge.org/frs/download.php/60718/$rvm_gem_package_name.tgz"
108
110
  if [ -d $rvm_source_path/$rvm_gem_package_name ] ; then
@@ -126,7 +128,7 @@ function __rvm_install-source {
126
128
  mv $rvm_ruby_home/bin/$binary.new $rvm_ruby_home/bin/$binary
127
129
  chmod +x $rvm_ruby_home/bin/$binary
128
130
  else
129
- __rvm_log "warn" "$rvm_ruby_home/bin/$binary is missing"
131
+ __rvm_log "warn" "$rvm_ruby_src_path/bin/$binary is missing"
130
132
  fi
131
133
  done
132
134
 
@@ -136,22 +138,17 @@ function __rvm_install-source {
136
138
  done
137
139
 
138
140
  __rvm_log "info" "Installation of rubygems for $rvm_ruby_package_name is complete."
141
+
142
+ binary=rake
139
143
  if [ -x $rvm_gem_home/bin/$binary ] ; then
144
+ cp $rvm_gem_home/bin/$binary $rvm_ruby_home/bin/$binary
140
145
  string="ENV['GEM_HOME']=ENV['GEM_HOME'] || '$rvm_gem_home'\nENV['PATH']='$rvm_ruby_home/bin:$rvm_gem_home/bin:' + ENV['PATH']"
141
- mv $rvm_gem_home/bin/$binary $rvm_gem_home/bin/$binary.orig
142
- awk "NR==2 {print \"$string\"} {print}" $rvm_gem_home/bin/$binary.orig > $rvm_gem_home/bin/$binary
143
- chmod +x $rvm_gem_home/bin/$binary
146
+ awk "NR==2 {print \"$string\"} {print}" $rvm_ruby_home/bin/$binary > $rvm_ruby_home/bin/$binary.new
147
+ mv $rvm_ruby_home/bin/$binary.new $rvm_ruby_home/bin/$binary
148
+ chmod +x $rvm_ruby_home/bin/$binary
144
149
  else
145
150
  __rvm_log "warn" "$rvm_gem_home/bin/$binary is missing"
146
151
  fi
147
-
148
- binary=rake
149
- if [ -x $rvm_ruby_home/bin/$binary ] ; then
150
- mv $rvm_ruby_home/bin/$binary $rvm_gem_home/bin/$binary.orig
151
- awk "NR==2 {print \"$string\"} {print}" $rvm_gem_home/bin/$binary.orig > $rvm_gem_home/bin/$binary
152
- else
153
- __rvm_log "warn" "$rvm_gem_home/bin/$binary is missing."
154
- fi
155
152
  unset binary
156
153
  }
157
154
 
data/scripts/rvm-selector CHANGED
@@ -6,6 +6,12 @@ function __rvm_select {
6
6
  rvm_ruby_interpreter="${1:-$rvm_ruby_interpreter}"
7
7
  rvm_ruby_interpreter="${rvm_ruby_interpreter:-ruby}" # Default is standard ruby
8
8
 
9
+ temp=$(echo $rvm_ruby_interpreter | awk '{print substr($1, 0, 1)}')
10
+ if [ ! -z "$(echo $temp | grep '[0-9]')" ] ; then
11
+ rvm_ruby_version=$rvm_ruby_interpreter
12
+ rvm_ruby_interpreter="ruby"
13
+ fi ; unset temp
14
+
9
15
  if [ "$rvm_ruby_version" = "1.8" ] ; then rvm_ruby_version="1.8.6" ; fi
10
16
  if [ "$rvm_ruby_version" = "1.9" ] ; then rvm_ruby_version="1.9.1" ; fi
11
17
 
@@ -45,7 +51,7 @@ function __rvm_select {
45
51
 
46
52
  ruby-enterprise|ree)
47
53
  rvm_ruby_interpreter=`__rvm_db "ree_interpreter"`
48
- rvm_ruby_version=${rvm_ruby_version:-`__rvm_db "ruby_version"`}
54
+ rvm_ruby_version=${rvm_ruby_version:-`__rvm_db "ree_version"`}
49
55
  rvm_ruby_patch_level="${3:-`__rvm_db "ree_patch_level"`}"
50
56
 
51
57
  if [ "$rvm_ruby_version" != "1.8.6" ] ; then
@@ -115,7 +121,7 @@ function __rvm_select {
115
121
  export rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_version 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_package_name rvm_ruby_home rvm_log_path rvm_ruby_log_path rvm_source_path rvm_ruby_src_path rvm_ruby_irbrc rvm_selected
116
122
 
117
123
  else
118
- unset rvm_selected
124
+ rvm_gem_home=$GEM_HOME
119
125
  fi
120
126
 
121
127
  }
@@ -135,6 +141,7 @@ function __rvm_use {
135
141
  GEM_HOME=$rvm_gem_home ; export GEM_HOME
136
142
  MY_RUBY_HOME=$rvm_ruby_home ; export MY_RUBY_HOME
137
143
  IRBRC="$rvm_ruby_irbrc" ; export IRBRC
144
+ if [ -z "$IRBRC" ] ; then unset IRBRC ; fi
138
145
 
139
146
  # Install if not installed
140
147
  if [ ! -d $MY_RUBY_HOME ] ; then
@@ -143,7 +150,7 @@ function __rvm_use {
143
150
  fi
144
151
 
145
152
  if [ ! -s "$rvm_ruby_irbrc" ] ; then
146
- rvm_irbrc_file=$(cat <<Config
153
+ rvm_irbrc_file=`cat <<Config
147
154
  ; # No, this is not a stray ';' :)
148
155
  require "irb/completion" rescue nil
149
156
  @prompt = {
@@ -158,10 +165,11 @@ function __rvm_use {
158
165
  IRB.conf[:PROMPT][@prompt_mode] = @prompt
159
166
  IRB.conf[:PROMPT_MODE] = @prompt_mode
160
167
  Config
161
- )
168
+ `
162
169
  if [ -s ~/.irbrc ] ; then
163
170
  cp ~/.irbrc $rvm_ruby_home/.irbrc
164
171
  fi
172
+ touch $rvm_ruby_home/.irbrc
165
173
  echo "$rvm_irbrc_file" >> $rvm_ruby_home/.irbrc
166
174
  fi
167
175
  PATH="$MY_RUBY_HOME/bin:$GEM_HOME/bin:$rvm_path/bin:$rvm_default_path" ; export PATH
@@ -175,12 +183,16 @@ Config
175
183
  RUBY_VERSION="$($MY_RUBY_HOME/bin/ruby -v | sed 's/^\(.*\) (.*$/\1/')"
176
184
  export GEM_HOME MY_RUBY_HOME RUBY_VERSION
177
185
 
178
- echo "PATH=$MY_RUBY_HOME/bin:$GEM_HOME/bin:$rvm_path/bin:$rvm_default_path ; export PATH" > $rvm_path/current
186
+ echo "PATH=$MY_RUBY_HOME/bin:$GEM_HOME/bin:$rvm_path/bin:\$PATH ; export PATH" > $rvm_path/current
179
187
 
180
- for variable in rvm_prompt RUBY_VERSION GEM_HOME MY_RUBY_HOME ; do
188
+ for variable in rvm_prompt RUBY_VERSION GEM_HOME MY_RUBY_HOME IRBRC ; do
181
189
  eval "export $variable"
182
190
  eval value=\$${variable}
183
- echo "${variable}='$value' ; export ${variable}" >> $rvm_path/current
191
+ if [ ! -z "$variable" ] ; then
192
+ echo "${variable}='$value' ; export ${variable}" >> $rvm_path/current
193
+ else
194
+ echo "unset ${variable}" >> $rvm_path/current
195
+ fi
184
196
  done
185
197
  fi
186
198
  fi
data/scripts/rvm-utility CHANGED
@@ -4,8 +4,8 @@ function __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
- rvm_meta_version="0.0.35"
8
- rvm_meta_updated="2009.09.05"
7
+ rvm_meta_version="0.0.36"
8
+ rvm_meta_updated="2009.09.06"
9
9
  }
10
10
 
11
11
  function __rvm_version { __rvm_meta ; echo "rvm $rvm_meta_version ($rvm_meta_updated) [$rvm_meta_website]" ; }
@@ -169,14 +169,16 @@ function __rvm_gi { gem install -q --no-rdoc --no-ri $* ; }
169
169
  function __rvm_run {
170
170
  log_file_name="$1" ; shift
171
171
  command="$*"
172
+ mkdir -p $rvm_ruby_log_path
172
173
  if [ $rvm_debug ] ; then __rvm_log "debug" "Executing: $command" ; fi
174
+ touch $rvm_ruby_log_path/$log_file_name.log $rvm_ruby_log_path/$log_file_name.error.log # for zsh :(
173
175
  eval "nice -n $rvm_niceness $command" >> $rvm_ruby_log_path/$log_file_name.log 2>> $rvm_ruby_log_path/$log_file_name.error.log
174
176
  if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_ruby_log_path/$log_file_name.error.log" ; popd 2> /dev/null ; return 1 ; fi
175
177
  unset log_file command
176
178
  }
177
179
 
178
180
  function __rvm_cleanup-variables {
179
- 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_debug rvm_prefix_path rvm_ruby_package_name rvm_gem_path rvm_command rvm_error_message IRBRC rvm_ruby_home rvm_ruby_binary rvm_gem_set_name rvm_delete_flag rvm_ruby_tag rvm_ruby_rev rvm_url rvm_ruby_make rvm_ruby_make_install rvm_config_path rvm_bin_path rvm_force rvm_set_prompt rvm_all rvm_re_configure
181
+ 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_debug 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_delete_flag rvm_ruby_tag rvm_ruby_rev rvm_url rvm_ruby_make rvm_ruby_make_install rvm_config_path rvm_bin_path rvm_force rvm_set_prompt rvm_all rvm_re_configure
180
182
  }
181
183
 
182
184
  # TODO: root user loadng of /etc/rvmrc
@@ -191,7 +193,7 @@ ruby_wrapper=$(cat <<-RubyWrapper
191
193
  #!/bin/bash
192
194
  GEM_HOME=$rvm_gem_home ; export GEM_HOME
193
195
  MY_RUBY_HOME=$rvm_ruby_home ; export MY_RUBY_HOME
194
- PATH=$rvm_ruby_home/bin:$rvm_gem_home/bin:$rvm_default_path ; export PATH
196
+ PATH=$rvm_ruby_home/bin:$rvm_gem_home/bin:\$PATH ; export PATH
195
197
 
196
198
  exec "$rvm_ruby_binary" "\$@"
197
199
  RubyWrapper
@@ -275,6 +277,10 @@ function __rvm_reset {
275
277
 
276
278
  __rvm_select "system"
277
279
 
280
+ for default in default_ps1 default_path default_system_ruby default_system_gem_path default_user_gem_path ; do
281
+ __rvm_db "$default" "delete"
282
+ done ; unset default variable
283
+
278
284
  }
279
285
 
280
286
  function __rvm_implode {
@@ -357,7 +363,7 @@ function __rvm_db {
357
363
  else
358
364
  value="$*"
359
365
  if [ -z "$value" ] ; then # get
360
- grep "^$key=" $rvm_hash_file | awk -F'=' '{print $2}'
366
+ grep "^$key=" $rvm_hash_file | head -n 1 | awk -F'=' '{print $2}'
361
367
  else # set
362
368
  if [ -z "$(grep "^$key=" $rvm_hash_file)" ] ; then # append
363
369
  echo "$key=$value" >> $rvm_hash_file
@@ -395,6 +401,7 @@ function __rvm_list {
395
401
  echo "jruby head"
396
402
  echo "rubinius head"
397
403
  echo "rbx head"
404
+ echo "rbx head --jit"
398
405
  echo "ree 20090610"
399
406
  else
400
407
  echo -e "\nruby:\n$(/bin/ls -l $rvm_path/ | awk '/ ruby-[1-2].*/ { print " - " $NF }')\n"
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.35
4
+ version: 0.0.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wayne E. Seguin
@@ -9,15 +9,14 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-05 00:00:00 -07:00
13
- default_executable:
12
+ date: 2009-09-08 00:00:00 -07:00
13
+ default_executable: rvm-install
14
14
  dependencies: []
15
15
 
16
16
  description: Manages Ruby interpreter installations and switching between them.
17
17
  email: wayneeseguin@gmail.com
18
18
  executables:
19
19
  - rvm-install
20
- - rvm-update
21
20
  extensions: []
22
21
 
23
22
  extra_rdoc_files:
@@ -29,13 +28,11 @@ files:
29
28
  - config/db
30
29
  - examples/rvmrc
31
30
  - lib/rvm.rb
32
- - rvm.gemspec
33
31
  - scripts/rvm
34
32
  - scripts/rvm-cli
35
33
  - scripts/rvm-install
36
34
  - scripts/rvm-ruby-installer
37
35
  - scripts/rvm-selector
38
- - scripts/rvm-update
39
36
  - scripts/rvm-utility
40
37
  has_rdoc: false
41
38
  homepage: http://github.com/wayneeseguin/rvm
data/bin/rvm-update DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Hot potato!!! Bash it!
4
- exec "bash -l -c 'cd #{File.dirname(File.dirname(__FILE__))} && ./scripts/rvm-update #{ARGV.join(' ')} && source ~/.rvm/scripts/rvm'"
5
-
data/rvm.gemspec DELETED
@@ -1,51 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{rvm}
8
- s.version = "0.0.35"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Wayne E. Seguin"]
12
- s.date = %q{2009-09-05}
13
- s.description = %q{Manages Ruby interpreter installations and switching between them.}
14
- s.email = %q{wayneeseguin@gmail.com}
15
- s.executables = ["rvm-install", "rvm-update"]
16
- s.extra_rdoc_files = [
17
- "README"
18
- ]
19
- s.files = [
20
- "INSTALL",
21
- "LICENCE",
22
- "README",
23
- "config/db",
24
- "examples/rvmrc",
25
- "lib/rvm.rb",
26
- "rvm.gemspec",
27
- "scripts/rvm",
28
- "scripts/rvm-cli",
29
- "scripts/rvm-install",
30
- "scripts/rvm-ruby-installer",
31
- "scripts/rvm-selector",
32
- "scripts/rvm-update",
33
- "scripts/rvm-utility"
34
- ]
35
- s.homepage = %q{http://github.com/wayneeseguin/rvm}
36
- s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
37
- s.require_paths = ["lib"]
38
- s.rubyforge_project = %q{dynamicreports}
39
- s.rubygems_version = %q{1.3.5}
40
- s.summary = %q{Ruby Version Manager (rvm)}
41
-
42
- if s.respond_to? :specification_version then
43
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
44
- s.specification_version = 3
45
-
46
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
47
- else
48
- end
49
- else
50
- end
51
- end
data/scripts/rvm-update DELETED
@@ -1,77 +0,0 @@
1
- #!/bin/bash
2
-
3
- user=`whoami`
4
- if [ "$user" = "root" ] ; then
5
- echo -e "\033[0;31m <e> \033[0mroot user support is not implemented yet.\033[0m"
6
- exit 1
7
- fi
8
- cwd=$(pwd)
9
- source_dir="${source_dir:-`dirname $0 | xargs dirname`}"
10
- if [ ! -d "$source_dir" ] ; then unset source_dir ; fi
11
- source_dir="${source_dir:-$cwd}"
12
- rvm_dir=~/.rvm
13
-
14
- info="\n\033[0;32m<i>\033[0m"
15
-
16
- echo -e "$info Updating rvm source ~/.rvm/scripts/rvm ..."
17
- for dir in src scripts bin log archives config gems examples ; do
18
- mkdir -p $rvm_dir/$dir
19
- done
20
-
21
- echo -e "\n\033[0;32m<i>\033[0m Ensuring that rvm script location in $file is scripts/rvm not bin/rvm for: ~/.bash_profile, ~/.bashrc, ~/.zshrc"
22
- for file in ~/.bash_profile ~/.bashrc ~/.zshrc ; do
23
- if [ -s $file ] ; then sed -i.orig 's/rvm\/bin\/rvm/rvm\/scripts\/rvm/g' $file ; fi
24
- done
25
-
26
- if [ -f ~/.rvm/bin/rvm ] ; then
27
- echo -e "\n\033[0;32m<i>\033[0m Removing old rvm file from ~/.rvm/bin/rvm"
28
- rm -f ~/.rvm/bin/rvm
29
- fi
30
-
31
- for dir in config scripts examples ; do
32
- mkdir -p $rvm_dir/$dir
33
- for file in `/bin/ls $source_dir/$dir/`; do
34
- cp $source_dir/$dir/$file $rvm_dir/$dir/$file
35
- done
36
- done
37
-
38
- system=`uname`
39
- if [ "$system" = "Linux" ] ; then
40
- rvm_apt_get_binary=`which apt-get 2> /dev/null`
41
- rvm_emerge_binary=`which emerge 2> /dev/null`
42
- rvm_pacman_binary=`which pacman 2> /dev/null`
43
- rvm_yum_binary=`which yum 2> /dev/null`
44
-
45
- echo -e "\033[0;33m <w> \033[0mFor jRuby & ree (if you wish to use it) you will need:"
46
- if [ ! -z "$rvm_apt_get_binary" ] ; then
47
- echo -e "\033[0;32m <i> \033[0msudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk libreadline5-dev libssl-dev "
48
-
49
- elif [ ! -z "$rvm_emerge_binary" ] ; then
50
- echo -e "\033[0;32m <i> \033[0msudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
51
-
52
- elif [ ! -z "$rvm_pacman_binary" ] ; then
53
- echo -e "\033[0;32m <i> \033[0msudo pacman -Sy jdk jre"
54
-
55
- elif [ ! -z "$rvm_yum_binary" ] ; then
56
- echo -e "\033[0;32m <i> \033[0myum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
57
-
58
- else
59
- echo -e "\033[0;32m <i> \033[0mThe SUN java runtime environment and development kit."
60
- fi
61
- elif [ "$sytem" = "Darwin" ] ; then
62
- echo -e "\033[0;32m <i> \033[0mIf you intend on installing MacRuby you must install LLVM first."
63
- fi
64
-
65
- echo -e "$info There have been a great many updates since previous releases, please:"
66
- echo -e "$info * remove sourcing of ~/.rvm/current from your shell profiles."
67
- echo -e "$info * note that ruby gems are now all installed into ~/.rvm/gems"
68
-
69
- echo -e "\n$info Please visit the website for much more information: http://rvm.beginrescueend.com/\n"
70
- echo ' w⦿‿⦿t! '
71
- echo -e "\n ~ Wayne"
72
-
73
- source $rvm_dir/scripts/rvm
74
- rvm symlinks
75
- echo
76
- rvm -v
77
-