rvm 0.0.26 → 0.0.27
Sign up to get free protection for your applications and to get access to all the features.
- data/scripts/rvm +51 -16
- metadata +1 -2
- data/rvm.gemspec +0 -47
data/scripts/rvm
CHANGED
@@ -11,7 +11,7 @@ function __rvm_meta {
|
|
11
11
|
rvm_meta_author="Wayne E. Seguin"
|
12
12
|
rvm_meta_author_email="wayneeseguin@gmail.com"
|
13
13
|
rvm_meta_website="http://rvm.beginrescueend.com/"
|
14
|
-
rvm_meta_version="0.0.
|
14
|
+
rvm_meta_version="0.0.27"
|
15
15
|
rvm_meta_updated="2009.08.31"
|
16
16
|
}
|
17
17
|
|
@@ -46,6 +46,7 @@ function __rvm_usage {
|
|
46
46
|
reload - Reload rvm source itself (useful after changing rvm source)
|
47
47
|
rubydo - Used with -f to run a ruby file against specified or all rubies
|
48
48
|
debug - Emit environment & configuration information for *current* ruby
|
49
|
+
implode - Removes all ruby installations it manages, everything in ~/.rvm
|
49
50
|
|
50
51
|
Implementation:
|
51
52
|
|
@@ -87,6 +88,7 @@ function __rvm_usage {
|
|
87
88
|
-d|--default - Set the default Ruby to a specified version
|
88
89
|
-m|--gem-set - Use a named gem set instead of the default set.
|
89
90
|
--rm-gem-set - Remove a named gem set
|
91
|
+
--jit - Enable JIT for the Rubinius build
|
90
92
|
--debug - Toggle debug mode on for very verbose output.
|
91
93
|
|
92
94
|
Resources:
|
@@ -203,6 +205,7 @@ function __rvm_initialize {
|
|
203
205
|
rvm_config_path=${rvm_config_path:-"${rvm_install_path}/config"}
|
204
206
|
|
205
207
|
rvm_ruby_repo_url="${rvm_ruby_repo_url:-"http://svn.ruby-lang.org/repos/ruby"}"
|
208
|
+
# Rubinius sha1's will be available after RC1.
|
206
209
|
rvm_rubinius_repo_url="${rvm_rubinius_repo_url:-"git://github.com/evanphx/rubinius.git"}"
|
207
210
|
rvm_macruby_repo_url="${rvm_macruby_repo_url:-"http://svn.macosforge.org/repository/ruby/MacRuby"}"
|
208
211
|
rvm_jruby_repo_url="${rvm_jruby_repo_url:-"git://kenai.com/jruby~main"}"
|
@@ -272,6 +275,7 @@ function __rvm_install-source {
|
|
272
275
|
if [ -s ./configure ] ; then
|
273
276
|
__rvm_log "info" "\tConfiguring $rvm_ruby_package_name using ${rvm_ruby_configure:-"--enable-shared"}, this may take a while depending on your cpu(s)..."
|
274
277
|
nice -n $rvm_niceness ./configure --prefix=$rvm_install_path/$rvm_ruby_package_name ${rvm_ruby_configure:-"--enable-shared"} > $rvm_log_path/$rvm_ruby_package_name/configure.log 2> $rvm_log_path/$rvm_ruby_package_name/configure.error.log
|
278
|
+
if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
|
275
279
|
else
|
276
280
|
__rvm_log "warn" "\tSkipping configure step, ./configure file does not exist."
|
277
281
|
fi
|
@@ -282,12 +286,14 @@ function __rvm_install-source {
|
|
282
286
|
else
|
283
287
|
nice -n $rvm_niceness $rvm_ruby_make > $rvm_log_path/$rvm_ruby_package_name/install.log 2> $rvm_log_path/$rvm_ruby_package_name/install.error.log
|
284
288
|
fi
|
289
|
+
if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
|
285
290
|
if [ -z "$rvm_ruby_make" ] ; then
|
286
291
|
__rvm_log "info" "\tInstalling $rvm_ruby_package_name"
|
287
292
|
nice -n $rvm_niceness make install > $rvm_log_path/$rvm_ruby_package_name/install.log 2> $rvm_log_path/$rvm_ruby_package_name/install.error.log
|
288
293
|
else
|
289
294
|
nice -n $rvm_niceness $rvm_ruby_make_install > $rvm_log_path/$rvm_ruby_package_name/install.log 2> $rvm_log_path/$rvm_ruby_package_name/install.error.log
|
290
295
|
fi
|
296
|
+
if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
|
291
297
|
|
292
298
|
chmod +x $rvm_install_path/$rvm_ruby_package_name/bin/*
|
293
299
|
|
@@ -370,12 +376,14 @@ function __rvm_install-ruby {
|
|
370
376
|
mkdir -p $rvm_source_path/$rvm_ruby_package_name
|
371
377
|
nice -n $rvm_niceness tar xzf $rvm_archives_path/$rvm_ruby_package_name.tar.gz -C $rvm_source_path
|
372
378
|
fi
|
379
|
+
if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
|
373
380
|
|
374
381
|
__rvm_log "info" "\tInstalling $rvm_ruby_package_name, this may take a while, depending on your cpu(s)..."
|
375
382
|
mkdir -p $rvm_log_path/$rvm_ruby_package_name
|
376
383
|
|
377
384
|
cd $rvm_source_path/$rvm_ruby_package_name
|
378
385
|
nice -n $rvm_niceness ./installer -a $rvm_install_path/ruby-enterprise-$rvm_ruby_version-$rvm_ruby_patch_level --dont-install-useful-gems --no-tcmalloc > $rvm_log_path/$rvm_ruby_package_name/install.log 2> $rvm_log_path/$rvm_ruby_package_name/install.error.log
|
386
|
+
if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
|
379
387
|
chmod +x $rvm_install_path/$rvm_ruby_package_name/bin/*
|
380
388
|
|
381
389
|
ln -fs $rvm_install_path/$rvm_ruby_package_name/bin/ruby $rvm_install_path/bin/$rvm_ruby_package_name
|
@@ -390,6 +398,7 @@ function __rvm_install-ruby {
|
|
390
398
|
mkdir -p $rvm_source_path/$rvm_gem_package_name
|
391
399
|
nice -n $rvm_niceness tar zxf $rvm_archives_path/$rvm_gem_package_name.tgz -C $rvm_source_path
|
392
400
|
fi
|
401
|
+
if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
|
393
402
|
# Well this is fun... fix nil error on require_paths:
|
394
403
|
sed -i.orig "s/require_paths\.join/require_paths.to_a.join/" $rvm_source_path/$rvm_gem_package_name/lib/rubygems/gem_path_searcher.rb > $rvm_log_path/$rvm_ruby_package_name/rubygems.install.log 2> $rvm_log_path/$rvm_ruby_package_name/rubygems.install.error.log
|
395
404
|
|
@@ -414,7 +423,8 @@ function __rvm_install-ruby {
|
|
414
423
|
rm -rf $rvm_install_path/$rvm_ruby_interpreter-$rvm_ruby_version
|
415
424
|
git clone --depth 1 $rvm_ruby_repo_url $rvm_install_path/$rvm_ruby_interpreter-$rvm_ruby_version
|
416
425
|
fi
|
417
|
-
cd $rvm_install_path/$rvm_ruby_interpreter-$rvm_ruby_version && rake build
|
426
|
+
cd $rvm_install_path/$rvm_ruby_interpreter-$rvm_ruby_version && $rvm_rubinius_jit rake build
|
427
|
+
if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
|
418
428
|
for binary in ruby irb ; do
|
419
429
|
ln -fs $rvm_install_path/$rvm_ruby_interpreter-$rvm_ruby_version/bin/rbx $rvm_install_path/$rvm_ruby_interpreter-$rvm_ruby_version/bin/$binary
|
420
430
|
done
|
@@ -446,10 +456,12 @@ function __rvm_install-ruby {
|
|
446
456
|
cd $rvm_source_path/$rvm_ruby_package_name
|
447
457
|
fi
|
448
458
|
fi
|
459
|
+
if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
|
449
460
|
|
450
461
|
__rvm_log "info" "\tInstalling $rvm_ruby_package_name..."
|
451
462
|
mkdir -p $rvm_install_path/$rvm_ruby_package_name/bin/
|
452
463
|
rsync -ag $rvm_source_path/$rvm_ruby_package_name/ $rvm_install_path/$rvm_ruby_package_name/
|
464
|
+
if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_log_path/$rvm_package_file/*.error.log" ; return 1 ; fi
|
453
465
|
cd $rvm_source_path/$rvm_ruby_package_name/tool/nailgun && make > $rvm_log_path/$rvm_ruby_package_name/install.nailgun.log 2> $rvm_log_path/$rvm_ruby_package_name/install.error.nailgun.log
|
454
466
|
popd > /dev/null
|
455
467
|
chmod +x $rvm_install_path/$rvm_ruby_package_name/bin/*
|
@@ -658,6 +670,7 @@ function __rvm_use {
|
|
658
670
|
|
659
671
|
if [ ! -s "$rvm_ruby_irbrc" ] ; then
|
660
672
|
rvm_irbrc_file=$(cat <<Config
|
673
|
+
require "irb/completion" rescue nil
|
661
674
|
@prompt = {
|
662
675
|
:PROMPT_I => "${rvm_ruby_package_name} > ", # default prompt
|
663
676
|
:PROMPT_S => "${rvm_ruby_package_name}%l> ", # known continuation
|
@@ -670,11 +683,12 @@ function __rvm_use {
|
|
670
683
|
IRB.conf[:PROMPT][@prompt_mode] = @prompt
|
671
684
|
IRB.conf[:PROMPT_MODE] = @prompt_mode
|
672
685
|
|
673
|
-
require "irb/completion" rescue nil
|
674
686
|
Config
|
675
687
|
)
|
676
|
-
|
677
|
-
|
688
|
+
if [ -s ~/.irbrc ] ; then
|
689
|
+
cat ~/.irbrc > $rvm_ruby_home/.irbrc
|
690
|
+
fi
|
691
|
+
echo "$rvm_irbrc_file" >> $rvm_ruby_home/.irbrc
|
678
692
|
fi
|
679
693
|
PATH=$MY_RUBY_HOME/bin:$GEM_HOME/bin:$rvm_default_path ; export PATH
|
680
694
|
|
@@ -722,13 +736,32 @@ function __rvm_list {
|
|
722
736
|
|
723
737
|
function __rvm_reset {
|
724
738
|
|
725
|
-
__rvm_select "system"
|
726
|
-
|
727
739
|
PATH="$rvm_default_path" ; export PATH
|
728
740
|
for variable in RUBY_VERSION GEM_HOME MY_RUBY_HOME ; do unset $variable ; done
|
729
741
|
rm -f $rvm_install_path/default*
|
730
742
|
rm -f $rvm_install_path/current
|
731
743
|
|
744
|
+
__rvm_select "system"
|
745
|
+
|
746
|
+
}
|
747
|
+
|
748
|
+
function __rvm_implode {
|
749
|
+
while : ; do
|
750
|
+
__rvm_log "warn" "Are you SURE you wish for rvm to implode? This will remove $rvm_install_path ? (type 'yes' or 'no')"
|
751
|
+
read response
|
752
|
+
if [ "$response" = "yes" ] ; then
|
753
|
+
if [ -d $rvm_install_path ] ; then
|
754
|
+
__rvm_log "info" "Hai! Removing $rvm_install_path"
|
755
|
+
rm -rf $rvm_install_path/
|
756
|
+
else
|
757
|
+
__rvm_log "info" "It appears that $rvm_install_path is already non existant."
|
758
|
+
fi
|
759
|
+
break
|
760
|
+
elif [ "$response" = "no" ] ; then
|
761
|
+
__rvm_log "info" "Cancelling implosion, no harm done :)"
|
762
|
+
break
|
763
|
+
fi
|
764
|
+
done
|
732
765
|
}
|
733
766
|
|
734
767
|
function __rvm_gem-dir {
|
@@ -757,11 +790,11 @@ function __rvm_src-dir {
|
|
757
790
|
function __rvm_gem-dup {
|
758
791
|
|
759
792
|
if [ "$1" = "default" ] ; then
|
760
|
-
rvm_source_gem_dir="$
|
793
|
+
rvm_source_gem_dir="$rvm_default_user_gem_path"
|
761
794
|
elif [ "$1" = "system" ] ; then
|
762
|
-
rvm_source_gem_dir="$
|
795
|
+
rvm_source_gem_dir="$rvm_default_system_gem_path"
|
763
796
|
else
|
764
|
-
rvm_source_gem_dir=${1:-$
|
797
|
+
rvm_source_gem_dir=${1:-$rvm_default_user_gem_path} # TODO: check for and remove trailing /gems
|
765
798
|
fi
|
766
799
|
|
767
800
|
if [ ! -z "$rvm_source_gem_dir" ] ; then
|
@@ -812,7 +845,7 @@ function __rvm_cache {
|
|
812
845
|
}
|
813
846
|
|
814
847
|
function __rvm_cleanup-variables {
|
815
|
-
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_install_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
|
848
|
+
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_install_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
|
816
849
|
}
|
817
850
|
|
818
851
|
function __rvm_get-user-defaults {
|
@@ -824,7 +857,7 @@ function __rvm_parse-args {
|
|
824
857
|
while [ $# -gt 0 ] ; do
|
825
858
|
rvm_token="$1" ; shift
|
826
859
|
case "$rvm_token" in
|
827
|
-
install|uninstall|path|info|setup|version|srcdir|list|symlinks|reset|debug|reload|usage|help)
|
860
|
+
install|uninstall|path|info|setup|version|srcdir|list|symlinks|reset|debug|reload|usage|help|implode)
|
828
861
|
rvm_action=$rvm_token
|
829
862
|
;;
|
830
863
|
use)
|
@@ -928,7 +961,8 @@ function __rvm_parse-args {
|
|
928
961
|
-d|--default) rvm_set_default=1 ;;
|
929
962
|
--debug) rvm_debug=1 ;;
|
930
963
|
-m|--gem-set) rvm_gem_set_name="$1" ; shift ;;
|
931
|
-
|
964
|
+
--rm-gem-set) rvm_gem_set_name_rm="$1" ; shift ;;
|
965
|
+
--jit) rvm_rubinius_jit="RBX_LLVM=1" ;;
|
932
966
|
|
933
967
|
default|system)
|
934
968
|
rvm_action="use"
|
@@ -995,10 +1029,11 @@ function rvm {
|
|
995
1029
|
done
|
996
1030
|
fi
|
997
1031
|
;;
|
998
|
-
reset) __rvm_reset
|
1032
|
+
reset) __rvm_reset ;;
|
999
1033
|
# TODO: how can we use bin_path here for reload, default file?
|
1000
|
-
reload) source ~/.rvm/scripts/rvm
|
1001
|
-
|
1034
|
+
reload) source ~/.rvm/scripts/rvm ;;
|
1035
|
+
implode) __rvm_implode ;;
|
1036
|
+
error) __rvm_log "fail" "$rvm_error_message ( see: rvm usage )" ; return 1; ;;
|
1002
1037
|
info|debug)
|
1003
1038
|
__rvm_version
|
1004
1039
|
cat <<-Info
|
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.27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wayne E. Seguin
|
@@ -29,7 +29,6 @@ files:
|
|
29
29
|
- config/cache
|
30
30
|
- examples/rvmrc
|
31
31
|
- lib/rvm.rb
|
32
|
-
- rvm.gemspec
|
33
32
|
- scripts/rvm
|
34
33
|
- scripts/rvm-install
|
35
34
|
- scripts/rvm-update
|
data/rvm.gemspec
DELETED
@@ -1,47 +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.26"
|
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-08-31}
|
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/cache",
|
24
|
-
"examples/rvmrc",
|
25
|
-
"lib/rvm.rb",
|
26
|
-
"rvm.gemspec",
|
27
|
-
"scripts/rvm",
|
28
|
-
"scripts/rvm-install",
|
29
|
-
"scripts/rvm-update"
|
30
|
-
]
|
31
|
-
s.homepage = %q{http://github.com/wayneeseguin/rvm}
|
32
|
-
s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
|
33
|
-
s.require_paths = ["lib"]
|
34
|
-
s.rubyforge_project = %q{dynamicreports}
|
35
|
-
s.rubygems_version = %q{1.3.5}
|
36
|
-
s.summary = %q{Ruby Version Manager (rvm)}
|
37
|
-
|
38
|
-
if s.respond_to? :specification_version then
|
39
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
40
|
-
s.specification_version = 3
|
41
|
-
|
42
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
43
|
-
else
|
44
|
-
end
|
45
|
-
else
|
46
|
-
end
|
47
|
-
end
|