rvm 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/bash/rvm +82 -83
- metadata +2 -2
data/bash/rvm
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
rvm_author="Wayne E. Seguin"
|
4
4
|
rvm_author_email="wayneeseguin@gmail.com"
|
5
5
|
rvm_website="http://github.com/wayneeseguin/rvm"
|
6
|
-
rvm_version="0.0.
|
6
|
+
rvm_version="0.0.12"
|
7
7
|
rvm_updated="2009.08.25"
|
8
8
|
|
9
9
|
#
|
@@ -35,11 +35,11 @@ function rvm-usage {
|
|
35
35
|
list - Show currently installed versions
|
36
36
|
gemdir - Switch to gem directory for installation (new login shell)
|
37
37
|
srcdir - Switch to src directory for the current ruby installation
|
38
|
-
gemdup - Clone source
|
38
|
+
gemdup - Clone source version gems to current version
|
39
39
|
(highly expiramental) Example: rvm gemdup ~/.gem/ruby/1.8/
|
40
40
|
install - Install a ruby version, default is from source
|
41
41
|
uninstall - Uninstall a ruby version
|
42
|
-
debug - Emit environment
|
42
|
+
debug - Emit environment & configuration information for *current* ruby
|
43
43
|
|
44
44
|
Implementation:
|
45
45
|
|
@@ -110,34 +110,36 @@ Usage
|
|
110
110
|
}
|
111
111
|
|
112
112
|
# Logging functions based on level
|
113
|
-
function log { echo -e "\n $* \e[0m" ; }
|
114
|
-
function debug { log "\e[4;34m <d> \e[0m$*" ; }
|
115
|
-
function info { log "\e[0;32m <i> \e[0m$*" ; }
|
116
|
-
function warn { log "\e[0;33m <w> \e[0m$*" ; }
|
117
|
-
function error { log "\e[0;31m <e> \e[0m$*" ; }
|
118
|
-
function fail { log "\e[0;31m <e> \e[0m$*" ; return 1 ; }
|
113
|
+
function rvm-log { echo -e "\n $* \e[0m" ; }
|
114
|
+
function rvm-log-debug { rvm-log "\e[4;34m <d> \e[0m$*" ; }
|
115
|
+
function rvm-log-info { rvm-log "\e[0;32m <i> \e[0m$*" ; }
|
116
|
+
function rvm-log-warn { rvm-log "\e[0;33m <w> \e[0m$*" ; }
|
117
|
+
function rvm-log-error { rvm-log "\e[0;31m <e> \e[0m$*" ; }
|
118
|
+
function rvm-log-fail { rvm-log "\e[0;31m <e> \e[0m$*" ; return 1 ; }
|
119
119
|
|
120
120
|
function rvm-gi { gem install -q --no-rdoc --no-ri $* ; }
|
121
121
|
|
122
122
|
function rvm-info {
|
123
123
|
|
124
|
-
full_version=$(ruby -v)
|
125
|
-
ruby_implementation=$(echo "$full_version" | awk '{print $1}')
|
126
|
-
ruby_version=$(echo "$full_version" | awk '{print $2}')
|
127
|
-
ruby_patchlevel=$(echo "$full_version" | sed 's/^.*(//' | sed 's/).*$//')
|
128
|
-
ruby_date=$(echo "$full_version" | sed 's/^.*(\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\).*$/\1/')
|
129
|
-
ruby_platform=$(echo "$full_version" | sed 's/^.*\[//' | sed 's/\].*$//')
|
130
|
-
|
131
124
|
cat <<-Info
|
125
|
+
|
132
126
|
ruby:
|
133
|
-
|
134
|
-
version:
|
135
|
-
date:
|
136
|
-
platform:
|
137
|
-
patchlevel:
|
138
|
-
|
139
|
-
|
140
|
-
|
127
|
+
interpreter: "$(ruby -v | awk '{print $1}')"
|
128
|
+
version: "$(ruby -v | awk '{print $2}')"
|
129
|
+
date: "$(ruby -v | sed 's/^.*(\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\).*$/\1/')"
|
130
|
+
platform: "$(ruby -v | sed 's/^.*\[//' | sed 's/\].*$//')"
|
131
|
+
patchlevel: "$(ruby -v | sed 's/^.*(//' | sed 's/).*$//')"
|
132
|
+
full_version: "$(ruby -v)"
|
133
|
+
|
134
|
+
homes:
|
135
|
+
gem: "${GEM_HOME-not set}"
|
136
|
+
ruby: "${MY_RUBY_HOME-not set}"
|
137
|
+
|
138
|
+
binaries:
|
139
|
+
ruby: "$(which ruby)"
|
140
|
+
irb: "$(which irb)"
|
141
|
+
gem: "$(which gem)"
|
142
|
+
|
141
143
|
Info
|
142
144
|
|
143
145
|
}
|
@@ -150,13 +152,13 @@ function rvm-install-source {
|
|
150
152
|
1.9.2) major="1.9" ; minor="2" ; level="${2-review1}" ;;
|
151
153
|
1.8|1.8.6) major="1.8" ; minor="6" ; level="${2-369}" ;;
|
152
154
|
1.8.7) major="1.8" ; minor="7" ; level="${2-174}" ;;
|
153
|
-
*) fail "Ruby version '$version' is unknown."
|
155
|
+
*) rvm-log-fail "Ruby version '$version' is unknown."
|
154
156
|
esac
|
155
157
|
|
156
158
|
package_name="ruby-$major.$minor-p$level"
|
157
159
|
url="ftp://ftp.ruby-lang.org/pub/ruby/$major/$package_name.tar.gz"
|
158
160
|
|
159
|
-
info "Installing Ruby from source to: $install_path/$package_name"
|
161
|
+
rvm-log-info "Installing Ruby from source to: $install_path/$package_name"
|
160
162
|
mkdir -p $install_path/$package_name
|
161
163
|
|
162
164
|
pushd $source_path > /dev/null
|
@@ -164,25 +166,25 @@ function rvm-install-source {
|
|
164
166
|
cd $package_name
|
165
167
|
else
|
166
168
|
if [ ! -f "$package_name.tar.gz" ] ; then
|
167
|
-
info "\tDownloading $package_name, this may take a while depending on your connection..."
|
169
|
+
rvm-log-info "\tDownloading $package_name, this may take a while depending on your connection..."
|
168
170
|
curl -O -L -s $url
|
169
171
|
fi
|
170
|
-
info "\tExtracting $package_name..."
|
172
|
+
rvm-log-info "\tExtracting $package_name..."
|
171
173
|
tar xzf $package_name.tar.gz && cd $package_name
|
172
174
|
fi
|
173
175
|
|
174
|
-
info "\tConfiguring $package_name using ${configure-'--enable-shared'}, this may take a while depending on your cpu(s)..."
|
176
|
+
rvm-log-info "\tConfiguring $package_name using ${configure-'--enable-shared'}, this may take a while depending on your cpu(s)..."
|
175
177
|
./configure --prefix=$install_path/$package_name ${configure-'--enable-shared'} > $install_path/$package_name/configure.log 2> $install_path/$package_name/configure.error.log
|
176
178
|
|
177
|
-
info "\tCompiling $package_name, this may take a while, depending on your cpu(s)..."
|
179
|
+
rvm-log-info "\tCompiling $package_name, this may take a while, depending on your cpu(s)..."
|
178
180
|
make > $install_path/$package_name/make.log 2> $install_path/$package_name/make.error.log
|
179
181
|
|
180
|
-
info "\tInstalling $package_name"
|
182
|
+
rvm-log-info "\tInstalling $package_name"
|
181
183
|
make install > $install_path/$package_name/install.log 2> $install_path/$package_name/install.error.log
|
182
184
|
chmod +x $install_path/$package_name/bin/*
|
183
185
|
|
184
186
|
# Now install rubygems for this ruby version.
|
185
|
-
info "\tInstalling rubygems dedicated to $package_name..."
|
187
|
+
rvm-log-info "\tInstalling rubygems dedicated to $package_name..."
|
186
188
|
gem_package_name="rubygems-1.3.5"
|
187
189
|
gem_url="http://rubyforge.org/frs/download.php/60718/$gem_package_name.tgz"
|
188
190
|
if [ -d $gem_package_name ] ; then
|
@@ -195,10 +197,10 @@ function rvm-install-source {
|
|
195
197
|
sed -i '' "s/require_paths\.join/require_paths.to_a.join/" $source_path/$package_name/$gem_package_name/lib/rubygems/gem_path_searcher.rb
|
196
198
|
$install_path/$package_name/bin/ruby ./setup.rb > $install_path/$package_name/rubygems.install.log 2> $install_path/$package_name/rubygems.install.error.log
|
197
199
|
popd > /dev/null
|
198
|
-
info "Installation of $package_name complete."
|
200
|
+
rvm-log-info "Installation of $package_name complete."
|
199
201
|
|
200
202
|
for gem_name in rake ; do
|
201
|
-
info "Installing $gem_name"
|
203
|
+
rvm-log-info "Installing $gem_name"
|
202
204
|
$install_path/$package_name/bin/gem install $gem_name --no-rdoc --no-ri -q >> $install_path/$package_name/gems.install.log
|
203
205
|
done
|
204
206
|
}
|
@@ -212,25 +214,25 @@ function rvm-install-ruby {
|
|
212
214
|
patchlevel=${patchlevel-20090610}
|
213
215
|
package_name="ruby-enterprise-$version-$patchlevel"
|
214
216
|
url="http://rubyforge.org/frs/download.php/58677/$package_name.tar.gz"
|
215
|
-
info "Installing Ruby Enterprise Edition from source to: $install_path/$package_name"
|
217
|
+
rvm-log-info "Installing Ruby Enterprise Edition from source to: $install_path/$package_name"
|
216
218
|
pushd $source_path > /dev/null
|
217
219
|
if [ -d $package_name ] ; then
|
218
220
|
cd $package_name
|
219
221
|
else
|
220
222
|
if [ ! -f "$package_name.tar.gz" ] ; then
|
221
|
-
info "\tDownloading $package_name, this may take a while depending on your connection..."
|
223
|
+
rvm-log-info "\tDownloading $package_name, this may take a while depending on your connection..."
|
222
224
|
curl -O -L -s $url
|
223
225
|
fi
|
224
|
-
info "\tExtracting $package_name..."
|
226
|
+
rvm-log-info "\tExtracting $package_name..."
|
225
227
|
tar xzf $package_name.tar.gz && cd $package_name
|
226
228
|
fi
|
227
229
|
|
228
|
-
info "\tInstalling $package_name, this may take a while, depending on your cpu(s)..."
|
230
|
+
rvm-log-info "\tInstalling $package_name, this may take a while, depending on your cpu(s)..."
|
229
231
|
mkdir -p $install_path/$package_name
|
230
232
|
./installer -a $install_path/ruby-enterprise-$version-$patchlevel --dont-install-useful-gems > $install_path/$package_name/install.log 2> $install_path/$package_name/install.error.log
|
231
233
|
chmod +x $install_path/$package_name/bin/*
|
232
234
|
|
233
|
-
info "\tInstalling rubygems dedicated to $package_name..."
|
235
|
+
rvm-log-info "\tInstalling rubygems dedicated to $package_name..."
|
234
236
|
gem_package_name="rubygems-1.3.5"
|
235
237
|
gem_url="http://rubyforge.org/frs/download.php/60718/$gem_package_name.tgz"
|
236
238
|
if [ -d $gem_package_name ] ; then
|
@@ -242,11 +244,11 @@ function rvm-install-ruby {
|
|
242
244
|
# Well this is fun... fix nil error on require_paths:
|
243
245
|
sed -i '' "s/require_paths\.join/require_paths.to_a.join/" $source_path/$package_name/$gem_package_name/lib/rubygems/gem_path_searcher.rb
|
244
246
|
$install_path/$package_name/bin/ruby ./setup.rb > $install_path/$package_name/rubygems.install.log 2> $install_path/$package_name/rubygems.install.error.log
|
245
|
-
info "Installation of $package_name complete."
|
247
|
+
rvm-log-info "Installation of $package_name complete."
|
246
248
|
popd > /dev/null
|
247
249
|
|
248
250
|
for gem_name in rake ; do
|
249
|
-
info "Installing $gem_name"
|
251
|
+
rvm-log-info "Installing $gem_name"
|
250
252
|
$install_path/$package_name/bin/gem install $gem_name --no-rdoc --no-ri -q >> $install_path/$package_name/gems.install.log
|
251
253
|
done
|
252
254
|
;;
|
@@ -258,21 +260,21 @@ function rvm-install-ruby {
|
|
258
260
|
package_name="$implementation-$version"
|
259
261
|
url="http://dist.codehaus.org/$implementation/$version/$zipfile.zip"
|
260
262
|
|
261
|
-
info "Installing jRuby to: $install_path/$package_name"
|
263
|
+
rvm-log-info "Installing jRuby to: $install_path/$package_name"
|
262
264
|
mkdir -p $install_path/$package_name
|
263
265
|
pushd $source_path > /dev/null
|
264
266
|
if [ -d $zipfile ] ; then
|
265
267
|
cd $zipfile
|
266
268
|
else
|
267
269
|
if [ ! -f "$zipfile.zip" ] ; then
|
268
|
-
info "\tDownloading $zipfile, this may take a while depending on your connection..."
|
270
|
+
rvm-log-info "\tDownloading $zipfile, this may take a while depending on your connection..."
|
269
271
|
curl -O -L -s $url
|
270
272
|
fi
|
271
|
-
info "\tExtracting $zipfile..."
|
273
|
+
rvm-log-info "\tExtracting $zipfile..."
|
272
274
|
jar xf $zipfile.zip
|
273
275
|
fi
|
274
276
|
|
275
|
-
info "\tInstalling $package_name..."
|
277
|
+
rvm-log-info "\tInstalling $package_name..."
|
276
278
|
mkdir -p $install_path/$package_name/bin/
|
277
279
|
rsync -ag $source_path/$package_name/ $install_path/$package_name/
|
278
280
|
cd $source_path/$package_name/tool/nailgun && make > $install_path/$package_name/install.nailgun.log 2> $install_path/$package_name/install.error.nailgun.log
|
@@ -282,7 +284,7 @@ function rvm-install-ruby {
|
|
282
284
|
ln -sf $install_path/$package_name/bin/$binary $install_path/$package_name/bin/${binary#j}
|
283
285
|
done
|
284
286
|
for gem_name in rake jruby-openssl ; do
|
285
|
-
info "Installing $gem_name"
|
287
|
+
rvm-log-info "Installing $gem_name"
|
286
288
|
$install_path/$package_name/bin/jgem install $gem_name --no-rdoc --no-ri -q >> $install_path/$package_name/gems.install.log
|
287
289
|
done
|
288
290
|
;;
|
@@ -292,9 +294,9 @@ function rvm-install-ruby {
|
|
292
294
|
;;
|
293
295
|
|
294
296
|
default)
|
295
|
-
fail "please specify a ruby implementation to install."
|
297
|
+
rvm-log-fail "please specify a ruby implementation to install."
|
296
298
|
;;
|
297
|
-
*) fail "Ruby implementation '$implementation' is not known."
|
299
|
+
*) rvm-log-fail "Ruby implementation '$implementation' is not known."
|
298
300
|
|
299
301
|
esac
|
300
302
|
|
@@ -310,7 +312,7 @@ function rvm-uninstall {
|
|
310
312
|
if [ "$version" = "1.2.0" -o "$version" = "1.3.1" ] ; then
|
311
313
|
package_name="jruby*-$version"
|
312
314
|
else
|
313
|
-
fail "Unknown jRuby version: $version"
|
315
|
+
rvm-log-fail "Unknown jRuby version: $version"
|
314
316
|
fi
|
315
317
|
;;
|
316
318
|
|
@@ -319,7 +321,7 @@ function rvm-uninstall {
|
|
319
321
|
if [ "$version" = "1.8.6" ] ; then
|
320
322
|
package_name="$install_path/ruby-enterprise-$version-${3-20090610}"
|
321
323
|
else
|
322
|
-
fail "Unknown Ruby Enterprise Edition version: $version"
|
324
|
+
rvm-log-fail "Unknown Ruby Enterprise Edition version: $version"
|
323
325
|
fi
|
324
326
|
;;
|
325
327
|
|
@@ -337,24 +339,24 @@ function rvm-uninstall {
|
|
337
339
|
package_name="ruby-1.9.1-p${patchlevel-243}"
|
338
340
|
|
339
341
|
else
|
340
|
-
fail "Unknown ruby version: $version"
|
342
|
+
rvm-log-fail "Unknown ruby version: $version"
|
341
343
|
fi
|
342
344
|
;;
|
343
345
|
|
344
346
|
*)
|
345
|
-
fail "Ruby implementation '$implementation' is not known."
|
347
|
+
rvm-log-fail "Ruby implementation '$implementation' is not known."
|
346
348
|
|
347
349
|
esac
|
348
350
|
|
349
351
|
if [ ! -z "$package_name" ] ; then
|
350
352
|
for path in $source_path $install_path ; do
|
351
353
|
if [ -d $path/$package_name ] ; then
|
352
|
-
info "Removing $path/$package_name"
|
354
|
+
rvm-log-info "Removing $path/$package_name"
|
353
355
|
rm -rf $path/$package_name
|
354
356
|
fi
|
355
357
|
done
|
356
358
|
else
|
357
|
-
fail "Cannot uninstall unknown package '$package_name'"
|
359
|
+
rvm-log-fail "Cannot uninstall unknown package '$package_name'"
|
358
360
|
fi
|
359
361
|
|
360
362
|
}
|
@@ -381,7 +383,7 @@ function rvm-use {
|
|
381
383
|
alias ruby_ng="jruby --ng"
|
382
384
|
alias ruby_ng_server="jruby --ng-server"
|
383
385
|
else
|
384
|
-
fail "Unknown jRuby version: $version"
|
386
|
+
rvm-log-fail "Unknown jRuby version: $version"
|
385
387
|
fi
|
386
388
|
;;
|
387
389
|
|
@@ -392,7 +394,7 @@ function rvm-use {
|
|
392
394
|
MY_RUBY_HOME="$install_path/ruby-enterprise-$version-$patchlevel"
|
393
395
|
GEM_HOME="$HOME/.gem/ruby-enterprise/1.8"
|
394
396
|
else
|
395
|
-
fail "Unknown Ruby Enterprise Edition version: $version"
|
397
|
+
rvm-log-fail "Unknown Ruby Enterprise Edition version: $version"
|
396
398
|
fi
|
397
399
|
;;
|
398
400
|
|
@@ -418,18 +420,18 @@ function rvm-use {
|
|
418
420
|
GEM_HOME="$HOME/.gem/ruby/1.9.1"
|
419
421
|
|
420
422
|
else
|
421
|
-
fail "Unknown ruby version: $version"
|
423
|
+
rvm-log-fail "Unknown ruby version: $version"
|
422
424
|
fi
|
423
425
|
;;
|
424
426
|
|
425
427
|
*)
|
426
|
-
fail "Ruby implementation '$implementation' is not known."
|
428
|
+
rvm-log-fail "Ruby implementation '$implementation' is not known."
|
427
429
|
|
428
430
|
esac
|
429
431
|
|
430
432
|
if [ ! "$implementation" = "default" ] ; then
|
431
433
|
if [ ! -d $MY_RUBY_HOME ] ; then
|
432
|
-
warn "$implementation $version is not installed."
|
434
|
+
rvm-log-warn "$implementation $version is not installed."
|
433
435
|
rvm-install-ruby $implementation $version $level
|
434
436
|
fi
|
435
437
|
|
@@ -444,13 +446,13 @@ function rvm-use {
|
|
444
446
|
done
|
445
447
|
fi
|
446
448
|
|
447
|
-
info "Switching to $implementation $version $patchlevel ..."
|
449
|
+
rvm-log-info "Switching to $implementation $version $patchlevel ..."
|
448
450
|
if [ ! -z "$BASH_VERSION" ] ; then
|
449
451
|
exec bash -l
|
450
452
|
elif [ ! -z "$ZSH_VERSION" ] ; then
|
451
453
|
exec zsh -l
|
452
454
|
else
|
453
|
-
fail "Your shell is not supported bash and zsh are currently supported."
|
455
|
+
rvm-log-fail "Your shell is not supported bash and zsh are currently supported."
|
454
456
|
fi
|
455
457
|
}
|
456
458
|
|
@@ -485,7 +487,7 @@ function rvm-gem-dir {
|
|
485
487
|
GEM_HOME="$HOME/.gem/ruby/1.9.1"
|
486
488
|
|
487
489
|
else
|
488
|
-
fail "Unknown Version: ${2-$version}"
|
490
|
+
rvm-log-fail "Unknown Version: ${2-$version}"
|
489
491
|
fi
|
490
492
|
;;
|
491
493
|
current)
|
@@ -498,13 +500,13 @@ function rvm-gem-dir {
|
|
498
500
|
GEM_HOME=$default_gem_path
|
499
501
|
;;
|
500
502
|
*)
|
501
|
-
fail "Ruby implementation '$implementation' is not known."
|
503
|
+
rvm-log-fail "Ruby implementation '$implementation' is not known."
|
502
504
|
esac
|
503
505
|
|
504
506
|
if [ -d $GEM_HOME ] ; then
|
505
507
|
echo $GEM_HOME && cd $GEM_HOME
|
506
508
|
else
|
507
|
-
fail "$implementation $version GEM directory does not exist."
|
509
|
+
rvm-log-fail "$implementation $version GEM directory does not exist."
|
508
510
|
fi
|
509
511
|
|
510
512
|
}
|
@@ -517,7 +519,7 @@ function rvm-src-dir {
|
|
517
519
|
if [ "${2-$version}" = "1.2.0" -o "${2-$version}" = "1.3.1" ] ; then
|
518
520
|
src_dir="$source_path/$implementation-$version"
|
519
521
|
else
|
520
|
-
fail "Unknown jRuby version: $version"
|
522
|
+
rvm-log-fail "Unknown jRuby version: $version"
|
521
523
|
fi
|
522
524
|
;;
|
523
525
|
|
@@ -526,7 +528,7 @@ function rvm-src-dir {
|
|
526
528
|
if [ "${2-$version}" = "1.8.6" -o "${2-$version}" = "1.8" ] ; then
|
527
529
|
src_dir="$source_path/ruby-enterprise-${2-$version}-"${3-20090610}""
|
528
530
|
else
|
529
|
-
fail "Unknown Ruby Enterprise Edition version: ${2-$version}"
|
531
|
+
rvm-log-fail "Unknown Ruby Enterprise Edition version: ${2-$version}"
|
530
532
|
fi
|
531
533
|
;;
|
532
534
|
|
@@ -544,23 +546,23 @@ function rvm-src-dir {
|
|
544
546
|
src_dir="$source_path/ruby-1.9.1-p${patchlevel-243}"
|
545
547
|
|
546
548
|
else
|
547
|
-
fail "unknown Ruby version: ${2-$version}"
|
549
|
+
rvm-log-fail "unknown Ruby version: ${2-$version}"
|
548
550
|
fi
|
549
551
|
;;
|
550
552
|
|
551
553
|
default)
|
552
|
-
warn "Invalid request, rvm cannot change to the default source directory."
|
554
|
+
rvm-log-warn "Invalid request, rvm cannot change to the default source directory."
|
553
555
|
;;
|
554
556
|
|
555
557
|
*)
|
556
|
-
fail "Ruby implementation '$implementation' is not known."
|
558
|
+
rvm-log-fail "Ruby implementation '$implementation' is not known."
|
557
559
|
return 1
|
558
560
|
esac
|
559
561
|
|
560
562
|
if [ -d $src_dir ] ; then
|
561
563
|
cd $src_dir
|
562
564
|
else
|
563
|
-
fail "$implementation $version source directory does not exist."
|
565
|
+
rvm-log-fail "$implementation $version source directory does not exist."
|
564
566
|
fi
|
565
567
|
|
566
568
|
}
|
@@ -580,7 +582,7 @@ function rvm-gem-dup {
|
|
580
582
|
fi
|
581
583
|
done
|
582
584
|
else
|
583
|
-
fail "Unknown $implementation version: $version"
|
585
|
+
rvm-log-fail "Unknown $implementation version: $version"
|
584
586
|
fi
|
585
587
|
|
586
588
|
}
|
@@ -628,7 +630,6 @@ function rvm {
|
|
628
630
|
-p|--prefix) install_path="$1" ; shift ;;
|
629
631
|
-s|--source) source_path="$1" ; shift ;; # Undocumented / untested "feature"
|
630
632
|
-c|--configure) configure="$1" ; shift ;;
|
631
|
-
-m|--manager) manager="$1" ; shift ;;
|
632
633
|
-u|--gemdup) action="gemdup" ; gem_dir="$1" ; shift ;;
|
633
634
|
-d|--debug) debug=1 ;;
|
634
635
|
*) rvm-usage ; return 1
|
@@ -640,11 +641,10 @@ function rvm {
|
|
640
641
|
else
|
641
642
|
implementation=${implementation-'ruby'}
|
642
643
|
fi
|
643
|
-
username=`whoami`
|
644
644
|
|
645
645
|
# TODO: Sanitize user input, ensure that there is a / a the end...
|
646
|
-
if [ "
|
647
|
-
fail "root user support is not yet implemented."
|
646
|
+
if [ "`whoami`" = "root" ] ; then
|
647
|
+
rvm-log-fail "root user support is not yet implemented."
|
648
648
|
#prefix_path=${prefix-/usr/local/}
|
649
649
|
else
|
650
650
|
prefix_path=${prefix-$HOME/.}
|
@@ -683,7 +683,6 @@ function rvm {
|
|
683
683
|
ruby -r rubygems -e "puts Gem::default_path.compact[1] || Gem::default_path.compact.first" > $install_path/default_system_gem_path
|
684
684
|
fi
|
685
685
|
|
686
|
-
|
687
686
|
if [ "$debug" = "1" ] ; then set -x ; fi
|
688
687
|
|
689
688
|
case "$action" in
|
@@ -712,23 +711,23 @@ function rvm {
|
|
712
711
|
version) rvm-version ;;
|
713
712
|
debug)
|
714
713
|
rvm-version
|
715
|
-
info
|
716
|
-
info "
|
717
|
-
info "
|
718
|
-
info "
|
719
|
-
info "
|
714
|
+
rvm-info
|
715
|
+
rvm-log-info "PATH:$(echo $PATH | awk -F":" '{print $1":"$2":"$3":"$4":"%5}')"
|
716
|
+
rvm-log-info ".bash_profile: \n$(cat ~/.bash_profile | tail -n 5)\n"
|
717
|
+
rvm-log-info ".zprofile: \n$(cat ~/.zprofile | tail -n 5)\n"
|
718
|
+
rvm-log-info "$install_path/current: \n$(cat $install_path/current)\n"
|
720
719
|
return 0
|
721
720
|
;;
|
722
721
|
*)
|
723
722
|
if [ ! -z "$action" ] ; then
|
724
|
-
fail "unknown action '$action'"
|
723
|
+
rvm-log-fail "unknown action '$action'"
|
725
724
|
else
|
726
725
|
rvm-usage
|
727
726
|
fi
|
728
727
|
return 1
|
729
728
|
esac
|
730
729
|
|
731
|
-
set +x
|
730
|
+
if [ "$debug" = "1" ] ; then set +x ; fi
|
732
731
|
|
733
732
|
}
|
734
733
|
|
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.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wayne E. Seguin
|
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
requirements: []
|
54
54
|
|
55
55
|
rubyforge_project: dynamicreports
|
56
|
-
rubygems_version: 1.3.
|
56
|
+
rubygems_version: 1.3.4
|
57
57
|
signing_key:
|
58
58
|
specification_version: 3
|
59
59
|
summary: Ruby Version Manager (rvm)
|