rvm 0.0.4 → 0.0.5
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/README +29 -12
- data/bash/rvm +129 -89
- data/bash/rvm-install +16 -11
- metadata +1 -1
data/README
CHANGED
@@ -1,4 +1,10 @@
|
|
1
1
|
|
2
|
+
About:
|
3
|
+
|
4
|
+
rvm 0.0.5 http://github.com/wayneeseguin/rvm
|
5
|
+
|
6
|
+
by Wayne E. Seguin (wayneeseguin@gmail.com)
|
7
|
+
|
2
8
|
Usage:
|
3
9
|
|
4
10
|
rvm Action [Implementation] [Options]
|
@@ -10,7 +16,8 @@
|
|
10
16
|
info - Show information for current ruby
|
11
17
|
gemdir - Switch to gem directory for installation (new login shell)
|
12
18
|
srcdir - Switch to src directory for the current ruby installation
|
13
|
-
gemdup - Clone source implementation version gems to currently used version
|
19
|
+
gemdup - Clone source implementation version gems to currently used version
|
20
|
+
(expiramental)
|
14
21
|
install - Install a ruby version, default is from source
|
15
22
|
debug - Emit environment and configuration information for debugging
|
16
23
|
|
@@ -19,7 +26,6 @@
|
|
19
26
|
* ruby - MRI/YARV Ruby (The Standard), defaults to 1.8.6
|
20
27
|
jruby - jRuby
|
21
28
|
ree - Ruby Enterprise Edition
|
22
|
-
rubinius - Rubinius (NIY)
|
23
29
|
default - Resets to the default system ruby
|
24
30
|
all - Used with install, installs all latest known versions
|
25
31
|
|
@@ -30,7 +36,7 @@
|
|
30
36
|
-p|--prefix - Package and source directory prefix, with trailing slash!
|
31
37
|
Default is a users home directory and /usr/local/ for root
|
32
38
|
-c|--configure - Options for source compile (default: --enable-shared)
|
33
|
-
-d|--debug - Toggle debug mode on for extra messages (
|
39
|
+
-d|--debug - Toggle debug mode on for extra messages (NYI)
|
34
40
|
|
35
41
|
Notes:
|
36
42
|
|
@@ -45,18 +51,29 @@
|
|
45
51
|
Examples:
|
46
52
|
|
47
53
|
$ gem install rvm # Install the rvm gem
|
48
|
-
$ rvm-install # Install rvm, adds source hooks
|
49
|
-
$ rvm install jruby # Install jRuby
|
50
|
-
$ rvm use ruby -v 1.9.1 # Use Ruby 1.9,
|
51
|
-
$ rvm use
|
54
|
+
$ rvm-install # Install rvm, adds source hooks for bash & zsh
|
55
|
+
$ rvm install jruby # Install jRuby (default version is 1.3.1)
|
56
|
+
$ rvm use ruby -v 1.9.1 # Use Ruby 1.9.1, installs if necessary
|
57
|
+
$ rvm use 1.9 # Equivalent to above, due to defaults
|
58
|
+
$ rvm use 1.8 # Use Ruby 1.8.6, installs if necessary
|
52
59
|
$ rvm use default # Use the system default (as if no rvm)
|
53
60
|
|
54
61
|
TODO: (in order)
|
55
62
|
|
56
|
-
* Documentation
|
57
|
-
* Change gemdup to simply allow for a path to base gem dir to clone from
|
58
63
|
* rvm gemdir default
|
59
|
-
|
60
|
-
|
61
|
-
|
64
|
+
|
65
|
+
Credits:
|
66
|
+
|
67
|
+
Bash Support Testing
|
68
|
+
|
69
|
+
- Daniel Neighman (dneighman@gmail.com)
|
70
|
+
irc: hassox ; github: http://github.com/hassox
|
71
|
+
|
72
|
+
- John Mettraux (jmettraux@openwfe.org)
|
73
|
+
irc: jmettraux ; github: http://github.com/jmettraux
|
74
|
+
|
75
|
+
ZSH Support Testing
|
76
|
+
|
77
|
+
- Franco Lazzarino (flazzarino@gmail.com)
|
78
|
+
irc: flazz ; github: http://github.com/flazz
|
62
79
|
|
data/bash/rvm
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
3
|
rvm_author="Wayne E. Seguin"
|
4
|
-
|
4
|
+
rvm_author_email="wayneeseguin@gmail.com"
|
5
|
+
rvm_website="http://github.com/wayneeseguin/rvm"
|
6
|
+
rvm_version="0.0.5"
|
5
7
|
rvm_updated="2009.08.23"
|
6
8
|
|
7
9
|
#
|
@@ -11,10 +13,16 @@ rvm_updated="2009.08.23"
|
|
11
13
|
#
|
12
14
|
# Functions
|
13
15
|
#
|
14
|
-
function usage {
|
16
|
+
function rvm-usage {
|
15
17
|
|
16
18
|
cat <<-Usage
|
17
19
|
|
20
|
+
About:
|
21
|
+
|
22
|
+
rvm ${rvm_version} ${rvm_website}
|
23
|
+
|
24
|
+
by ${rvm_author} (${rvm_author_email})
|
25
|
+
|
18
26
|
Usage:
|
19
27
|
|
20
28
|
rvm Action [Implementation] [Options]
|
@@ -36,7 +44,6 @@ function usage {
|
|
36
44
|
* ruby - MRI/YARV Ruby (The Standard), defaults to 1.8.6
|
37
45
|
jruby - jRuby
|
38
46
|
ree - Ruby Enterprise Edition
|
39
|
-
rubinius - Rubinius (NIY)
|
40
47
|
default - Resets to the default system ruby
|
41
48
|
all - Used with install, installs all latest known versions
|
42
49
|
|
@@ -47,7 +54,7 @@ function usage {
|
|
47
54
|
-p|--prefix - Package and source directory prefix, with trailing slash!
|
48
55
|
Default is a users home directory and /usr/local/ for root
|
49
56
|
-c|--configure - Options for source compile (default: --enable-shared)
|
50
|
-
-d|--debug - Toggle debug mode on for extra messages (
|
57
|
+
-d|--debug - Toggle debug mode on for extra messages (NYI)
|
51
58
|
|
52
59
|
Notes:
|
53
60
|
|
@@ -62,21 +69,31 @@ function usage {
|
|
62
69
|
Examples:
|
63
70
|
|
64
71
|
$ gem install rvm # Install the rvm gem
|
65
|
-
$ rvm-install # Install rvm, adds source hooks
|
66
|
-
$ rvm install jruby # Install jRuby
|
67
|
-
$ rvm use ruby -v 1.9.1 # Use Ruby 1.9.1,
|
68
|
-
$ rvm use 1.9 # Equivalent to above, due to
|
69
|
-
$ rvm use 1.8 # Use Ruby 1.8.6,
|
72
|
+
$ rvm-install # Install rvm, adds source hooks for bash & zsh
|
73
|
+
$ rvm install jruby # Install jRuby (default version is 1.3.1)
|
74
|
+
$ rvm use ruby -v 1.9.1 # Use Ruby 1.9.1, installs if necessary
|
75
|
+
$ rvm use 1.9 # Equivalent to above, due to defaults
|
76
|
+
$ rvm use 1.8 # Use Ruby 1.8.6, installs if necessary
|
70
77
|
$ rvm use default # Use the system default (as if no rvm)
|
71
78
|
|
72
79
|
TODO: (in order)
|
73
80
|
|
74
|
-
* Documentation
|
75
|
-
* Change gemdup to simply allow for a path to base gem dir to clone from
|
76
81
|
* rvm gemdir default
|
77
|
-
|
78
|
-
|
79
|
-
|
82
|
+
|
83
|
+
Credits:
|
84
|
+
|
85
|
+
Bash Support Testing
|
86
|
+
|
87
|
+
- Daniel Neighman (dneighman@gmail.com)
|
88
|
+
irc: hassox ; github: http://github.com/hassox
|
89
|
+
|
90
|
+
- John Mettraux (jmettraux@openwfe.org)
|
91
|
+
irc: jmettraux ; github: http://github.com/jmettraux
|
92
|
+
|
93
|
+
ZSH Support Testing
|
94
|
+
|
95
|
+
- Franco Lazzarino (flazzarino@gmail.com)
|
96
|
+
irc: flazz ; github: http://github.com/flazz
|
80
97
|
|
81
98
|
Usage
|
82
99
|
|
@@ -90,9 +107,9 @@ function warn { log "\e[0;33m <w> $*" ; }
|
|
90
107
|
function error { log "\e[0;31m <e> $*" ; }
|
91
108
|
function fail { log "\e[0;31m <e> $*" ; return 1 ; }
|
92
109
|
|
93
|
-
function
|
110
|
+
function rvm-gi { gem install -q --no-rdoc --no-ri $* ; }
|
94
111
|
|
95
|
-
function
|
112
|
+
function rvm-info {
|
96
113
|
|
97
114
|
full_version=$(ruby -v)
|
98
115
|
ruby_implementation=$(echo "$full_version" | awk '{print $1}')
|
@@ -115,11 +132,12 @@ Info
|
|
115
132
|
|
116
133
|
}
|
117
134
|
|
118
|
-
function
|
135
|
+
function rvm-install-source {
|
119
136
|
|
120
|
-
|
137
|
+
version="${1:-1.8.6}"
|
138
|
+
case "$version" in
|
121
139
|
1.9|1.9.1) major="1.9" ; minor="1" ; level="${2-243}" ;;
|
122
|
-
1.9.2) major="1.9" ; minor="2" ; level="review1" ;;
|
140
|
+
1.9.2) major="1.9" ; minor="2" ; level="${2-review1}" ;;
|
123
141
|
1.8|1.8.6) major="1.8" ; minor="6" ; level="${2-369}" ;;
|
124
142
|
1.8.7) major="1.8" ; minor="7" ; level="${2-174}" ;;
|
125
143
|
*) fail "Ruby version '$version' is unknown."
|
@@ -132,7 +150,7 @@ function ruby-install-source {
|
|
132
150
|
if [ -d $package_name ] ; then
|
133
151
|
cd $package_name
|
134
152
|
else
|
135
|
-
if [ ! -f "$package_name.tar.gz" ] ; then
|
153
|
+
if [ ! -f "$package_name.tar.gz" ] ; then curl -O -L -s $url ; fi
|
136
154
|
tar xzf $package_name.tar.gz && cd $package_name/
|
137
155
|
fi
|
138
156
|
./configure --prefix=$install_path/$package_name ${configure-'--enable-shared'} && make && make install
|
@@ -144,7 +162,7 @@ function ruby-install-source {
|
|
144
162
|
if [ -d $gem_package_name ] ; then
|
145
163
|
cd $gem_package_name
|
146
164
|
else
|
147
|
-
if [ ! -f $gem_package_name.tgz ] ; then
|
165
|
+
if [ ! -f $gem_package_name.tgz ] ; then curl -O -L -s $gem_url ; fi
|
148
166
|
tar zxf $gem_package_name.tgz && cd $gem_package_name
|
149
167
|
fi
|
150
168
|
# Well this is fun... fix nil error on require_paths:
|
@@ -154,7 +172,7 @@ function ruby-install-source {
|
|
154
172
|
|
155
173
|
}
|
156
174
|
|
157
|
-
function
|
175
|
+
function rvm-install-ruby {
|
158
176
|
|
159
177
|
case "$implementation" in
|
160
178
|
|
@@ -167,7 +185,7 @@ function ruby-install {
|
|
167
185
|
if [ -d $package_name ] ; then
|
168
186
|
cd $package_name
|
169
187
|
else
|
170
|
-
if [ ! -f "$package_name.tar.gz" ] ; then
|
188
|
+
if [ ! -f "$package_name.tar.gz" ] ; then curl -O -L -s $url ; fi
|
171
189
|
tar xzf $package_name.tar.gz && cd $package_name/
|
172
190
|
fi
|
173
191
|
cd ruby-enterprise-$version-$patchlevel && ./installer -a $install_path/ruby-enterprise-$version-$patchlevel --dont-install-useful-gems
|
@@ -177,7 +195,7 @@ function ruby-install {
|
|
177
195
|
|
178
196
|
jruby)
|
179
197
|
version=${version-1.3.1} # 1.2.0, 1.3.1
|
180
|
-
patchlevel
|
198
|
+
unset patchlevel # No patchlevel for jRuby
|
181
199
|
package_name="$implementation-bin-$version"
|
182
200
|
package_dir="$implementation-$version"
|
183
201
|
url="http://dist.codehaus.org/$implementation/$version/$package_name.zip"
|
@@ -185,7 +203,7 @@ function ruby-install {
|
|
185
203
|
if [ -d $package_name ] ; then
|
186
204
|
cd $package_name
|
187
205
|
else
|
188
|
-
if [ ! -f "$package_name.zip" ] ; then
|
206
|
+
if [ ! -f "$package_name.zip" ] ; then curl -O -L -s $url ; fi
|
189
207
|
jar xf $package_name.zip && cd $package_name/
|
190
208
|
fi
|
191
209
|
mkdir -p $install_path/$package_dir/bin/
|
@@ -196,23 +214,25 @@ function ruby-install {
|
|
196
214
|
cd $source_path/$package_dir/tool/nailgun && make
|
197
215
|
popd
|
198
216
|
chmod +x $install_path/$package_dir/bin/*
|
199
|
-
|
217
|
+
rvm-gi jruby-openssl
|
200
218
|
;;
|
201
219
|
|
202
220
|
ruby)
|
203
|
-
|
204
|
-
ruby-install-source $version ${patchlevel-$3}
|
221
|
+
rvm-install-source ${version-1.8.6} ${patchlevel-$3}
|
205
222
|
;;
|
206
223
|
|
224
|
+
default)
|
225
|
+
fail "please specify a ruby implementation to install."
|
226
|
+
;;
|
207
227
|
*) fail "Ruby implementation '$implementation' is not known."
|
208
228
|
|
209
229
|
esac
|
210
230
|
|
211
|
-
|
231
|
+
rvm-gi rake
|
212
232
|
|
213
233
|
}
|
214
234
|
|
215
|
-
function
|
235
|
+
function rvm-use {
|
216
236
|
|
217
237
|
case "$implementation" in
|
218
238
|
|
@@ -247,22 +267,26 @@ function ruby-use {
|
|
247
267
|
;;
|
248
268
|
|
249
269
|
ruby)
|
250
|
-
if [ "$version" = "1.8.
|
251
|
-
level="${patchlevel-369}"
|
252
|
-
MY_RUBY_HOME="$install_path/ruby-1.8.6-p$level"
|
253
|
-
GEM_HOME="$HOME/.gem/ruby/1.8"
|
254
|
-
elif [ "$version" = "1.8.7" ] ; then
|
270
|
+
if [ "$version" = "1.8.7" ] ; then
|
255
271
|
level="${patchlevel-174}"
|
256
272
|
MY_RUBY_HOME="$install_path/ruby-1.8.7-p$level"
|
257
273
|
GEM_HOME="$HOME/.gem/ruby/1.8"
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
274
|
+
|
275
|
+
elif [ "$version" = "1.8.6" -o "$version" = "1.8" ] ; then
|
276
|
+
level="${patchlevel-369}"
|
277
|
+
MY_RUBY_HOME="$install_path/ruby-1.8.6-p$level"
|
278
|
+
GEM_HOME="$HOME/.gem/ruby/1.8"
|
279
|
+
|
262
280
|
elif [ "$version" = "1.9.2" ] ; then
|
263
281
|
level="${patchlevel-review1}"
|
264
282
|
MY_RUBY_HOME="$install_path/ruby-1.9.2-p$level"
|
265
|
-
GEM_HOME="$HOME/.gem/ruby/1.9"
|
283
|
+
GEM_HOME="$HOME/.gem/ruby/1.9.2"
|
284
|
+
|
285
|
+
elif [ "$version" = "1.9.1" -o "$version" = "1.9" ] ; then
|
286
|
+
level="${patchlevel-243}"
|
287
|
+
MY_RUBY_HOME="$install_path/ruby-1.9.1-p$level"
|
288
|
+
GEM_HOME="$HOME/.gem/ruby/1.9.1"
|
289
|
+
|
266
290
|
else
|
267
291
|
fail "Unknown ruby version: $version"
|
268
292
|
fi
|
@@ -279,7 +303,7 @@ function ruby-use {
|
|
279
303
|
|
280
304
|
if [ ! -d $MY_RUBY_HOME ] ; then
|
281
305
|
warn "$implementation $version is not installed, installing."
|
282
|
-
|
306
|
+
rvm-install-ruby $implementation $version $level
|
283
307
|
fi
|
284
308
|
|
285
309
|
# Setup ~/.rvm/current
|
@@ -294,20 +318,30 @@ function ruby-use {
|
|
294
318
|
fi
|
295
319
|
|
296
320
|
info "Switching to $implementation $version $patchlevel ..."
|
297
|
-
|
298
|
-
|
321
|
+
if [ ! -z "$BASH_VERSION" ] ; then
|
322
|
+
exec bash -l
|
323
|
+
elif [ ! -z "$ZSH_VERSION" ] ; then
|
324
|
+
exec zsh -l
|
325
|
+
else
|
326
|
+
fail "Your shell '$0' is not supported."
|
327
|
+
fi
|
299
328
|
}
|
300
329
|
|
301
|
-
function
|
330
|
+
function rvm-gem-dir {
|
302
331
|
|
303
332
|
case "$implementation" in
|
304
333
|
jruby) GEM_HOME="$HOME/.gem/jruby/1.8" ;;
|
305
334
|
ree) GEM_HOME="$HOME/.gem/ruby-enterprise/1.8" ;;
|
306
335
|
ruby)
|
307
|
-
if [ "$
|
336
|
+
if [ "$version" = "1.8" -o "$version" = "1.8.6" ] ; then
|
308
337
|
GEM_HOME="$HOME/.gem/ruby/1.8"
|
309
|
-
|
310
|
-
|
338
|
+
|
339
|
+
elif [ "$version" = "1.9.2" ] ; then
|
340
|
+
GEM_HOME="$HOME/.gem/ruby/1.9.2"
|
341
|
+
|
342
|
+
elif [ "$version" = "1.9" -o "$version" = "1.9.1" ] ; then
|
343
|
+
GEM_HOME="$HOME/.gem/ruby/1.9.1"
|
344
|
+
|
311
345
|
else
|
312
346
|
fail "Unknown ruby version: $version"
|
313
347
|
fi
|
@@ -317,14 +351,14 @@ function ruby-gem-dir {
|
|
317
351
|
esac
|
318
352
|
|
319
353
|
if [ -d $GEM_HOME ] ; then
|
320
|
-
cd $GEM_HOME
|
354
|
+
echo $GEM_HOME && cd $GEM_HOME
|
321
355
|
else
|
322
356
|
fail "$implementation $version GEM directory does not exist."
|
323
357
|
fi
|
324
358
|
|
325
359
|
}
|
326
360
|
|
327
|
-
function
|
361
|
+
function rvm-src-dir {
|
328
362
|
case "$implementation" in
|
329
363
|
|
330
364
|
jruby)
|
@@ -339,26 +373,25 @@ function ruby-src-dir {
|
|
339
373
|
ree)
|
340
374
|
version=${version-1.8.6}
|
341
375
|
if [ "$version" = "1.8.6" ] ; then
|
342
|
-
|
343
|
-
src_dir="$source_path/ruby-enterprise-$version-$patchlevel"
|
376
|
+
src_dir="$source_path/ruby-enterprise-$version-"${3-20090610}""
|
344
377
|
else
|
345
378
|
fail "Unknown Ruby Enterprise Edition version: $version"
|
346
379
|
fi
|
347
380
|
;;
|
348
381
|
|
349
382
|
ruby)
|
350
|
-
if [ "$version" = "1.8.
|
351
|
-
|
352
|
-
|
353
|
-
elif [ "$version" = "1.8
|
354
|
-
|
355
|
-
|
356
|
-
elif [ "$version" = "1.9.1" -o "$version" = "1.9" ] ; then
|
357
|
-
level="${patchlevel-243}"
|
358
|
-
src_dir="$source_path/ruby-1.9.1-p$level"
|
383
|
+
if [ "$version" = "1.8.7" ] ; then
|
384
|
+
src_dir="$source_path/ruby-1.8.7-p${patchlevel-174}"
|
385
|
+
|
386
|
+
elif [ "${version%\.*}" = "1.8" ] ; then
|
387
|
+
src_dir="$source_path/ruby-1.8.6-p${patchlevel-369}"
|
388
|
+
|
359
389
|
elif [ "$version" = "1.9.2" ] ; then
|
360
|
-
|
361
|
-
|
390
|
+
src_dir="$source_path/ruby-1.9.2-p${patchlevel-review1}"
|
391
|
+
|
392
|
+
elif [ "${version%\.*}" = "1.9" ] ; then
|
393
|
+
src_dir="$source_path/ruby-1.9.1-p${patchlevel-243}"
|
394
|
+
|
362
395
|
else
|
363
396
|
fail "Unknown ruby version: $version"
|
364
397
|
fi
|
@@ -378,7 +411,7 @@ function ruby-src-dir {
|
|
378
411
|
}
|
379
412
|
|
380
413
|
# clones from source implementation/version to current
|
381
|
-
function
|
414
|
+
function rvm-gem-dup {
|
382
415
|
|
383
416
|
gem_dir=$1 # TODO: check for and remove trailing /gems
|
384
417
|
if [ ! -z "$gem_dir" ] ; then
|
@@ -388,7 +421,7 @@ function ruby-gem-dup {
|
|
388
421
|
if [ -d $GEM_HOME/gems/$gem_name_version ] ; then
|
389
422
|
echo "$gem_name_version already installed."
|
390
423
|
else
|
391
|
-
|
424
|
+
rvm-gi $gem_dir/cache/$gem_name-$gem_version.gem
|
392
425
|
fi
|
393
426
|
done
|
394
427
|
else
|
@@ -408,25 +441,29 @@ function rvm {
|
|
408
441
|
while [ $# -gt 0 ] ; do
|
409
442
|
token="$1" ; shift
|
410
443
|
case "$token" in
|
411
|
-
install|use|path|info|gemdir|
|
412
|
-
action=$token
|
444
|
+
install|use|path|info|gemdir|setup|version|debug|srcdir)
|
445
|
+
action=$token ;;
|
413
446
|
ruby|jruby|ree|default|all)
|
414
|
-
implementation="$token"
|
415
|
-
1.8|1.
|
416
|
-
version="$token"
|
417
|
-
-v|--version) version="$1" ; shift
|
418
|
-
-l|--level) patchlevel="$1" ; shift
|
419
|
-
-p|--prefix) install_path="$1" ; shift
|
420
|
-
-s|--source) source_path="$1" ; shift
|
421
|
-
-c|--configure) configure="$1" ; shift
|
422
|
-
-m|--manager) manager="$1" ; shift
|
423
|
-
-
|
424
|
-
|
447
|
+
implementation="$token" ;;
|
448
|
+
1.8|1.8.6|1.8.7|1.9|1.9.1|1.9.2|1.2.0|1.3.1)
|
449
|
+
version="$token" ;;
|
450
|
+
-v|--version) version="$1" ; shift ;;
|
451
|
+
-l|--level) patchlevel="$1" ; shift ;;
|
452
|
+
-p|--prefix) install_path="$1" ; shift ;;
|
453
|
+
-s|--source) source_path="$1" ; shift ;; # Undocumented / untested "feature"
|
454
|
+
-c|--configure) configure="$1" ; shift ;;
|
455
|
+
-m|--manager) manager="$1" ; shift ;;
|
456
|
+
-u|--gemdup) action="gemdup" ; gem_dir="$1" ; shift ;;
|
457
|
+
-d|--debug) debug=true ;;
|
458
|
+
*) rvm-usage ; return 1
|
425
459
|
esac
|
426
460
|
done
|
427
461
|
|
428
|
-
|
429
|
-
|
462
|
+
if [ -z "$implementation" -a -z "$version" ] ; then
|
463
|
+
implementation="default"
|
464
|
+
else
|
465
|
+
implementation=${implementation-'ruby'}
|
466
|
+
fi
|
430
467
|
username=`whoami`
|
431
468
|
|
432
469
|
# TODO: Sanitize user input, ensure that there is a / a the end...
|
@@ -440,7 +477,9 @@ function rvm {
|
|
440
477
|
|
441
478
|
mkdir -p $source_path $install_path
|
442
479
|
|
443
|
-
original_path
|
480
|
+
if [ -f ~/.rvm/original_path ] ; then
|
481
|
+
original_path=`cat ~/.rvm/original_path`
|
482
|
+
fi
|
444
483
|
if [ -z "$original_path" ] ; then
|
445
484
|
echo $PATH > $install_path/.original_path
|
446
485
|
original_path=$PATH
|
@@ -452,21 +491,21 @@ function rvm {
|
|
452
491
|
for implementation in ruby jruby ree ; do
|
453
492
|
if [ "$implementation" = "ruby" ] ; then
|
454
493
|
for version in 1.8.6 1.8.7 1.9.1 1.9.2 ; do
|
455
|
-
|
494
|
+
rvm-install-ruby $implementation $version $patchlevel
|
456
495
|
done
|
457
496
|
else
|
458
|
-
|
497
|
+
rvm-install-ruby $implementation $version $patchlevel
|
459
498
|
fi
|
460
499
|
done
|
461
500
|
else
|
462
|
-
|
501
|
+
rvm-install-ruby $implementation $version $patchlevel
|
463
502
|
fi
|
464
503
|
;;
|
465
|
-
use)
|
466
|
-
gemdir)
|
467
|
-
srcdir)
|
468
|
-
gemdup)
|
469
|
-
info)
|
504
|
+
use) rvm-use $implementation $version $patchlevel ;;
|
505
|
+
gemdir) rvm-gem-dir $implementation $version $patchlevel ;;
|
506
|
+
srcdir) rvm-src-dir $implementation $version $patchlevel ;;
|
507
|
+
gemdup) rvm-gem-dup $implementation $version $patchlevel ;;
|
508
|
+
info) rvm-info $implementation $version $patchlevel ;;
|
470
509
|
version) rvm-version ;;
|
471
510
|
debug)
|
472
511
|
rvm-version
|
@@ -478,9 +517,10 @@ function rvm {
|
|
478
517
|
return 0
|
479
518
|
;;
|
480
519
|
*)
|
481
|
-
usage
|
482
520
|
if [ ! -z "$action" ] ; then
|
483
521
|
fail "unknown action '$action'"
|
522
|
+
else
|
523
|
+
rvm-usage
|
484
524
|
fi
|
485
525
|
return 1
|
486
526
|
esac
|
data/bash/rvm-install
CHANGED
@@ -2,25 +2,30 @@
|
|
2
2
|
|
3
3
|
mkdir -p ~/.rvm/src ~/.rvm/bin
|
4
4
|
|
5
|
-
|
6
|
-
cp $cwd/bash/rvm ~/.rvm/bin/
|
5
|
+
cp $(pwd)/bash/rvm ~/.rvm/bin/
|
7
6
|
|
8
|
-
touch ~/.
|
9
|
-
|
10
|
-
|
11
|
-
echo "
|
12
|
-
echo "source ~/.rvm/bin/rvm" >> ~/.bash_profile
|
7
|
+
touch ~/.profile
|
8
|
+
if [ -z "`grep '\.rvm/bin/rvm' ~/.profile`" ] ; then
|
9
|
+
echo "Adding 'source ~/.rvm/bin/rvm' to your ~/.profile."
|
10
|
+
echo "source ~/.rvm/bin/rvm" >> ~/.profile
|
13
11
|
fi
|
14
12
|
|
15
|
-
if [ -z "`grep '\.rvm/current' ~/.
|
16
|
-
echo "Adding 'source ~/.rvm/current' ~/.
|
17
|
-
echo "if [ -f ~/.rvm/current ] ; then source ~/.rvm/current ; fi" >> ~/.
|
13
|
+
if [ -z "`grep '\.rvm/current' ~/.profile`" ] ; then
|
14
|
+
echo "Adding 'source ~/.rvm/current' ~/.profile."
|
15
|
+
echo "if [ -f ~/.rvm/current ] ; then source ~/.rvm/current ; fi" >> ~/.profile
|
18
16
|
fi
|
19
17
|
|
18
|
+
touch ~/.bash_profile
|
20
19
|
if [ -z "`grep '\.profile' ~/.bash_profile`" ] ; then
|
21
20
|
echo "Adding 'source ~/.profile' to the end of ~/.bash_profile."
|
22
21
|
echo "if [ -f ~/.profile ] ; then source ~/.profile ; fi" >> ~/.bash_profile
|
23
22
|
fi
|
24
23
|
|
25
|
-
|
24
|
+
touch ~/.zprofile
|
25
|
+
if [ -z "`grep '\.profile' ~/.zprofile`" ] ; then
|
26
|
+
echo "Adding 'source ~/.profile' to the end of ~/.zprofile."
|
27
|
+
echo "if [ -f ~/.profile ] ; then source ~/.profile ; fi" >> ~/.zprofile
|
28
|
+
fi
|
29
|
+
|
30
|
+
echo -e "\n\e[0;32mOpen a new shell and enjoy rvm: rvm usage\e[0m\n"
|
26
31
|
|