rvm 0.0.48 → 0.0.49
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/bin/rvm-install +1 -1
- data/config/db +2 -0
- data/{scripts/rvm-update → install} +58 -57
- data/lib/VERSION.yml +1 -1
- data/rvm.gemspec +13 -12
- data/scripts/{rvm-aliases → aliases} +0 -0
- data/scripts/{rvm-cli → cli} +17 -12
- data/scripts/{rvm-completion → completion} +1 -16
- data/scripts/{rvm-functions → functions} +0 -0
- data/scripts/install +173 -0
- data/scripts/{rvm-ruby-installer → ruby-installer} +91 -66
- data/scripts/rvm +4 -4
- data/scripts/rvm-install +58 -57
- data/scripts/{rvm-selector → selector} +31 -5
- data/scripts/update +173 -0
- data/scripts/{rvm-utility → utility} +77 -58
- metadata +12 -11
- data/INSTALL +0 -1
data/bin/rvm-install
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# Hot potato!!! Bash it!
|
4
|
-
exec "bash -l -c 'cd #{File.dirname(File.dirname(__FILE__))} && ./
|
4
|
+
exec "bash -l -c 'cd #{File.dirname(File.dirname(__FILE__))} && ./install #{ARGV.join(' ')} && source ~/.rvm/scripts/rvm'"
|
5
5
|
|
data/config/db
CHANGED
@@ -12,6 +12,8 @@ jruby_version=1.3.1
|
|
12
12
|
ree_interpreter=ruby-enterprise
|
13
13
|
ree_version=1.8.6
|
14
14
|
ree_patch_level=20090610
|
15
|
+
ree_1.8.6_repo_url=git://github.com/FooBarWidget/rubyenterpriseedition.git
|
16
|
+
ree_1.8.7_repo_url=git://github.com/FooBarWidget/rubyenterpriseedition187.git
|
15
17
|
macruby_version=2009-09-04
|
16
18
|
ruby_1.9.1_patch_level=243
|
17
19
|
ruby_1.9.2_patch_level=preview1
|
@@ -33,62 +33,63 @@ done ; unset file_name
|
|
33
33
|
|
34
34
|
results=$(grep 'scripts/rvm' ~/.bash_profile ~/.bashrc ~/.zshrc > /dev/null)
|
35
35
|
if [ $? -gt 0 ] ; then
|
36
|
-
|
37
|
-
echo -n -e "$question Do you want this (s)cript to set this up for you, or do it (m)anually yourself ('s' or 'm')? "
|
38
|
-
read response
|
39
|
-
if [ "${response:0:1}" = "s" ] ; then
|
40
|
-
echo 'w00t!'
|
41
|
-
break
|
42
|
-
elif [ "${response:0:1}" = "m" ] ; then
|
43
|
-
echo -e " Please make sure that this line is in place."
|
44
|
-
break
|
45
|
-
fi
|
46
|
-
done
|
47
|
-
|
48
|
-
if [ "${response:0:1}" = "s" ] ; then
|
49
|
-
|
36
|
+
if [ ! -z "`echo $PS1`" ] ; then
|
50
37
|
while : ; do
|
51
|
-
echo -n -e "$question Do you
|
38
|
+
echo -n -e "$question Do you want this (s)cript to set this up for you, or do it (m)anually yourself ('s' or 'm')? "
|
52
39
|
read response
|
53
|
-
if [ "${response:0:1}" = "
|
54
|
-
|
40
|
+
if [ "${response:0:1}" = "s" ] ; then
|
41
|
+
echo 'w00t!'
|
55
42
|
break
|
56
|
-
elif [ "${response:0:1}" = "
|
57
|
-
|
58
|
-
break
|
59
|
-
elif [ "${response:0:1}" = "o" ] ; then
|
60
|
-
user_shell="both"
|
43
|
+
elif [ "${response:0:1}" = "m" ] ; then
|
44
|
+
echo -e " Please make sure that this line is in place."
|
61
45
|
break
|
62
46
|
fi
|
63
47
|
done
|
64
48
|
|
65
|
-
if [ "$
|
49
|
+
if [ "${response:0:1}" = "s" ] ; then
|
66
50
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
51
|
+
while : ; do
|
52
|
+
echo -n -e "$question Do you use b(a)sh or (z)sh or b(o)th for your shell (the default on most *nix systems is bash, press control + C to cancel the installation)\n(a/z/o)? "
|
53
|
+
read response
|
54
|
+
if [ "${response:0:1}" = "a" ] ; then
|
55
|
+
user_shell="bash"
|
56
|
+
break
|
57
|
+
elif [ "${response:0:1}" = "z" ] ; then
|
58
|
+
user_shell="zsh"
|
59
|
+
break
|
60
|
+
elif [ "${response:0:1}" = "o" ] ; then
|
61
|
+
user_shell="both"
|
62
|
+
break
|
63
|
+
fi
|
64
|
+
done
|
65
|
+
fi
|
66
|
+
else
|
67
|
+
user_shell="both"
|
68
|
+
fi
|
79
69
|
|
70
|
+
if [ "$user_shell" = "bash" -o "$user_shell" = "both" ] ; then
|
71
|
+
touch ~/.bash_profile
|
72
|
+
if [ -z "`grep '\.rvm/scripts/rvm' ~/.bash_profile`" ] ; then
|
73
|
+
echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.bash_profile."
|
74
|
+
echo -e "\n" >> ~/.bash_profile
|
75
|
+
echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.bash_profile
|
76
|
+
fi
|
77
|
+
touch ~/.bashrc
|
78
|
+
if [ -z "`grep '\.rvm/scripts/rvm' ~/.bashrc`" ] ; then
|
79
|
+
echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.bashrc."
|
80
|
+
echo -e "\n" >> ~/.bashrc
|
81
|
+
echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.bashrc
|
80
82
|
fi
|
81
83
|
|
82
|
-
|
84
|
+
fi
|
83
85
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
fi
|
86
|
+
if [ "$user_shell" = "zsh" -o "$user_shell" = "both" ] ; then
|
87
|
+
touch ~/.zshrc
|
88
|
+
if [ -z "`grep '\.rvm/scripts/rvm' ~/.zshrc`" ] ; then
|
89
|
+
echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.zshrc."
|
90
|
+
echo -e "\n" >> ~/.zshrc
|
91
|
+
echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.zshrc
|
90
92
|
fi
|
91
|
-
|
92
93
|
fi
|
93
94
|
fi
|
94
95
|
|
@@ -132,30 +133,30 @@ if [ "$system" = "Linux" ] ; then
|
|
132
133
|
rvm_yum_binary=`which yum 2> /dev/null`
|
133
134
|
|
134
135
|
if [ ! -z "$rvm_apt_get_binary" ] ; then
|
135
|
-
echo -e "
|
136
|
-
echo -e "
|
137
|
-
echo -e "
|
138
|
-
echo -e "
|
136
|
+
echo -e " $item For jRuby (if you wish to use it) you will need:"
|
137
|
+
echo -e " $ sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk"
|
138
|
+
echo -e " $item For ree (if you wish to use it) you will need:"
|
139
|
+
echo -e " $ sudo apt-get install libreadline5-dev libssl-dev bison"
|
139
140
|
|
140
141
|
elif [ ! -z "$rvm_emerge_binary" ] ; then
|
141
|
-
echo -e "
|
142
|
-
echo -e "
|
142
|
+
echo -e " $item For jRuby (if you wish to use it) you will need:"
|
143
|
+
echo -e " $ sudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
|
143
144
|
|
144
145
|
elif [ ! -z "$rvm_pacman_binary" ] ; then
|
145
|
-
echo -e "
|
146
|
-
echo -e "
|
146
|
+
echo -e " $item For jRuby (if you wish to use it) you will need:"
|
147
|
+
echo -e " $ sudo pacman -Sy jdk jre"
|
147
148
|
|
148
149
|
elif [ ! -z "$rvm_yum_binary" ] ; then
|
149
|
-
echo -e "
|
150
|
-
echo -e "
|
150
|
+
echo -e " $item For ree (if you wish to use it) you will need:"
|
151
|
+
echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
|
151
152
|
|
152
153
|
else
|
153
|
-
echo -e "
|
154
|
-
echo -e "
|
154
|
+
echo -e " $item For jRuby (if you wish to use it) you will need:"
|
155
|
+
echo -e " The SUN java runtime environment and development kit."
|
155
156
|
fi
|
156
157
|
elif [ "$system" = "Darwin" ] ; then
|
157
|
-
echo -e "
|
158
|
-
echo -e "
|
158
|
+
echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
|
159
|
+
echo -e " $item If you intend on installing MacRuby you must install LLVM first."
|
159
160
|
fi
|
160
161
|
|
161
162
|
echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
|
data/lib/VERSION.yml
CHANGED
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.49"
|
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-24}
|
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}
|
@@ -18,26 +18,27 @@ Gem::Specification.new do |s|
|
|
18
18
|
"README"
|
19
19
|
]
|
20
20
|
s.files = [
|
21
|
-
"
|
22
|
-
"LICENCE",
|
21
|
+
"LICENCE",
|
23
22
|
"README",
|
24
23
|
"config/db",
|
25
24
|
"examples/rvmrc",
|
25
|
+
"install",
|
26
26
|
"lib/VERSION.yml",
|
27
27
|
"lib/rvm.rb",
|
28
28
|
"rvm.gemspec",
|
29
|
+
"scripts/aliases",
|
30
|
+
"scripts/cli",
|
31
|
+
"scripts/completion",
|
32
|
+
"scripts/functions",
|
29
33
|
"scripts/gemsync",
|
34
|
+
"scripts/install",
|
35
|
+
"scripts/ruby-installer",
|
30
36
|
"scripts/rvm",
|
31
|
-
"scripts/rvm-aliases",
|
32
|
-
"scripts/rvm-cli",
|
33
|
-
"scripts/rvm-completion",
|
34
|
-
"scripts/rvm-functions",
|
35
37
|
"scripts/rvm-install",
|
36
38
|
"scripts/rvm-prompt",
|
37
|
-
"scripts/
|
38
|
-
"scripts/
|
39
|
-
"scripts/
|
40
|
-
"scripts/rvm-utility"
|
39
|
+
"scripts/selector",
|
40
|
+
"scripts/update",
|
41
|
+
"scripts/utility"
|
41
42
|
]
|
42
43
|
s.homepage = %q{http://github.com/wayneeseguin/rvm}
|
43
44
|
s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
|
File without changes
|
data/scripts/{rvm-cli → cli}
RENAMED
@@ -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/lib/VERSION.yml | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//'`"
|
8
|
-
rvm_meta_updated="2009.09.
|
8
|
+
rvm_meta_updated="2009.09.24"
|
9
9
|
}
|
10
10
|
|
11
11
|
function __rvm_version { __rvm_meta ; echo "rvm $rvm_meta_version ($rvm_meta_updated) [$rvm_meta_website]" ; }
|
@@ -111,6 +111,12 @@ function __rvm_parse-args {
|
|
111
111
|
rvm_action=$rvm_token
|
112
112
|
;;
|
113
113
|
|
114
|
+
inspect)
|
115
|
+
rvm_action=$rvm_token
|
116
|
+
rvm_ruby_args=$*
|
117
|
+
rvm_parse_break=1
|
118
|
+
;;
|
119
|
+
|
114
120
|
rm|remove)
|
115
121
|
rvm_action=remove
|
116
122
|
;;
|
@@ -120,7 +126,7 @@ function __rvm_parse-args {
|
|
120
126
|
rvm_ruby_interpreter="$rvm_token"
|
121
127
|
;;
|
122
128
|
|
123
|
-
|
129
|
+
jruby|ree|macruby|rbx|rubinius|default|all)
|
124
130
|
rvm_ruby_interpreter="$rvm_token"
|
125
131
|
rvm_action="${rvm_action:-use}"
|
126
132
|
;;
|
@@ -185,17 +191,16 @@ function __rvm_parse-args {
|
|
185
191
|
rvm_ruby_args="rake $rvm_token"
|
186
192
|
;;
|
187
193
|
|
188
|
-
|
189
194
|
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)
|
190
|
-
rvm_ruby_interpreter
|
195
|
+
rvm_ruby_interpreter=${rvm_ruby_interpreter:-ruby}
|
191
196
|
rvm_ruby_version="$rvm_token"
|
192
|
-
rvm_action
|
197
|
+
rvm_action=${rvm_action:-use}
|
193
198
|
;;
|
194
199
|
|
195
200
|
1.2.0|1.3.1)
|
196
|
-
rvm_ruby_interpreter
|
201
|
+
rvm_ruby_interpreter=${rvm_ruby_interpreter:-jruby}
|
197
202
|
rvm_ruby_version="$rvm_token"
|
198
|
-
rvm_action
|
203
|
+
rvm_action=${rvm_action:-use}
|
199
204
|
;;
|
200
205
|
|
201
206
|
-v|--version)
|
@@ -215,6 +220,7 @@ function __rvm_parse-args {
|
|
215
220
|
|
216
221
|
--head)
|
217
222
|
rvm_ruby_rev="head"
|
223
|
+
rvm_head_flag=1
|
218
224
|
rvm_action="${rvm_action:-use}"
|
219
225
|
;;
|
220
226
|
|
@@ -322,7 +328,7 @@ function __rvm_parse-args {
|
|
322
328
|
--rm-gem-set) rvm_gem_set_name_rm="$1" ; shift ;;
|
323
329
|
tests|specs) rvm_action="tests" ;;
|
324
330
|
|
325
|
-
--self|--gem|--rubygems|--reconfigure|--default|--debug
|
331
|
+
--self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--all|--dump|--summary|--jit|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--trace)
|
326
332
|
eval "rvm_$(echo $rvm_token | sed 's/-//g')_flag=1"
|
327
333
|
;;
|
328
334
|
|
@@ -373,7 +379,7 @@ function rvm {
|
|
373
379
|
__rvm_load_defaults
|
374
380
|
__rvm_parse-args $@
|
375
381
|
|
376
|
-
if [ -z "$
|
382
|
+
if [ -z "$rvm_trace_flag" ] ; then set +x ; else set -x ; fi
|
377
383
|
result=0
|
378
384
|
case "$rvm_action" in
|
379
385
|
use) __rvm_use ; result=$? ;;
|
@@ -393,6 +399,7 @@ function rvm {
|
|
393
399
|
usage|help) __rvm_usage ; result=$? ;;
|
394
400
|
benchmark) __rvm_benchmark ; result=$? ;;
|
395
401
|
ruby) __rvm_do ; result=$? ;;
|
402
|
+
inspect) __rvm_inspect ; result=$? ;;
|
396
403
|
|
397
404
|
install|uninstall|remove)
|
398
405
|
__rvm_manage_rubies
|
@@ -400,7 +407,6 @@ function rvm {
|
|
400
407
|
;;
|
401
408
|
|
402
409
|
gemsync)
|
403
|
-
result=0
|
404
410
|
rvm_source_gem_path=`__rvm_select ; echo $rvm_gem_home`
|
405
411
|
__rvm_gem_sync
|
406
412
|
;;
|
@@ -415,7 +421,6 @@ function rvm {
|
|
415
421
|
__rvm_version
|
416
422
|
__rvm_info
|
417
423
|
if [ "$rvm_action" = "debug" ] ; then __rvm_debug ; fi
|
418
|
-
result=0
|
419
424
|
;;
|
420
425
|
|
421
426
|
error)
|
@@ -431,7 +436,7 @@ function rvm {
|
|
431
436
|
fi
|
432
437
|
result=1
|
433
438
|
esac
|
434
|
-
if [ "$
|
439
|
+
if [ "$rvm_trace_flag" = "1" ] ; then set +x ; unset rvm_trace_flag ; fi
|
435
440
|
return $result
|
436
441
|
}
|
437
442
|
|
@@ -98,18 +98,6 @@ _rvm ()
|
|
98
98
|
eval "rvm_$(echo $rvm_token | sed 's/-//g')_flag=1"
|
99
99
|
;;
|
100
100
|
|
101
|
-
reboot|flush|asdf|damnit|wtf|argh|work|workdamnit|BOOM|boom|wth)
|
102
|
-
|
103
|
-
push) _git_push ;;
|
104
|
-
rebase) _git_rebase ;;
|
105
|
-
remote) _git_remote ;;
|
106
|
-
reset) _git_reset ;;
|
107
|
-
revert) _git_revert ;;
|
108
|
-
rm) _git_rm ;;
|
109
|
-
send-email) _git_send_email ;;
|
110
|
-
shortlog) _git_shortlog ;;
|
111
|
-
show) _git_show ;;
|
112
|
-
show-branch) _git_show_branch ;;
|
113
101
|
stash) _git_stash ;;
|
114
102
|
stage) _git_add ;;
|
115
103
|
submodule) _git_submodule ;;
|
@@ -120,7 +108,6 @@ _rvm ()
|
|
120
108
|
esac
|
121
109
|
}
|
122
110
|
|
123
|
-
|
124
111
|
# __gitcomp accepts 1, 2, 3, or 4 arguments
|
125
112
|
# generates completion reply with compgen
|
126
113
|
function __rvm_completion_reply
|
@@ -142,7 +129,7 @@ function __rvm_completion_reply
|
|
142
129
|
esac
|
143
130
|
}
|
144
131
|
|
145
|
-
function
|
132
|
+
function _rvm {
|
146
133
|
|
147
134
|
__rvm_cleanup_variables
|
148
135
|
__rvm_load-rvmrc
|
@@ -150,7 +137,6 @@ function rvm {
|
|
150
137
|
__rvm_load_defaults
|
151
138
|
__rvm_parse-args $@
|
152
139
|
|
153
|
-
if [ -z "$rvm_debug_flag" ] ; then set +x ; else set -x ; fi
|
154
140
|
result=0
|
155
141
|
case "$rvm_action" in
|
156
142
|
install) __rvm_install ; result=$? ;;
|
@@ -206,7 +192,6 @@ function rvm {
|
|
206
192
|
fi
|
207
193
|
result=1
|
208
194
|
esac
|
209
|
-
if [ "$rvm_debug_flag" = "1" ] ; then set +x ; unset rvm_debug_flag ; fi
|
210
195
|
return $result
|
211
196
|
}
|
212
197
|
|
File without changes
|
data/scripts/install
ADDED
@@ -0,0 +1,173 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
user=`whoami`
|
4
|
+
if [ "$user" = "root" ] ; then
|
5
|
+
echo -e "\033[0;31m <e> \033[0mroot user support is not yet implemented.\033[0m"
|
6
|
+
exit 1
|
7
|
+
fi
|
8
|
+
|
9
|
+
item="\033[0;32m* \033[0m"
|
10
|
+
question="\n\033[0;32m<?>\033[0m"
|
11
|
+
cwd=$(pwd)
|
12
|
+
source_dir="${source_dir:-`dirname $0 | xargs dirname`}"
|
13
|
+
if [ ! -d "$source_dir" ] ; then unset source_dir ; fi
|
14
|
+
source_dir="${source_dir:-$cwd}"
|
15
|
+
rvm_dir=~/.rvm
|
16
|
+
|
17
|
+
# State what is required to use rvm
|
18
|
+
echo -e "\n\033[0;32mrvm\033[0m\n\n shell scripts that allows a user to manage multiple ruby versions in their own account."
|
19
|
+
echo -e "\n Installing rvm to ~/.rvm/ ..."
|
20
|
+
for dir_name in src scripts bin log archives config gems examples ; do
|
21
|
+
mkdir -p $rvm_dir/$dir_name
|
22
|
+
done
|
23
|
+
|
24
|
+
for dir_name in config scripts examples lib ; do
|
25
|
+
mkdir -p $rvm_dir/$dir_name
|
26
|
+
/bin/cp -Rf $source_dir/$dir_name $rvm_dir
|
27
|
+
done ; unset dir_name
|
28
|
+
|
29
|
+
for file_name in rvm-prompt gemsync ; do
|
30
|
+
mv $rvm_dir/scripts/$file_name $rvm_dir/bin/
|
31
|
+
chmod +x $rvm_dir/bin/$file_name
|
32
|
+
done ; unset file_name
|
33
|
+
|
34
|
+
results=$(grep 'scripts/rvm' ~/.bash_profile ~/.bashrc ~/.zshrc > /dev/null)
|
35
|
+
if [ $? -gt 0 ] ; then
|
36
|
+
if [ ! -z "`echo $PS1`" ] ; then
|
37
|
+
while : ; do
|
38
|
+
echo -n -e "$question Do you want this (s)cript to set this up for you, or do it (m)anually yourself ('s' or 'm')? "
|
39
|
+
read response
|
40
|
+
if [ "${response:0:1}" = "s" ] ; then
|
41
|
+
echo 'w00t!'
|
42
|
+
break
|
43
|
+
elif [ "${response:0:1}" = "m" ] ; then
|
44
|
+
echo -e " Please make sure that this line is in place."
|
45
|
+
break
|
46
|
+
fi
|
47
|
+
done
|
48
|
+
|
49
|
+
if [ "${response:0:1}" = "s" ] ; then
|
50
|
+
|
51
|
+
while : ; do
|
52
|
+
echo -n -e "$question Do you use b(a)sh or (z)sh or b(o)th for your shell (the default on most *nix systems is bash, press control + C to cancel the installation)\n(a/z/o)? "
|
53
|
+
read response
|
54
|
+
if [ "${response:0:1}" = "a" ] ; then
|
55
|
+
user_shell="bash"
|
56
|
+
break
|
57
|
+
elif [ "${response:0:1}" = "z" ] ; then
|
58
|
+
user_shell="zsh"
|
59
|
+
break
|
60
|
+
elif [ "${response:0:1}" = "o" ] ; then
|
61
|
+
user_shell="both"
|
62
|
+
break
|
63
|
+
fi
|
64
|
+
done
|
65
|
+
fi
|
66
|
+
else
|
67
|
+
user_shell="both"
|
68
|
+
fi
|
69
|
+
|
70
|
+
if [ "$user_shell" = "bash" -o "$user_shell" = "both" ] ; then
|
71
|
+
touch ~/.bash_profile
|
72
|
+
if [ -z "`grep '\.rvm/scripts/rvm' ~/.bash_profile`" ] ; then
|
73
|
+
echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.bash_profile."
|
74
|
+
echo -e "\n" >> ~/.bash_profile
|
75
|
+
echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.bash_profile
|
76
|
+
fi
|
77
|
+
touch ~/.bashrc
|
78
|
+
if [ -z "`grep '\.rvm/scripts/rvm' ~/.bashrc`" ] ; then
|
79
|
+
echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.bashrc."
|
80
|
+
echo -e "\n" >> ~/.bashrc
|
81
|
+
echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.bashrc
|
82
|
+
fi
|
83
|
+
|
84
|
+
fi
|
85
|
+
|
86
|
+
if [ "$user_shell" = "zsh" -o "$user_shell" = "both" ] ; then
|
87
|
+
touch ~/.zshrc
|
88
|
+
if [ -z "`grep '\.rvm/scripts/rvm' ~/.zshrc`" ] ; then
|
89
|
+
echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.zshrc."
|
90
|
+
echo -e "\n" >> ~/.zshrc
|
91
|
+
echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.zshrc
|
92
|
+
fi
|
93
|
+
fi
|
94
|
+
fi
|
95
|
+
|
96
|
+
echo -e "\n Ensuring that rvm script location in $file is scripts/rvm not bin/rvm for: ~/.bash_profile, ~/.bashrc, ~/.zshrc..."
|
97
|
+
for file in ~/.bash_profile ~/.bashrc ~/.zshrc ; do
|
98
|
+
if [ -s $file ] ; then
|
99
|
+
if [ -L $file ] ; then # If the file is a symlink,
|
100
|
+
actual_file=`readlink $file` # read the link target so we can preserve it.
|
101
|
+
else
|
102
|
+
actual_file="$file"
|
103
|
+
fi
|
104
|
+
|
105
|
+
grep 'rvm\/bin\/rvm' $actual_file > /dev/null
|
106
|
+
if [ $? -eq 0 ] ; then
|
107
|
+
sed -i.orig 's/rvm\/bin\/rvm/rvm\/scripts\/rvm/g' $actual_file
|
108
|
+
rm -f $actual_file.orig
|
109
|
+
fi
|
110
|
+
|
111
|
+
if [ -f ~/.profile ] ; then
|
112
|
+
grep '.profile' $actual_file > /dev/null
|
113
|
+
if [ $? -gt 0 ] ; then
|
114
|
+
profile=~/.profile
|
115
|
+
echo -e "\n" >> $actual_file
|
116
|
+
echo "source $profile" >> $actual_file
|
117
|
+
fi
|
118
|
+
fi
|
119
|
+
fi
|
120
|
+
done
|
121
|
+
|
122
|
+
if [ -f ~/.rvm/bin/rvm ] ; then
|
123
|
+
echo -e "\n Removing old rvm file from ~/.rvm/bin/rvm..."
|
124
|
+
rm -f ~/.rvm/bin/rvm
|
125
|
+
fi
|
126
|
+
|
127
|
+
system=`uname`
|
128
|
+
echo -e "\n \033[0;33mNOTES: \033[0m"
|
129
|
+
if [ "$system" = "Linux" ] ; then
|
130
|
+
rvm_apt_get_binary=`which apt-get 2> /dev/null`
|
131
|
+
rvm_emerge_binary=`which emerge 2> /dev/null`
|
132
|
+
rvm_pacman_binary=`which pacman 2> /dev/null`
|
133
|
+
rvm_yum_binary=`which yum 2> /dev/null`
|
134
|
+
|
135
|
+
if [ ! -z "$rvm_apt_get_binary" ] ; then
|
136
|
+
echo -e " $item For jRuby (if you wish to use it) you will need:"
|
137
|
+
echo -e " $ sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk"
|
138
|
+
echo -e " $item For ree (if you wish to use it) you will need:"
|
139
|
+
echo -e " $ sudo apt-get install libreadline5-dev libssl-dev bison"
|
140
|
+
|
141
|
+
elif [ ! -z "$rvm_emerge_binary" ] ; then
|
142
|
+
echo -e " $item For jRuby (if you wish to use it) you will need:"
|
143
|
+
echo -e " $ sudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
|
144
|
+
|
145
|
+
elif [ ! -z "$rvm_pacman_binary" ] ; then
|
146
|
+
echo -e " $item For jRuby (if you wish to use it) you will need:"
|
147
|
+
echo -e " $ sudo pacman -Sy jdk jre"
|
148
|
+
|
149
|
+
elif [ ! -z "$rvm_yum_binary" ] ; then
|
150
|
+
echo -e " $item For ree (if you wish to use it) you will need:"
|
151
|
+
echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
|
152
|
+
|
153
|
+
else
|
154
|
+
echo -e " $item For jRuby (if you wish to use it) you will need:"
|
155
|
+
echo -e " The SUN java runtime environment and development kit."
|
156
|
+
fi
|
157
|
+
elif [ "$system" = "Darwin" ] ; then
|
158
|
+
echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
|
159
|
+
echo -e " $item If you intend on installing MacRuby you must install LLVM first."
|
160
|
+
fi
|
161
|
+
|
162
|
+
echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
|
163
|
+
echo -e " $item if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi"
|
164
|
+
echo -e " $item CLOSE THIS SHELL AND OPEN A NEW ONE in order to use rvm."
|
165
|
+
|
166
|
+
echo -e "\n \033[0;33mRTFM: \033[0m http://rvm.beginrescueend.com/ \n"
|
167
|
+
echo -e '\033[0;32mw⦿‿⦿t!\033[0m'
|
168
|
+
echo -e "\n ~ Wayne\n"
|
169
|
+
|
170
|
+
source $rvm_dir/scripts/rvm
|
171
|
+
rvm -v
|
172
|
+
echo
|
173
|
+
|