rvm 0.0.40 → 0.0.41
Sign up to get free protection for your applications and to get access to all the features.
- data/config/db +4 -4
- data/rvm.gemspec +2 -2
- data/scripts/rvm-cli +144 -135
- data/scripts/rvm-install +1 -1
- data/scripts/rvm-prompt +1 -1
- data/scripts/rvm-ruby-installer +38 -41
- data/scripts/rvm-selector +8 -10
- data/scripts/rvm-update +1 -1
- data/scripts/rvm-utility +91 -90
- metadata +2 -2
data/config/db
CHANGED
@@ -13,8 +13,8 @@ ree_interpreter=ruby-enterprise
|
|
13
13
|
ree_version=1.8.6
|
14
14
|
ree_patch_level=20090610
|
15
15
|
macruby_version=2009-09-04
|
16
|
-
ruby_1.9.1_patch_level=
|
16
|
+
ruby_1.9.1_patch_level=243
|
17
17
|
ruby_1.9.2_patch_level=preview1
|
18
|
-
ruby_1.8.5_patch_level=
|
19
|
-
ruby_1.8.6_patch_level=
|
20
|
-
ruby_1.8.7_patch_level=
|
18
|
+
ruby_1.8.5_patch_level=115
|
19
|
+
ruby_1.8.6_patch_level=383
|
20
|
+
ruby_1.8.7_patch_level=174
|
data/rvm.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rvm}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.41"
|
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-09-
|
12
|
+
s.date = %q{2009-09-16}
|
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}
|
data/scripts/rvm-cli
CHANGED
@@ -5,7 +5,7 @@ function __rvm_meta {
|
|
5
5
|
rvm_meta_author_email="wayneeseguin@gmail.com"
|
6
6
|
rvm_meta_website="http://rvm.beginrescueend.com/"
|
7
7
|
rvm_meta_version="`cat $rvm_path/VERSION.yml | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//'`"
|
8
|
-
rvm_meta_updated="2009.09.
|
8
|
+
rvm_meta_updated="2009.09.16"
|
9
9
|
}
|
10
10
|
|
11
11
|
function __rvm_version { __rvm_meta ; echo "rvm $rvm_meta_version ($rvm_meta_updated) [$rvm_meta_website]" ; }
|
@@ -20,7 +20,7 @@ function __rvm_usage {
|
|
20
20
|
|
21
21
|
Usage:
|
22
22
|
|
23
|
-
rvm Action [Implementation] [Options]
|
23
|
+
rvm Action [Implementation] [Options] [Flags]
|
24
24
|
|
25
25
|
Action:
|
26
26
|
|
@@ -43,6 +43,8 @@ function __rvm_usage {
|
|
43
43
|
reload - Reload rvm source itself (useful after changing rvm source)
|
44
44
|
implode - Removes all ruby installations it manages, everything in ~/.rvm
|
45
45
|
update - Upgrades rvm to the latest version.
|
46
|
+
tests - run 'rake test' across selected ruby versions
|
47
|
+
specs - run 'rake spec' across selected ruby versions
|
46
48
|
|
47
49
|
Implementation:
|
48
50
|
|
@@ -55,41 +57,43 @@ function __rvm_usage {
|
|
55
57
|
|
56
58
|
Options:
|
57
59
|
|
58
|
-
-v|--version -
|
59
|
-
-l|--level - Patch level for the specified Ruby version
|
60
|
-
-p|--prefix - Package and source directory prefix, with trailing slash!
|
61
|
-
Default is a users home directory and /usr/local/ for root
|
62
|
-
-a|--archives - Directory to place downladed files into (~/.rvm/archives/)
|
63
|
-
-n|--nice - Specify a process niceness (for slow computers, default 0)
|
64
|
-
-m|--gem-set - Named gem set for switching between different gem sets
|
65
|
-
--rm-gem-set - Removes a named gemset.
|
66
|
-
|
67
|
-
-l|--level - Specify a patch level to use
|
68
|
-
-t|--tag -
|
69
|
-
-r|--rev - Specify the repository revision # to use or 'head' for
|
70
|
-
|
71
|
-
-P|--prefix - Sets the prefix path for installs to be installed to
|
72
|
-
--bin - Specify path for binaries to be placed
|
73
|
-
--source - Specify src directory to use
|
74
|
-
--archive - Specify archive directory to use (tabralls / zips)
|
75
|
-
-G|--gems - Specify root gem path to use
|
76
|
-
-C|--configure - Specify custom configure options, comma separated
|
77
|
-
default: --enable-shared=true
|
78
|
-
--re-configure - Force installer to re-run configure if already run
|
79
|
-
-M|--make - Specify a custom make command
|
80
|
-
-I|--make-install - " a custom make install command
|
81
|
-
|
82
|
-
-f|--file - Specify a ruby file to run with 'rubydo' command
|
60
|
+
-v|--version - Emit rvm version loaded for current shell
|
83
61
|
-h|--help - Emit this output and exit
|
84
|
-
-
|
85
|
-
|
62
|
+
-l|--level - patch level to use with rvm use / install
|
63
|
+
--tag - subersion tag to use
|
64
|
+
--rev - repository revision # to use or 'head' for
|
65
|
+
|
66
|
+
--prefix - path for all rvm files (~/.rvm/), with trailing slash!
|
67
|
+
--bin - path for binaries to be placed (~/.rvm/bin/)
|
68
|
+
--source - src directory to use (~/.rvm/src/)
|
69
|
+
--archives - directory for downladed files (~/.rvm/archives/)
|
86
70
|
-S|--script - Specify a script file to attempt to load and run (rubydo)
|
87
|
-
|
71
|
+
-G|--gems - root gem path to use
|
72
|
+
-C|--configure - custom configure options, comma separated
|
73
|
+
default: --enable-shared=true
|
74
|
+
--reconfigure - Force installer to re-run configure if already run
|
75
|
+
--make - custom make command
|
76
|
+
--make-install - custom make install command
|
77
|
+
--nice - process niceness (for slow computers, default 0)
|
78
|
+
-m|--gem-set - use a named gem set, instead of the default set.
|
88
79
|
--rm-gem-set - Remove a named gem set
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
--
|
80
|
+
|
81
|
+
Flags
|
82
|
+
|
83
|
+
--self - with update, updates rvm itself
|
84
|
+
--rubygems - with update, updates rubygems for selected ruby
|
85
|
+
--default - with ruby select, sets a default ruby for new shells.
|
86
|
+
--debug - Toggle debug mode on for very verbose output.
|
87
|
+
--force - Force install, removes old install & source before install.
|
88
|
+
--all - Used with 'rvm list' to display "most" available versions.
|
89
|
+
--dump - Used with gemset to dump the current ruby's gemset.
|
90
|
+
--load - Used with gemset to load a specified gemset file
|
91
|
+
--summary - Used with rubydo to print out a summary of the commands run.
|
92
|
+
--jit - Used with rubinius install to build with JIT
|
93
|
+
--latest - with gemset --dump skips version strings for latest gem.
|
94
|
+
--reconfigure -
|
95
|
+
--spec -
|
96
|
+
--test -
|
93
97
|
|
94
98
|
Resources:
|
95
99
|
|
@@ -166,45 +170,49 @@ function __rvm_parse-args {
|
|
166
170
|
;;
|
167
171
|
|
168
172
|
1.8|1.8.0|1.8.1|1.8.2|1.8.3|1.8.4|1.8.5|1.8.6|1.8.7|1.9|1.9.1|1.9.2)
|
169
|
-
|
170
|
-
|
171
|
-
|
173
|
+
rvm_ruby_interpreter="ruby"
|
174
|
+
rvm_ruby_version="$rvm_token"
|
175
|
+
rvm_action="${rvm_action:-use}"
|
172
176
|
;;
|
173
177
|
|
174
178
|
1.2.0|1.3.1)
|
175
|
-
|
176
|
-
|
177
|
-
|
179
|
+
rvm_ruby_interpreter="jruby"
|
180
|
+
rvm_ruby_version="$rvm_token"
|
181
|
+
rvm_action="${rvm_action:-use}"
|
178
182
|
;;
|
179
183
|
|
180
184
|
-v|--version)
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
185
|
+
if [ -z "$1" ] ; then
|
186
|
+
rvm_action="version"
|
187
|
+
else
|
188
|
+
rvm_ruby_version="$1"
|
189
|
+
shift
|
190
|
+
fi
|
191
|
+
;;
|
192
|
+
|
193
|
+
-t|--tag)
|
194
|
+
rvm_ruby_tag="$1";
|
195
|
+
rvm_action="${rvm_action:-use}"
|
196
|
+
shift
|
187
197
|
;;
|
188
198
|
|
189
|
-
-t|--tag) rvm_ruby_tag="$1";
|
190
|
-
rvm_action="${rvm_action:-use}"
|
191
|
-
shift ;;
|
192
199
|
--head)
|
193
|
-
|
194
|
-
|
200
|
+
rvm_ruby_rev="head"
|
201
|
+
rvm_action="${rvm_action:-use}"
|
195
202
|
;;
|
196
|
-
--rev|--revision) rvm_ruby_rev="$1";
|
197
|
-
rvm_action="${rvm_action:-use}"
|
198
|
-
shift ;;
|
199
|
-
-b|--branch) rvm_ruby_branch="$1";
|
200
|
-
rvm_action="${rvm_action:-use}"
|
201
|
-
shift ;;
|
202
203
|
|
204
|
+
--rev|--revision)
|
205
|
+
rvm_ruby_rev="$1";
|
206
|
+
rvm_action="${rvm_action:-use}"
|
207
|
+
shift
|
208
|
+
;;
|
203
209
|
|
204
|
-
-
|
210
|
+
-b|--branch)
|
211
|
+
rvm_ruby_branch="$1";
|
212
|
+
rvm_action="${rvm_action:-use}"
|
213
|
+
shift
|
214
|
+
;;
|
205
215
|
|
206
|
-
--rubygems) rvm_rubygems_flag=1 ;;
|
207
|
-
--rvm|--gem) rvm_update_flag=1 ;;
|
208
216
|
--bin)
|
209
217
|
if [ "$rvm_action" = "update" ] ; then
|
210
218
|
rvm_bin_flag=1
|
@@ -213,34 +221,27 @@ function __rvm_parse-args {
|
|
213
221
|
fi
|
214
222
|
;;
|
215
223
|
|
216
|
-
|
217
|
-
--archive) rvm_archives_path="$1" ; shift ;;
|
218
|
-
-G|--gems) rvm_gem_path="$1" ; shift ;;
|
219
|
-
-C|--configure)
|
224
|
+
-j)
|
220
225
|
if [ ! -z "$1" ] ; then
|
221
|
-
|
226
|
+
rvm_make_flags="$rvm_make_flags -j$1"
|
222
227
|
shift
|
223
228
|
else
|
224
229
|
rvm_action="error"
|
225
|
-
rvm_error_message="
|
230
|
+
rvm_error_message="-j *must* be followed by an integer (normally the # of CPU's in your machine)."
|
226
231
|
fi
|
227
232
|
;;
|
228
233
|
|
229
|
-
|
230
|
-
|
231
|
-
--make-install) rvm_ruby_make_install="$1"; shift ;;
|
232
|
-
-j)
|
234
|
+
|
235
|
+
-C|--configure)
|
233
236
|
if [ ! -z "$1" ] ; then
|
234
|
-
|
237
|
+
rvm_ruby_configure="$(echo $1 | tr ',' ' ')"
|
235
238
|
shift
|
236
239
|
else
|
237
240
|
rvm_action="error"
|
238
|
-
rvm_error_message="
|
241
|
+
rvm_error_message="--configure *must* be followed by configure flags."
|
239
242
|
fi
|
240
243
|
;;
|
241
|
-
|
242
|
-
-l|--level) rvm_ruby_patch_level="$1" ; shift ;;
|
243
|
-
--summary) rvm_summary=1 ;;
|
244
|
+
|
244
245
|
-r|--require)
|
245
246
|
if [ -z "$1" ] ; then
|
246
247
|
rvm_action="error"
|
@@ -250,6 +251,7 @@ function __rvm_parse-args {
|
|
250
251
|
shift
|
251
252
|
fi
|
252
253
|
;;
|
254
|
+
|
253
255
|
-I|--include)
|
254
256
|
if [ -z "$1" ] ; then
|
255
257
|
rvm_action="error"
|
@@ -259,47 +261,53 @@ function __rvm_parse-args {
|
|
259
261
|
shift
|
260
262
|
fi
|
261
263
|
;;
|
264
|
+
|
262
265
|
-f|--file)
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
+
rvm_action="rubydo"
|
267
|
+
rvm_ruby_args="$1"
|
268
|
+
shift
|
266
269
|
;;
|
270
|
+
|
267
271
|
-S|--script|-e|--execute)
|
268
|
-
|
269
|
-
|
270
|
-
|
272
|
+
rvm_action="rubydo"
|
273
|
+
rvm_ruby_args="$@"
|
274
|
+
rvm_parse_break=1
|
271
275
|
;;
|
272
276
|
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
if [ ! -z "$1" ] ; then
|
284
|
-
rvm_load_file="$1"
|
285
|
-
shift
|
286
|
-
else
|
287
|
-
rvm_action="error"
|
288
|
-
rvm_error_message="--load must be followed by the .gemset file to load."
|
289
|
-
break;
|
290
|
-
fi
|
291
|
-
shift
|
277
|
+
--load)
|
278
|
+
rvm_load_flag=1
|
279
|
+
if [ ! -z "$1" ] ; then
|
280
|
+
rvm_load_file="$1"
|
281
|
+
shift
|
282
|
+
else
|
283
|
+
rvm_action="error"
|
284
|
+
rvm_error_message="--load must be followed by the .gemset file to load."
|
285
|
+
break;
|
286
|
+
fi
|
292
287
|
;;
|
293
288
|
|
294
|
-
--jit) rvm_rubinius_jit="RBX_LLVM=1" ;;
|
295
|
-
--latest) rvm_latest=1 ;;
|
296
|
-
--tests|--specs) rvm_action="tests" ;;
|
297
|
-
|
298
289
|
default|system)
|
299
290
|
rvm_action="use"
|
300
291
|
rvm_ruby_interpreter="system"
|
301
292
|
;;
|
302
293
|
|
294
|
+
--prefix) rvm_prefix_path="$1" ; shift ;;
|
295
|
+
-G|--gems) rvm_gem_path="$1" ; shift ;;
|
296
|
+
--source) rvm_source_path="$1" ; shift ;;
|
297
|
+
--archives) rvm_archives_path="$1" ; shift ;;
|
298
|
+
--make) rvm_ruby_make="$1" ; shift ;;
|
299
|
+
--make-install) rvm_ruby_make_install="$1"; shift ;;
|
300
|
+
--nice) rvm_niceness="$1" ; shift ;;
|
301
|
+
-l|--level) rvm_ruby_patch_level="$1" ; shift ;;
|
302
|
+
-h|--help) rvm_action=help ; shift ;;
|
303
|
+
-m|--gem-set) rvm_gem_set_name="$1" ; shift ;;
|
304
|
+
--rm-gem-set) rvm_gem_set_name_rm="$1" ; shift ;;
|
305
|
+
tests|specs) rvm_action="tests" ;;
|
306
|
+
|
307
|
+
--self|--gem|--rubygems|--reconfigure|--default|--debug|debug|--force|--all|--dump|--summary|--jit|--latest|--spec|--test)
|
308
|
+
eval "rvm_$(echo $rvm_token | sed 's/-//g')_flag=1"
|
309
|
+
;;
|
310
|
+
|
303
311
|
reboot|flush|asdf|damnit|wtf|argh|work|workdamnit|BOOM|boom|wth)
|
304
312
|
$rvm_action="reboot"
|
305
313
|
;;
|
@@ -337,8 +345,6 @@ function __rvm_parse-args {
|
|
337
345
|
done
|
338
346
|
|
339
347
|
if [ ! -z "$rvm_error_message" ] ; then popd 2> /dev/null ; return 1 ; fi
|
340
|
-
if [ -z "$rvm_debug" ] ; then set +x ; else set -x ; fi
|
341
|
-
|
342
348
|
}
|
343
349
|
|
344
350
|
function rvm {
|
@@ -349,38 +355,42 @@ function rvm {
|
|
349
355
|
__rvm_load-defaults
|
350
356
|
__rvm_parse-args $@
|
351
357
|
|
352
|
-
|
358
|
+
if [ -z "$rvm_debug_flag" ] ; then set +x ; else set -x ; fi
|
359
|
+
result=0
|
353
360
|
case "$rvm_action" in
|
354
|
-
install)
|
355
|
-
uninstall)
|
356
|
-
use)
|
357
|
-
gemdir)
|
358
|
-
srcdir)
|
359
|
-
gemdup)
|
360
|
-
list)
|
361
|
-
symlinks)
|
362
|
-
version)
|
361
|
+
install) __rvm_install-ruby ; result=$? ;;
|
362
|
+
uninstall) __rvm_uninstall ; result=$? ;;
|
363
|
+
use) __rvm_use ; result=$? ;;
|
364
|
+
gemdir) __rvm_gem-dir ; result=$? ;;
|
365
|
+
srcdir) __rvm_src-dir ; result=$? ;;
|
366
|
+
gemdup) __rvm_gem-dup ; result=$? ;;
|
367
|
+
list) __rvm_list ; result=$? ;;
|
368
|
+
symlinks) __rvm_symlinks ; result=$? ;;
|
369
|
+
version) __rvm_version ; result=$? ;;
|
370
|
+
reset) __rvm_reset ; result=$? ;;
|
371
|
+
# TODO: how can we use bin_path here for reload, default file?
|
372
|
+
reload) __rvm_reload ; result=$? ;;
|
373
|
+
implode) __rvm_implode ; result=$? ;;
|
374
|
+
update) __rvm_update ; result=$? ;;
|
375
|
+
readline) __rvm_readline_install ; result=$? ;;
|
376
|
+
iconv) __rvm_iconv_install ; result=$? ;;
|
377
|
+
reboot) __rvm_reboot ; result=$? ;;
|
378
|
+
usage|help) __rvm_usage ; result=$? ;;
|
379
|
+
rubydo|rakedo|gemdo) __rvm_do ; result=$? ;;
|
380
|
+
|
363
381
|
tests|specs)
|
364
|
-
|
382
|
+
rvm_summary_flag=1
|
365
383
|
rvm_action="rake"
|
366
384
|
__rvm_do
|
367
385
|
;;
|
368
|
-
|
369
|
-
reset) __rvm_reset ;;
|
370
|
-
# TODO: how can we use bin_path here for reload, default file?
|
371
|
-
reload) __rvm_reload ;;
|
372
|
-
implode) __rvm_implode ;;
|
373
|
-
update) __rvm_update ;;
|
374
|
-
readline) __rvm_readline_install ;;
|
375
|
-
iconv) __rvm_iconv_install ;;
|
376
|
-
reboot) __rvm_reboot ;;
|
377
|
-
usage|help) __rvm_usage ;;
|
386
|
+
|
378
387
|
info|debug)
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
388
|
+
__rvm_version
|
389
|
+
__rvm_info
|
390
|
+
if [ "$rvm_action" = "debug" ] ; then __rvm_debug ; fi
|
391
|
+
result=0
|
383
392
|
;;
|
393
|
+
|
384
394
|
error) __rvm_log "fail" "$rvm_error_message ( see: 'rvm usage' )" ; popd 2> /dev/null ; return 1; ;;
|
385
395
|
*)
|
386
396
|
if [ ! -z "$rvm_action" ] ; then
|
@@ -388,11 +398,10 @@ function rvm {
|
|
388
398
|
else
|
389
399
|
__rvm_usage
|
390
400
|
fi
|
391
|
-
|
401
|
+
result=1
|
392
402
|
esac
|
393
|
-
|
394
|
-
|
395
|
-
return $status
|
403
|
+
if [ "$rvm_debug_flag" = "1" ] ; then set +x ; unset rvm_debug_flag ; fi
|
404
|
+
return $result
|
396
405
|
}
|
397
406
|
|
398
407
|
|
data/scripts/rvm-install
CHANGED
@@ -136,7 +136,7 @@ if [ "$system" = "Linux" ] ; then
|
|
136
136
|
echo -e "\033[0;33m <w> \033[0mFor jRuby (if you wish to use it) you will need:"
|
137
137
|
echo -e "\033[0;32m <i> \033[0msudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk"
|
138
138
|
echo -e "\033[0;33m <w> \033[0mFor ree (if you wish to use it) you will need:"
|
139
|
-
echo -e "\033[0;32m <i> \033[0msudo apt-get install libreadline5-dev libssl-dev "
|
139
|
+
echo -e "\033[0;32m <i> \033[0msudo apt-get install libreadline5-dev libssl-dev bison"
|
140
140
|
|
141
141
|
elif [ ! -z "$rvm_emerge_binary" ] ; then
|
142
142
|
echo -e "\033[0;33m <w> \033[0mFor jRuby (if you wish to use it) you will need:"
|
data/scripts/rvm-prompt
CHANGED
data/scripts/rvm-ruby-installer
CHANGED
@@ -4,13 +4,13 @@ function __rvm_install-source {
|
|
4
4
|
|
5
5
|
if [ -z "$rvm_selected" ] ; then __rvm_select $* ; fi
|
6
6
|
|
7
|
-
|
7
|
+
result=0
|
8
8
|
__rvm_log "info" "Installing Ruby from source to: $rvm_ruby_home"
|
9
9
|
mkdir -p $rvm_ruby_log_path
|
10
10
|
|
11
11
|
pushd $rvm_source_path > /dev/null
|
12
12
|
|
13
|
-
if [ ! -z "$
|
13
|
+
if [ ! -z "$rvm_force_flag" ] ; then
|
14
14
|
rm -rf $rvm_ruby_home
|
15
15
|
rm -rf $rvm_ruby_src_path
|
16
16
|
fi
|
@@ -20,11 +20,11 @@ function __rvm_install-source {
|
|
20
20
|
rvm_url="${rvm_url:-"ftp://ftp.ruby-lang.org/pub/ruby/1.$rvm_major_version/$rvm_ruby_package_name.tar.gz"}"
|
21
21
|
__rvm_log "info" "\tDownloading $rvm_ruby_package_name, this may take a while depending on your connection..."
|
22
22
|
__rvm_fetch $rvm_url
|
23
|
-
if [ $? -gt 0 ] ; then
|
23
|
+
if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
|
24
24
|
__rvm_log "info" "\tExtracting $rvm_ruby_package_name ..."
|
25
25
|
mkdir -p $rvm_ruby_src_path # Is this line necessary considering -C below? v
|
26
26
|
__rvm_run "extract" tar xzf $rvm_archives_path/$rvm_ruby_package_name.tar.gz -C $rvm_source_path
|
27
|
-
if [ $? -gt 0 ] ; then
|
27
|
+
if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
|
28
28
|
fi
|
29
29
|
else
|
30
30
|
__rvm_log "info" "\tRetrieving Ruby from $rvm_url"
|
@@ -33,14 +33,14 @@ function __rvm_install-source {
|
|
33
33
|
cd $rvm_ruby_src_path
|
34
34
|
if [ -z "$rvm_ruby_rev" ] ; then
|
35
35
|
git pull origin master
|
36
|
-
if [ $? -gt 0 ] ; then
|
36
|
+
if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
|
37
37
|
else
|
38
38
|
git checkout ${rvm_ruby_rev:-HEAD}
|
39
|
-
if [ $? -gt 0 ] ; then
|
39
|
+
if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
|
40
40
|
fi
|
41
41
|
else
|
42
42
|
git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_src_path
|
43
|
-
if [ $? -gt 0 ] ; then
|
43
|
+
if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
|
44
44
|
fi
|
45
45
|
else
|
46
46
|
if [ -z "$rvm_ruby_rev" ] ; then
|
@@ -67,36 +67,33 @@ function __rvm_install-source {
|
|
67
67
|
else
|
68
68
|
svn checkout -q $rvm_rev --force $rvm_url $rvm_ruby_src_path
|
69
69
|
fi
|
70
|
-
if [ $? -gt 0 ] ; then
|
70
|
+
if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
|
71
71
|
fi
|
72
72
|
fi
|
73
73
|
|
74
74
|
cd $rvm_ruby_src_path
|
75
|
-
if [ $? -gt 0 ] ; then
|
76
|
-
|
77
|
-
# Readline
|
78
|
-
if [ ! -d $rvm_path/usr/include/readline ] ; then __rvm_readline_install ; fi
|
75
|
+
if [ $? -gt 0 ] ; then result=$? ; __rvm_log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log" ; popd > /dev/null ; return $result ; fi
|
79
76
|
|
80
77
|
if [ ! -s "$rvm_ruby_src_path/configure" -a "$rvm_ruby_interpreter" = "ruby" ] ; then
|
81
78
|
rvm_autoconf=`which autoconf`
|
82
|
-
if [ $? -gt 0 ] ; then __rvm_log "fail" "rvm expects autoconf" ;
|
79
|
+
if [ $? -gt 0 ] ; then __rvm_log "fail" "rvm expects autoconf" ; result=$? ; return $result ; fi
|
83
80
|
__rvm_run "autoconf" $rvm_autoconf
|
84
|
-
if [ $? -gt 0 ] ; then
|
81
|
+
if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
|
85
82
|
fi
|
86
83
|
|
87
|
-
if [ -s ./Makefile -a -z "$
|
84
|
+
if [ -s ./Makefile -a -z "$rvm_reconfigure_flag" ] ; then
|
88
85
|
__rvm_log "warn" "\tSkipping configure step, Makefile exists so configure must have already been run."
|
89
86
|
elif [ -s ./configure ] ; then
|
90
87
|
__rvm_log "info" "\tConfiguring $rvm_ruby_package_name using $rvm_ruby_configure, this may take a while depending on your cpu(s)..."
|
91
88
|
if [ -d $rvm_path/usr/include/readline/ ] ; then
|
92
|
-
|
89
|
+
configure_parameters="$configure_parameters --with-readline-dir=$rvm_path/usr/include/readline/"
|
93
90
|
fi
|
94
91
|
if [ -d $rvm_path/usr/include/iconv/ ] ; then
|
95
|
-
|
92
|
+
configure_parameters="$configure_parameters --with-iconv-dir=$rvm_path/usr/include/iconv/"
|
96
93
|
fi
|
97
|
-
__rvm_run "configure" "./configure --prefix=$rvm_ruby_home
|
98
|
-
unset
|
99
|
-
if [ $? -gt 0 ] ; then
|
94
|
+
__rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure $configure_parameters"
|
95
|
+
unset configure_parameters
|
96
|
+
if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
|
100
97
|
else
|
101
98
|
__rvm_log "error" "\tSkipping configure step, 'configure' script does not exist, did autoconf not run successfully?"
|
102
99
|
fi
|
@@ -107,7 +104,7 @@ function __rvm_install-source {
|
|
107
104
|
else
|
108
105
|
__rvm_run "make" $rvm_ruby_make
|
109
106
|
fi
|
110
|
-
if [ $? -gt 0 ] ; then
|
107
|
+
if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
|
111
108
|
|
112
109
|
if [ -z "$rvm_ruby_make" ] ; then
|
113
110
|
__rvm_log "info" "\tInstalling $rvm_ruby_package_name"
|
@@ -115,16 +112,16 @@ function __rvm_install-source {
|
|
115
112
|
else
|
116
113
|
__rvm_run "install" $rvm_ruby_make_install
|
117
114
|
fi
|
118
|
-
if [ $? -gt 0 ] ; then
|
115
|
+
if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
|
119
116
|
|
120
|
-
__rvm_run "chmod.bin" chmod +x $rvm_ruby_home/bin/*
|
121
|
-
__rvm_bin_script
|
122
117
|
__rvm_log "info" "Installation of $rvm_ruby_package_name is complete."
|
123
118
|
|
124
119
|
GEM_HOME="$rvm_gem_home" ; export GEM_HOME
|
125
120
|
GEM_PATH="$rvm_gem_home" ; export GEM_PATH
|
126
121
|
|
127
122
|
__rvm_rubygems_setup
|
123
|
+
__rvm_bin_script
|
124
|
+
__rvm_run "chmod.bin" chmod +x $rvm_ruby_home/bin/*
|
128
125
|
|
129
126
|
popd > /dev/null
|
130
127
|
|
@@ -195,8 +192,8 @@ function __rvm_install-ruby {
|
|
195
192
|
__rvm_run "install" ./installer -a $rvm_path/ruby-enterprise-$rvm_ruby_version-$rvm_ruby_patch_level --dont-install-useful-gems --no-tcmalloc $rvm_ruby_configure
|
196
193
|
chmod +x $rvm_ruby_home/bin/*
|
197
194
|
|
198
|
-
__rvm_bin_script
|
199
195
|
__rvm_rubygems_setup
|
196
|
+
__rvm_bin_script
|
200
197
|
|
201
198
|
popd > /dev/null
|
202
199
|
|
@@ -219,17 +216,20 @@ function __rvm_install-ruby {
|
|
219
216
|
#rvm_ruby_rev="head"
|
220
217
|
# TODO: Check if already git repo, then git pull origin master && build
|
221
218
|
|
222
|
-
__rvm_bin_script
|
223
|
-
|
224
219
|
if [ ! -d $rvm_ruby_home -o ! -d $rvm_ruby_home/.git ] ; then
|
225
220
|
rm -rf $rvm_ruby_home
|
226
221
|
git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_home
|
227
222
|
fi
|
228
223
|
cd $rvm_ruby_home
|
229
|
-
|
224
|
+
if [ ! -z "$rvm_jit_flag" ]; then
|
225
|
+
__rvm_run "build" RBX_LLVM=1 rake build
|
226
|
+
else
|
227
|
+
__rvm_run "build" rake build
|
228
|
+
fi
|
230
229
|
for binary in ruby irb ; do
|
231
230
|
ln -fs $rvm_ruby_home/bin/rbx $rvm_ruby_home/bin/$binary
|
232
231
|
done
|
232
|
+
__rvm_bin_script
|
233
233
|
;;
|
234
234
|
|
235
235
|
jruby)
|
@@ -273,10 +273,12 @@ function __rvm_install-ruby {
|
|
273
273
|
ln -fs $rvm_ruby_home/bin/$binary $rvm_ruby_home/bin/${binary#j}
|
274
274
|
done
|
275
275
|
|
276
|
+
__rvm_bin_script
|
277
|
+
|
276
278
|
ln -fs $rvm_ruby_home/bin/ruby $rvm_path/bin/$rvm_ruby_package_name
|
277
279
|
for rvm_gem_name in rake jruby-openssl ; do
|
278
280
|
__rvm_log "info" "Installing $rvm_gem_name"
|
279
|
-
__rvm_run "gems" $rvm_ruby_home/bin/
|
281
|
+
__rvm_run "gems" $rvm_ruby_home/bin/gem install $rvm_gem_name --no-rdoc --no-ri -q
|
280
282
|
done
|
281
283
|
;;
|
282
284
|
|
@@ -348,9 +350,9 @@ function __rvm_post_install {
|
|
348
350
|
__rvm_log "info" "Installation of gems for $rvm_ruby_package_name is complete."
|
349
351
|
|
350
352
|
binary=rake
|
351
|
-
if [ -x $
|
352
|
-
if [ "$
|
353
|
-
cp $
|
353
|
+
if [ -x $rvm_gem_home/bin/$binary ] ; then
|
354
|
+
if [ "$rvm_gem_home" != "$rvm_ruby_home" ] ; then
|
355
|
+
cp $rvm_gem_home/bin/$binary $rvm_ruby_home/bin/$binary
|
354
356
|
fi
|
355
357
|
# TODO: Account for rubygem installed rake vs system rake
|
356
358
|
string="ENV['GEM_HOME']=ENV['GEM_HOME'] || '$rvm_gem_home'\nENV['GEM_PATH']=ENV['GEM_PATH'] || '$rvm_gem_home'\nENV['PATH']='$rvm_ruby_home/bin:$rvm_gem_home/bin:' + ENV['PATH']"
|
@@ -376,16 +378,11 @@ function __rvm_rubygems_setup {
|
|
376
378
|
mkdir -p $rvm_source_path/$rvm_gem_package_name
|
377
379
|
__rvm_run "rubygems.extract" tar zxf $rvm_archives_path/$rvm_gem_package_name.tgz -C $rvm_source_path
|
378
380
|
fi
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
#rm -f $rvm_source_path/$rvm_gem_package_name/lib/rubygems/gem_path_searcher.rb.orig
|
383
|
-
__rvm_run "rubygems.install" GEM_HOME=$rvm_gem_path GEM_HOME=$rvm_gem_home $rvm_ruby_home/bin/ruby $rvm_source_path/$rvm_gem_package_name/setup.rb
|
384
|
-
status=$?
|
385
|
-
if [ $status -eq 0 ] ; then
|
381
|
+
__rvm_run "rubygems.install" GEM_PATH=$rvm_gem_path GEM_HOME=$rvm_gem_home $rvm_ruby_home/bin/ruby $rvm_source_path/$rvm_gem_package_name/setup.rb
|
382
|
+
result=$?
|
383
|
+
if [ $result -eq 0 ] ; then
|
386
384
|
__rvm_log "info" "Installation of rubygems $rvm_ruby_package_name completed successfully."
|
387
385
|
fi
|
388
|
-
if [ $status -eq 0 ] ; then status=$? ; fi
|
389
386
|
else
|
390
387
|
# 1.9 has it's own built gem command, let's adjust the shebang line.
|
391
388
|
mv $rvm_ruby_src_path/bin/gem $rvm_ruby_src_path/bin/gem.orig
|
@@ -394,6 +391,6 @@ function __rvm_rubygems_setup {
|
|
394
391
|
__rvm_run "rubygems.update" $rvm_ruby_home/bin/gem update --system
|
395
392
|
fi
|
396
393
|
|
397
|
-
return $
|
394
|
+
return $result
|
398
395
|
}
|
399
396
|
|
data/scripts/rvm-selector
CHANGED
@@ -107,9 +107,6 @@ function __rvm_select {
|
|
107
107
|
fi
|
108
108
|
fi
|
109
109
|
|
110
|
-
if [ ! -z "$rvm_load" ] ; then __rvm_gemset_load ; fi
|
111
|
-
if [ ! -z "$rvm_dump" ] ; then __rvm_gemset_dump ; fi
|
112
|
-
|
113
110
|
mkdir -p $rvm_gem_home
|
114
111
|
|
115
112
|
if [ -z "$rvm_ruby_patch_level" ] ; then
|
@@ -119,6 +116,7 @@ function __rvm_select {
|
|
119
116
|
if [ "`echo $rvm_ruby_patch_level | awk '{print substr($1, 0, 1)}'`" != "p" ] ; then
|
120
117
|
rvm_ruby_patch_level="p$rvm_ruby_patch_level"
|
121
118
|
fi
|
119
|
+
rvm_ruby_patch_level="`echo $rvm_ruby_patch_level | sed 's/^pp/p/'`" # sanity check, thanks sfpyra
|
122
120
|
rvm_ruby_package_name="${rvm_ruby_package_name:-"$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level"}"
|
123
121
|
rvm_ruby_home="${rvm_ruby_home:-"$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level"}"
|
124
122
|
fi
|
@@ -131,6 +129,9 @@ function __rvm_select {
|
|
131
129
|
|
132
130
|
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 rvm_ruby_string
|
133
131
|
|
132
|
+
if [ ! -z "$rvm_load_flag" ] ; then __rvm_gemset_load ; fi
|
133
|
+
if [ ! -z "$rvm_dump_flag" ] ; then __rvm_gemset_dump ; fi
|
134
|
+
|
134
135
|
else
|
135
136
|
rvm_gem_home=$GEM_HOME
|
136
137
|
fi
|
@@ -156,6 +157,7 @@ function __rvm_use {
|
|
156
157
|
elif [ "$rvm_ruby_interpreter" = "system" ] ; then
|
157
158
|
|
158
159
|
unset GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC
|
160
|
+
# TODO: Remove .rvm/bin from the path
|
159
161
|
PATH="$rvm_system_path" ; export PATH
|
160
162
|
if [ -s $rvm_path/system ] ; then
|
161
163
|
grep "^MY_RUBY_HOME='$rvm_path" "$rvm_path/system" > /dev/null
|
@@ -191,7 +193,7 @@ function __rvm_use {
|
|
191
193
|
|
192
194
|
PATH="$MY_RUBY_HOME/bin:$GEM_HOME/bin:$rvm_path/bin:$rvm_system_path" ; export PATH
|
193
195
|
|
194
|
-
if [ ! -z "$
|
196
|
+
if [ ! -z "$rvm_default_flag" ] ; then
|
195
197
|
RUBY_VERSION="$($MY_RUBY_HOME/bin/ruby -v | sed 's/^\(.*\) (.*$/\1/')"
|
196
198
|
export GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION
|
197
199
|
|
@@ -213,13 +215,9 @@ function __rvm_use {
|
|
213
215
|
ln -fs $rvm_path/bin/gem-$rvm_ruby_package_name $rvm_path/bin/gem
|
214
216
|
ln -fs $rvm_path/bin/irb-$rvm_ruby_package_name $rvm_path/bin/irb
|
215
217
|
else
|
216
|
-
rm -f $rvm_path/bin/ruby
|
217
|
-
rm -f $rvm_path/bin/default-ruby
|
218
|
-
rm -f $rvm_path/bin/gem
|
219
|
-
rm -f $rvm_path/bin/irb
|
218
|
+
rm -f $rvm_path/bin/ruby $rvm_path/bin/default-ruby $rvm_path/bin/gem $rvm_path/bin/irb
|
220
219
|
fi
|
221
|
-
|
222
|
-
unset rvm_set_default
|
220
|
+
unset rvm_default_flag
|
223
221
|
fi
|
224
222
|
fi
|
225
223
|
}
|
data/scripts/rvm-update
CHANGED
@@ -136,7 +136,7 @@ if [ "$system" = "Linux" ] ; then
|
|
136
136
|
echo -e "\033[0;33m <w> \033[0mFor jRuby (if you wish to use it) you will need:"
|
137
137
|
echo -e "\033[0;32m <i> \033[0msudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk"
|
138
138
|
echo -e "\033[0;33m <w> \033[0mFor ree (if you wish to use it) you will need:"
|
139
|
-
echo -e "\033[0;32m <i> \033[0msudo apt-get install libreadline5-dev libssl-dev "
|
139
|
+
echo -e "\033[0;32m <i> \033[0msudo apt-get install libreadline5-dev libssl-dev bison"
|
140
140
|
|
141
141
|
elif [ ! -z "$rvm_emerge_binary" ] ; then
|
142
142
|
echo -e "\033[0;33m <w> \033[0mFor jRuby (if you wish to use it) you will need:"
|
data/scripts/rvm-utility
CHANGED
@@ -78,7 +78,7 @@ function __rvm_run {
|
|
78
78
|
command="$*"
|
79
79
|
rvm_ruby_log_path=${rvm_ruby_log_path:-$rvm_path/log}
|
80
80
|
mkdir -p $rvm_ruby_log_path
|
81
|
-
if [ $
|
81
|
+
if [ ! -z "$rvm_debug_flag" ] ; then __rvm_log "debug" "Executing: $command" ; fi
|
82
82
|
touch $rvm_ruby_log_path/$log_file_name.log $rvm_ruby_log_path/$log_file_name.error.log # for zsh :(
|
83
83
|
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $command" | tee $rvm_ruby_log_path/$log_file_name.log > $rvm_ruby_log_path/$log_file_name.error.log
|
84
84
|
if [ -z "$rvm_niceness" -o "$rvm_niceness" = "0" ] ; then
|
@@ -91,7 +91,7 @@ function __rvm_run {
|
|
91
91
|
}
|
92
92
|
|
93
93
|
function __rvm_cleanup-variables {
|
94
|
-
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
|
94
|
+
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_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_ruby_tag rvm_ruby_rev rvm_url rvm_ruby_make rvm_ruby_configure rvm_ruby_make_install rvm_config_path rvm_ruby_string rvm_bin_path rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag
|
95
95
|
}
|
96
96
|
|
97
97
|
# TODO: root user loadng of /etc/rvmrc
|
@@ -133,16 +133,16 @@ function __rvm_fetch {
|
|
133
133
|
|
134
134
|
pushd $rvm_archives_path > /dev/null
|
135
135
|
eval $rvm_fetch "$1"
|
136
|
-
|
137
|
-
if [ $
|
138
|
-
if [ $
|
136
|
+
result=$?
|
137
|
+
if [ $result -gt 0 ] ; then
|
138
|
+
if [ $result -eq 78 ] ; then
|
139
139
|
__rvm_log "error" "The requested url does not exist: '$1'"
|
140
140
|
else
|
141
141
|
__rvm_log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log"
|
142
142
|
fi
|
143
143
|
fi
|
144
144
|
popd 2> /dev/null
|
145
|
-
return $
|
145
|
+
return $result
|
146
146
|
}
|
147
147
|
|
148
148
|
function __rvm_load-defaults {
|
@@ -326,7 +326,7 @@ function __rvm_symlinks {
|
|
326
326
|
|
327
327
|
function __rvm_list {
|
328
328
|
|
329
|
-
if [ "$
|
329
|
+
if [ "$rvm_all_flag" ] ; then
|
330
330
|
svn list http://svn.ruby-lang.org/repos/ruby/tags/ | grep 'v1_[8|9]' | sed 's/^v1_//' | sed 's/\/$//' | awk -F'_' '{print "1."$1"."$2 " -l "$3}' | sed 's/p$//'
|
331
331
|
|
332
332
|
echo "jruby 1.2.0"
|
@@ -407,10 +407,10 @@ function __rvm_initialize {
|
|
407
407
|
if [ $? -ne 0 ] ; then
|
408
408
|
__rvm_log "fail" "rvm expects either curl or wget, neither seem to be in your path :("
|
409
409
|
else
|
410
|
-
rvm_fetch="wget -
|
410
|
+
rvm_fetch="wget -c " # -q for quiet
|
411
411
|
fi
|
412
412
|
else
|
413
|
-
rvm_fetch="$rvm_fetch -O -L
|
413
|
+
rvm_fetch="$rvm_fetch -O -L --create-dirs -C - " # -s for silent
|
414
414
|
fi
|
415
415
|
|
416
416
|
# TODO: Sanitize user input, ensure that there is a / a the end...
|
@@ -447,17 +447,18 @@ function __rvm_initialize {
|
|
447
447
|
PATH=$rvm_bin_path:$PATH ; export PATH
|
448
448
|
fi
|
449
449
|
|
450
|
-
mkdir -p $rvm_source_path $rvm_bin_path $rvm_archives_path
|
450
|
+
mkdir -p $rvm_source_path $rvm_bin_path $rvm_archives_path $rvm_path/tmp
|
451
451
|
}
|
452
452
|
|
453
453
|
function __rvm_update {
|
454
|
-
if [ "$rvm_ruby_rev" = "head" -o "$rvm_update_flag" ] ; then
|
454
|
+
if [ "$rvm_ruby_rev" = "head" -o ! -z "$rvm_self_flag" -o ! -z "$rvm_update_flag" ] ; then
|
455
455
|
__rvm_version
|
456
456
|
__rvm_update_rvm
|
457
457
|
__rvm_version
|
458
458
|
fi
|
459
459
|
__rvm_reload
|
460
460
|
__rvm_select
|
461
|
+
# if [ "$rvm_gem_flag" ] ; then __rvm_gem_scripts ; fi
|
461
462
|
if [ "$rvm_bin_flag" ] ; then __rvm_bin_scripts ; fi
|
462
463
|
if [ "$rvm_rubygems_flag" ] ; then __rvm_rubygems_setup ; fi
|
463
464
|
}
|
@@ -512,8 +513,33 @@ function __rvm_reload {
|
|
512
513
|
source $rvm_path/scripts/rvm
|
513
514
|
}
|
514
515
|
|
516
|
+
function __rvm_ruby_do {
|
517
|
+
__rvm_select
|
518
|
+
__rvm_use
|
519
|
+
#__rvm_
|
520
|
+
binary=`echo $rvm_action | sed 's/do$//'`
|
521
|
+
lp="$rvm_ruby_home/bin:$rvm_ruby_load_path"
|
522
|
+
if [ "$binary" = "ruby" ] ; then
|
523
|
+
rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_require -I$lp -S $rvm_ruby_args"
|
524
|
+
else
|
525
|
+
rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_args"
|
526
|
+
fi
|
527
|
+
echo "$rvm_ruby_string: $($rvm_ruby_home/bin/$binary -v)"
|
528
|
+
eval $rvm_command
|
529
|
+
result=$?
|
530
|
+
if [ $result -eq 0 ]; then
|
531
|
+
successes[${#successes[*]}]=$rvm_ruby_string
|
532
|
+
else
|
533
|
+
errors[${#errors[*]}]=$rvm_ruby_string
|
534
|
+
fi
|
535
|
+
all[${#all[*]}]=$rvm_ruby_string
|
536
|
+
results[${#results[*]}]=$result
|
537
|
+
# TODO: keep track of and re-set the previous selected ruby ;)
|
538
|
+
unset rvm_ruby_interpreter rvm_ruby_patch_level rvm_ruby_version rvm_ruby_package_name rvm_ruby_home rvm_ruby_irbrc rvm_ruby_binary rvm_ruby_string lp
|
539
|
+
}
|
540
|
+
|
515
541
|
function __rvm_do {
|
516
|
-
all=() ; successes=() ; errors=() ;
|
542
|
+
all=() ; successes=() ; errors=() ; results=()
|
517
543
|
# TODO: Extract the common functionality out of the if below
|
518
544
|
if [ ! -z "$rvm_ruby_version" ] ; then
|
519
545
|
rvm_ruby_selectors=$(echo $rvm_ruby_version | tr ',' ' ')
|
@@ -527,68 +553,26 @@ function __rvm_do {
|
|
527
553
|
unset rvm_ruby_version
|
528
554
|
fi
|
529
555
|
unset temp
|
530
|
-
|
531
|
-
__rvm_use
|
532
|
-
#__rvm_
|
533
|
-
binary=`echo $rvm_action | sed 's/do$//'`
|
534
|
-
lp="$rvm_ruby_home/bin:$rvm_ruby_load_path"
|
535
|
-
if [ "$binary" = "ruby" ] ; then
|
536
|
-
rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_require -I$lp -S $rvm_ruby_args"
|
537
|
-
else
|
538
|
-
rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_args"
|
539
|
-
fi
|
540
|
-
echo "$rvm_ruby_string: $($rvm_ruby_home/bin/$binary -v)"
|
541
|
-
eval $rvm_command
|
542
|
-
status=$?
|
543
|
-
if [ $status -eq 0 ]; then
|
544
|
-
successes[${#successes[*]}]=$rvm_ruby_string
|
545
|
-
else
|
546
|
-
errors[${#errors[*]}]=$rvm_ruby_string
|
547
|
-
fi
|
548
|
-
all[${#all[*]}]=$rvm_ruby_string
|
549
|
-
statuses[${#statuses[*]}]=$status
|
550
|
-
# TODO: keep track of and re-set the previous selected ruby ;)
|
551
|
-
unset rvm_ruby_interpreter rvm_ruby_patch_level rvm_ruby_version rvm_ruby_package_name rvm_ruby_home rvm_ruby_irbrc rvm_ruby_binary rvm_ruby_string lp
|
556
|
+
__rvm_ruby_do
|
552
557
|
done
|
553
558
|
else # all
|
554
|
-
rvm_ruby_binaries=`/bin/ls $rvm_path/*/bin/ruby`
|
559
|
+
rvm_ruby_binaries=`/bin/ls $rvm_path/*/bin/ruby 2> /dev/null`
|
555
560
|
for rvm_ruby_binary in $rvm_ruby_binaries ; do
|
556
561
|
if [ -x $rvm_ruby_binary ] ; then
|
557
562
|
rvm_ruby_string=`dirname $rvm_ruby_binary | xargs dirname | xargs basename`
|
558
|
-
|
559
|
-
__rvm_use
|
560
|
-
rvm_ruby_string="$(dirname $rvm_ruby_home/bin/$binary | xargs dirname | xargs basename)"
|
561
|
-
lp="$rvm_ruby_home/bin:$rvm_ruby_load_path"
|
562
|
-
if [ "$binary" = "ruby" ] ; then
|
563
|
-
rvm_command="$rvm_ruby_binary $rvm_ruby_require -I$lp -S $rvm_ruby_args"
|
564
|
-
else
|
565
|
-
rvm_command="$rvm_ruby_binary $rvm_ruby_args"
|
566
|
-
fi
|
567
|
-
echo "$(basename $rvm_ruby_binary):"
|
568
|
-
eval $rvm_command
|
569
|
-
status=$?
|
570
|
-
if [ $status -eq 0 ]; then
|
571
|
-
successes[${#successes[*]}]=$rvm_ruby_string
|
572
|
-
else
|
573
|
-
errors[${#errors[*]}]=$rvm_ruby_string
|
574
|
-
fi
|
575
|
-
all[${#all[*]}]=$rvm_ruby_string
|
576
|
-
statuses[${#statuses[*]}]=$status
|
577
|
-
unset rvm_ruby_interpreter rvm_ruby_patch_level rvm_ruby_version rvm_ruby_package_name rvm_ruby_home rvm_ruby_irbrc rvm_ruby_binary rvm_ruby_string lp
|
563
|
+
__rvm_ruby_do
|
578
564
|
fi
|
579
565
|
done
|
580
566
|
fi
|
581
567
|
|
582
|
-
|
583
|
-
|
584
|
-
if [ ! -z "$rvm_summary" ] ; then
|
568
|
+
if [ ! -z "$rvm_summary_flag" ] ; then
|
569
|
+
export successes errors results
|
585
570
|
echo -e "\n\033[0;32msuccessful (${#successes[*]}) : [ $(echo "${successes[*]}" | sed 's/ /, /g') ]\033[0m"
|
586
571
|
echo -e "\n\033[0;31merrors (${#errors[*]}) : [ $(echo "${errors[*]}" | sed 's/ /, /g') ]\033[0m"
|
587
572
|
echo -e "all (${#all[*]}) : [ $(echo "${all[*]}" | sed 's/ /, /g') ]"
|
588
|
-
echo -e "exit
|
589
|
-
# unset binary successes errors rvm_summary
|
573
|
+
echo -e "exit results: [ $(echo "${results[*]}" | sed 's/ /, /g') ]\n"
|
590
574
|
else
|
591
|
-
unset binary successes errors
|
575
|
+
unset binary successes errors rvm_summary_flag
|
592
576
|
fi
|
593
577
|
return ${#errors[*]}
|
594
578
|
}
|
@@ -621,24 +605,20 @@ Config
|
|
621
605
|
|
622
606
|
function __rvm_ruby_string {
|
623
607
|
if [ "$rvm_ruby_interpreter" = "system" ] ; then
|
624
|
-
rvm_ruby_string
|
608
|
+
unset rvm_ruby_string
|
625
609
|
elif [ ! -z "$rvm_ruby_string" ] ; then
|
626
|
-
echo $rvm_ruby_string |
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
rvm_ruby_interpreter=`echo $rvm_ruby_string | tr '-' ' ' | awk '{print $1}'`
|
631
|
-
fi
|
632
|
-
rvm_ruby_vesion=`echo $rvm_ruby_string | awk -F'-' '{print $(NF-1)}'`
|
633
|
-
revision=`echo $rvm_ruby_string | awk '{print $NF}'`
|
610
|
+
rvm_ruby_string=`echo "$rvm_ruby_string" | sed 's/ruby-enterprise/ree/g'`
|
611
|
+
rvm_ruby_interpreter=`echo $rvm_ruby_string | tr '-' ' ' | awk '{print $1}'`
|
612
|
+
rvm_ruby_vesion=`echo $rvm_ruby_string | awk -F'-' '{print $2}'`
|
613
|
+
revision=`echo $rvm_ruby_string | awk -F'-' '{print $3}'`
|
634
614
|
if [ "$revision" = "head" -o "$revision" = "preview" ] ; then
|
635
615
|
rvm_ruby_revision="$revision"
|
636
616
|
else
|
637
|
-
echo $revision | grep 'p[0-9]\+' > /dev/null
|
617
|
+
echo $revision | grep '^p[0-9]\+' > /dev/null
|
638
618
|
if [ $? -eq 0 ] ; then
|
639
619
|
rvm_ruby_patch_level=`echo $revision | awk -F'p' '{print $2}'`
|
640
620
|
else
|
641
|
-
echo $revision | grep '[0-9]\+' > /dev/null
|
621
|
+
echo $revision | grep '^[0-9]\+' > /dev/null
|
642
622
|
if [ $? -eq 0 ] ; then
|
643
623
|
rvm_ruby_rev="$revision"
|
644
624
|
else
|
@@ -662,7 +642,7 @@ function __rvm_gemset_dump {
|
|
662
642
|
gems="`gem list | sed 's/[\(|\)]//g' | sed 's/, /,/g' | tr ' ' ';'`"
|
663
643
|
for gem in $gems ; do
|
664
644
|
name=`echo $gem | awk -F';' '{print $1}'`
|
665
|
-
if [ -z "$
|
645
|
+
if [ -z "$rvm_latest_flag" ] ; then
|
666
646
|
versions=`echo $gem | awk -F';' '{print $2}' | sed 's/,/ /g'`
|
667
647
|
for version in $versions ; do
|
668
648
|
echo "$name -v$version" >> $file_name.gemset
|
@@ -678,38 +658,59 @@ function __rvm_gemset_dump {
|
|
678
658
|
|
679
659
|
function __rvm_gemset_load {
|
680
660
|
echo "Loading $rvm_load_file file..."
|
681
|
-
|
661
|
+
rvm_ruby_gem_list=`/bin/ls $rvm_gem_home/specifications/ | sed 's/\.gemspec$//' 2> /dev/null`
|
662
|
+
while read line
|
663
|
+
do # Keep this on 2nd line :( bash fail.
|
682
664
|
# TODO: Switch to a different field separator than ; to allow for evals
|
683
665
|
gem=`echo $line | awk -F';' '{print $1}'`
|
684
666
|
gem_prefix=`echo $line | awk -F';' '{print $2}'`
|
685
667
|
gem_name=`echo $gem | awk '{print $1}'`
|
686
668
|
gem_version=`echo $gem | sed 's/^.*-v[=]*[ ]*//' | awk '{print $1}'`
|
687
669
|
gem_postfix=`echo $gem | sed "s/$gem_name//" | sed "s/-v[=]*[ ]*$gem_version//"`
|
688
|
-
gem_file="$gem_name-$gem_version.gem"
|
689
670
|
|
690
671
|
if [ -z "$gem_version" ] ; then # no version
|
691
|
-
|
672
|
+
gem_file_name="${gem_name}*.gem"
|
692
673
|
else # version
|
693
|
-
|
674
|
+
gem_file_name="$gem_name-$gem_version.gem"
|
694
675
|
fi
|
695
|
-
|
696
|
-
if [ -z "$
|
697
|
-
|
676
|
+
cache_file=`/bin/ls -t $rvm_gem_path/*/*/cache/${gem_file_name}* | head -n1 2> /dev/null`
|
677
|
+
if [ -z "$cache_file" ] ; then
|
678
|
+
if [ -z "$gem_version" ] ; then
|
679
|
+
gem="$gem_name"
|
680
|
+
else
|
681
|
+
gem="$gem_name -v $gem_version"
|
682
|
+
fi
|
698
683
|
else # cached
|
699
|
-
|
684
|
+
gem_file_name=`basename $cache_file`
|
685
|
+
gem_string=`echo "$gem_file_name" | sed 's/\.gem$//'`
|
686
|
+
if [ ! -z "`echo "$rvm_ruby_gem_list" | awk "/$gem_string/{print}"`" ] ; then
|
687
|
+
if [ ! -z "$rvm_force_flag" ] ; then
|
688
|
+
cp $cache_file $rvm_path/tmp/$gem_file_name
|
689
|
+
gem="$rvm_path/tmp/$gem_file_name -l" # install as a named local gem
|
690
|
+
else
|
691
|
+
unset gem
|
692
|
+
__rvm_log "info" "$gem_name $gem_version is already installed, skipping. (use --force to force these to install regardless)"
|
693
|
+
fi
|
694
|
+
else
|
695
|
+
gem="$cache_file -l"
|
696
|
+
fi
|
700
697
|
fi
|
701
698
|
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
699
|
+
if [ ! -z "$gem" ] ; then
|
700
|
+
# TODO: Set vars if fourth field is non-empty (means that there are conditional statements to execute in the gem install line.
|
701
|
+
if [ -z "$vars" ] ; then
|
702
|
+
GEM_HOME="$rvm_gem_home" GEM_PATH="$rvm_gem_home" $gem_prefix $rvm_ruby_home/bin/gem install --no-rdoc --no-ri -q $gem $gem_postfix
|
703
|
+
else
|
704
|
+
eval "GEM_HOME='$rvm_gem_home' GEM_PATH='$rvm_gem_home' $gem_prefix $rvm_ruby_home/bin/gem install --no-rdoc --no-ri -q $gem $gem_postfix"
|
705
|
+
fi
|
707
706
|
fi
|
708
|
-
unset gem gem_prefix gem_name gem_version
|
709
|
-
done
|
707
|
+
unset gem gem_prefix gem_name gem_version gem_file_name gem_postfix cache_file gem_file_name gem_string
|
708
|
+
done < <(awk '/^[a-zA-Z]/{print}' "$rvm_load_file")
|
710
709
|
}
|
711
710
|
|
712
|
-
#
|
711
|
+
#
|
712
|
+
# ruby supporting libraries:
|
713
|
+
#
|
713
714
|
function __rvm_readline_install {
|
714
715
|
pushd $rvm_path/src > /dev/null
|
715
716
|
package=readline
|
@@ -732,7 +733,6 @@ function __rvm_readline_install {
|
|
732
733
|
popd > /dev/null
|
733
734
|
}
|
734
735
|
|
735
|
-
# -C --with-iconv-dir=$rvm_path/usr
|
736
736
|
function __rvm_iconv_install {
|
737
737
|
pushd $rvm_path/src > /dev/null
|
738
738
|
package=libiconv
|
@@ -746,3 +746,4 @@ function __rvm_iconv_install {
|
|
746
746
|
|
747
747
|
popd > /dev/null
|
748
748
|
}
|
749
|
+
|
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.
|
4
|
+
version: 0.0.41
|
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-09-
|
12
|
+
date: 2009-09-16 00:00:00 -04:00
|
13
13
|
default_executable: rvm-install
|
14
14
|
dependencies: []
|
15
15
|
|