rvm 0.0.61 → 0.0.62
Sign up to get free protection for your applications and to get access to all the features.
- data/install +20 -20
- data/lib/VERSION.yml +1 -1
- data/rvm.gemspec +2 -2
- data/scripts/cli +55 -52
- data/scripts/completion +9 -9
- data/scripts/gems +57 -57
- data/scripts/install +20 -20
- data/scripts/ruby-installer +101 -97
- data/scripts/rvm +2 -2
- data/scripts/rvm-install +20 -20
- data/scripts/rvm-prompt +5 -2
- data/scripts/selector +59 -59
- data/scripts/update +20 -20
- data/scripts/utility +111 -119
- metadata +2 -2
data/install
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
3
|
user="$(whoami)"
|
4
|
-
if [ "root" = "$user" ] ; then
|
4
|
+
if [[ "root" = "$user" ]] ; then
|
5
5
|
echo -e "$(tput setaf 1) <e> root user support is not yet implemented.$(tput sgr0)"
|
6
6
|
exit 1
|
7
7
|
fi
|
@@ -10,7 +10,7 @@ item="$(tput setaf 2)* $(tput sgr0)"
|
|
10
10
|
question="\n$(tput setaf 2)<?>$(tput sgr0)"
|
11
11
|
cwd=$(pwd)
|
12
12
|
source_dir="${source_dir:-"$(dirname $0 | xargs dirname)"}"
|
13
|
-
if [ ! -d "$source_dir" ] ; then unset source_dir ; fi
|
13
|
+
if [[ ! -d "$source_dir" ]] ; then unset source_dir ; fi
|
14
14
|
source_dir="${source_dir:-$cwd}"
|
15
15
|
rvm_path=~/.rvm
|
16
16
|
|
@@ -32,34 +32,34 @@ for file_name in rvm-prompt gemsync ; do
|
|
32
32
|
chmod +x $rvm_path/bin/$file_name
|
33
33
|
done ; unset file_name
|
34
34
|
|
35
|
-
if [ -z "$rvm_loaded_flag" ] ; then
|
35
|
+
if [[ -z "$rvm_loaded_flag" ]] ; then
|
36
36
|
for rcfile in .bash_profile .bashrc .zshrc ; do
|
37
|
-
if [ ! -e ~/$rcfile ] ; then touch ~/$rcfile ; fi
|
38
|
-
if [ -z "$(awk '/\.rvm\/scripts\/rvm/' ~/$rcfile)" ] ; then
|
39
|
-
echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/$rcfile."
|
40
|
-
echo -e "\n# rvm-install added line:\nif [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi\n" >> ~/$rcfile
|
37
|
+
if [[ ! -e ~/$rcfile ]] ; then touch ~/$rcfile ; fi
|
38
|
+
if [[ -z "$(awk '/\.rvm\/scripts\/rvm/' ~/$rcfile)" ]] ; then
|
39
|
+
echo "Adding 'if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/$rcfile."
|
40
|
+
echo -e "\n# rvm-install added line:\nif [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi\n" >> ~/$rcfile
|
41
41
|
fi
|
42
42
|
done
|
43
43
|
fi
|
44
44
|
|
45
45
|
echo -e "\n Ensuring that rvm script location in $file is scripts/rvm not bin/rvm for: ~/.bash_profile, ~/.bashrc, ~/.zshrc..."
|
46
46
|
for file in ~/.bash_profile ~/.bashrc ~/.zshrc ; do
|
47
|
-
if [ -s $file ] ; then
|
48
|
-
if [ -L $file ] ; then # If the file is a symlink,
|
47
|
+
if [[ -s $file ]] ; then
|
48
|
+
if [[ -L $file ]] ; then # If the file is a symlink,
|
49
49
|
actual_file="$(readlink $file)" # read the link target so we can preserve it.
|
50
50
|
else
|
51
51
|
actual_file="$file"
|
52
52
|
fi
|
53
53
|
|
54
54
|
grep 'rvm\/bin\/rvm' $actual_file > /dev/null
|
55
|
-
if [ $? -eq 0 ] ; then
|
55
|
+
if [[ $? -eq 0 ]] ; then
|
56
56
|
sed -i.orig 's#rvm/bin/rvm #rvm/scripts/rvm #g' $actual_file
|
57
57
|
rm -f $actual_file.orig
|
58
58
|
fi
|
59
59
|
|
60
|
-
if [ -f ~/.profile ] ; then
|
60
|
+
if [[ -f ~/.profile ]] ; then
|
61
61
|
grep '.profile' $actual_file > /dev/null
|
62
|
-
if [ $? -gt 0 ] ; then
|
62
|
+
if [[ $? -gt 0 ]] ; then
|
63
63
|
profile=~/.profile
|
64
64
|
echo -e "\n" >> $actual_file
|
65
65
|
echo "source $profile" >> $actual_file
|
@@ -68,34 +68,34 @@ for file in ~/.bash_profile ~/.bashrc ~/.zshrc ; do
|
|
68
68
|
fi
|
69
69
|
done
|
70
70
|
|
71
|
-
if [ -f ~/.rvm/bin/rvm ] ; then
|
71
|
+
if [[ -f ~/.rvm/bin/rvm ]] ; then
|
72
72
|
echo -e "\n Removing old rvm file from ~/.rvm/bin/rvm..."
|
73
73
|
rm -f ~/.rvm/bin/rvm
|
74
74
|
fi
|
75
75
|
|
76
76
|
system="$(uname)"
|
77
77
|
echo -e "\n $(tput setaf 3)NOTES: $(tput sgr0)\n"
|
78
|
-
if [ "Linux" = "$system" ] ; then
|
78
|
+
if [[ "Linux" = "$system" ]] ; then
|
79
79
|
rvm_apt_get_binary="$(which aptitude 2> /dev/null)"
|
80
80
|
rvm_emerge_binary="$(which emerge 2> /dev/null)"
|
81
81
|
rvm_pacman_binary="$(which pacman 2> /dev/null)"
|
82
82
|
rvm_yum_binary="$(which yum 2> /dev/null)"
|
83
83
|
|
84
|
-
if [ ! -z "$rvm_apt_get_binary" ] ; then
|
84
|
+
if [[ ! -z "$rvm_apt_get_binary" ]] ; then
|
85
85
|
echo -e " $item For jRuby (if you wish to use it) you will need:"
|
86
86
|
echo -e " $ sudo aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
|
87
87
|
echo -e " $item For ree (if you wish to use it) you will need:"
|
88
88
|
echo -e " $ sudo aptitude install libreadline5-dev libssl-dev bison"
|
89
89
|
|
90
|
-
elif [ ! -z "$rvm_emerge_binary" ] ; then
|
90
|
+
elif [[ ! -z "$rvm_emerge_binary" ]] ; then
|
91
91
|
echo -e " $item For jRuby (if you wish to use it) you will need:"
|
92
92
|
echo -e " $ sudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
|
93
93
|
|
94
|
-
elif [ ! -z "$rvm_pacman_binary" ] ; then
|
94
|
+
elif [[ ! -z "$rvm_pacman_binary" ]] ; then
|
95
95
|
echo -e " $item For jRuby (if you wish to use it) you will need:"
|
96
96
|
echo -e " $ sudo pacman -Sy jdk jre"
|
97
97
|
|
98
|
-
elif [ ! -z "$rvm_yum_binary" ] ; then
|
98
|
+
elif [[ ! -z "$rvm_yum_binary" ]] ; then
|
99
99
|
echo -e " $item For ree (if you wish to use it) you will need:"
|
100
100
|
echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
|
101
101
|
|
@@ -103,13 +103,13 @@ if [ "Linux" = "$system" ] ; then
|
|
103
103
|
echo -e " $item For jRuby (if you wish to use it) you will need:"
|
104
104
|
echo -e " The SUN java runtime environment and development kit."
|
105
105
|
fi
|
106
|
-
elif [ "Darwin" = "$system" ] ; then
|
106
|
+
elif [[ "Darwin" = "$system" ]] ; then
|
107
107
|
echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
|
108
108
|
echo -e " $item If you intend on installing MacRuby you must install LLVM first."
|
109
109
|
fi
|
110
110
|
|
111
111
|
echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
|
112
|
-
echo -e " $item if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi"
|
112
|
+
echo -e " $item if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi"
|
113
113
|
echo -e " $item CLOSE THIS SHELL AND OPEN A NEW ONE in order to use rvm."
|
114
114
|
|
115
115
|
echo -e "\n \033[0;33mRTFM: $(tput sgr0) http://rvm.beginrescueend.com/ \n"
|
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.62"
|
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-10-
|
12
|
+
s.date = %q{2009-10-22}
|
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/cli
CHANGED
@@ -5,17 +5,14 @@ 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.10.19"
|
9
8
|
}
|
10
9
|
|
11
|
-
function __rvm_version { __rvm_meta ; echo "rvm $rvm_meta_version ($
|
10
|
+
function __rvm_version { __rvm_meta ; echo "rvm ${rvm_meta_version} by ${rvm_meta_author} (${rvm_meta_author_email}) [${rvm_meta_website}]" ; }
|
12
11
|
|
13
12
|
function __rvm_usage {
|
14
13
|
|
15
|
-
__rvm_meta
|
16
|
-
|
17
14
|
echo -e "
|
18
|
-
|
15
|
+
$(__rvm_version)
|
19
16
|
|
20
17
|
Usage
|
21
18
|
|
@@ -94,6 +91,7 @@ Options
|
|
94
91
|
--nice - process niceness (for slow computers, default 0)
|
95
92
|
-m|--gem-set - use a named gem set, instead of the default set.
|
96
93
|
--rm-gem-set - Remove a named gem set
|
94
|
+
--ree-options - Options passed directly to ree's './installer' on the command line.
|
97
95
|
|
98
96
|
Resources:
|
99
97
|
|
@@ -104,7 +102,7 @@ Resources:
|
|
104
102
|
}
|
105
103
|
|
106
104
|
function __rvm_parse_args {
|
107
|
-
while [ $# -gt 0 ] ; do
|
105
|
+
while [[ $# -gt 0 ]] ; do
|
108
106
|
rvm_token="$1" ; shift
|
109
107
|
case "$rvm_token" in
|
110
108
|
install|uninstall|path|info|setup|version|srcdir|list|reset|debug|reload|implode|readline|gemsync|update|iconv|openssl|ncurses|zlib|readline)
|
@@ -113,7 +111,7 @@ function __rvm_parse_args {
|
|
113
111
|
|
114
112
|
use)
|
115
113
|
rvm_action=$rvm_token
|
116
|
-
if [ "ruby" = "$1" ] ; then shift ; fi
|
114
|
+
if [[ "ruby" = "$1" ]] ; then shift ; fi
|
117
115
|
;;
|
118
116
|
|
119
117
|
inspect)
|
@@ -123,7 +121,7 @@ function __rvm_parse_args {
|
|
123
121
|
;;
|
124
122
|
|
125
123
|
rm|remove)
|
126
|
-
rvm_action=remove
|
124
|
+
rvm_action="remove"
|
127
125
|
;;
|
128
126
|
|
129
127
|
system|default)
|
@@ -134,7 +132,7 @@ function __rvm_parse_args {
|
|
134
132
|
jruby|ree|macruby|rbx|rubinius|default|all)
|
135
133
|
rvm_ruby_interpreter="$rvm_token"
|
136
134
|
rvm_action="${rvm_action:-use}"
|
137
|
-
#if [ ! -z "$(echo $1 | awk '/^[0-9]/')" ] ; then
|
135
|
+
#if [[ ! -z "$(echo $1 | awk '/^[0-9]/')" ]] ; then
|
138
136
|
if [[ ! -z "$1" ]] && [[ "$1" =~ ^[0-9] ]] ; then
|
139
137
|
rvm_ruby_version=$1 ; shift
|
140
138
|
fi
|
@@ -142,9 +140,9 @@ function __rvm_parse_args {
|
|
142
140
|
|
143
141
|
gems|gemset)
|
144
142
|
rvm_action="gems"
|
145
|
-
if [ "name" = "$1"
|
143
|
+
if [[ "name" = "$1" ]] || [[ "dir" = "$1" ]] || [[ "list" = "$1" ]] || [[ "empty" = "$1" ]] || [[ "delete" = "$1" ]] ; then
|
146
144
|
eval "rvm_${1}_flag=1" ; shift
|
147
|
-
elif [ "dump" = "$1"
|
145
|
+
elif [[ "dump" = "$1" ]] || [[ "$1" = "load" ]] ; then
|
148
146
|
eval "rvm_${1}_flag=1" ; shift
|
149
147
|
else
|
150
148
|
rvm_use_flag=1 # Default is to use the (named) gem set.
|
@@ -153,8 +151,8 @@ function __rvm_parse_args {
|
|
153
151
|
|
154
152
|
gemdir)
|
155
153
|
rvm_action=$rvm_token
|
156
|
-
if [ "system" = "$1" ] ; then rvm_ruby_interpreter="system" ; shift ; fi
|
157
|
-
if [ "user" = "$1" ] ; then rvm_ruby_interpreter="user" ; shift ; fi
|
154
|
+
if [[ "system" = "$1" ]] ; then rvm_ruby_interpreter="system" ; shift ; fi
|
155
|
+
if [[ "user" = "$1" ]] ; then rvm_ruby_interpreter="user" ; shift ; fi
|
158
156
|
rvm_ruby_interpreter="${rvm_ruby_interpreter:-current}"
|
159
157
|
;;
|
160
158
|
|
@@ -165,13 +163,13 @@ function __rvm_parse_args {
|
|
165
163
|
|
166
164
|
gemdup)
|
167
165
|
rvm_action=$rvm_token
|
168
|
-
if [ -z "$1" ] ; then
|
166
|
+
if [[ -z "$1" ]] ; then
|
169
167
|
rvm_ruby_interpreter="default"
|
170
|
-
elif [ "system" = "$1" ] ; then
|
168
|
+
elif [[ "system" = "$1" ]] ; then
|
171
169
|
rvm_ruby_interpreter=$1 ; shift
|
172
|
-
elif [ "user" = "$1" ] ; then
|
170
|
+
elif [[ "user" = "$1" ]] ; then
|
173
171
|
rvm_ruby_interpreter=$1 ; shift
|
174
|
-
elif [ "default" = "$1" ] ; then
|
172
|
+
elif [[ "default" = "$1" ]] ; then
|
175
173
|
rvm_ruby_interpreter=$1 ; shift
|
176
174
|
else
|
177
175
|
rvm_ruby_interpreter=$1 ; shift
|
@@ -180,28 +178,27 @@ function __rvm_parse_args {
|
|
180
178
|
;;
|
181
179
|
|
182
180
|
do|ruby|rake|gem|rubydo|rakedo|gemdo)
|
183
|
-
if [ "do" = "$rvm_action" ] ; then rvm_action="ruby" ; fi
|
181
|
+
if [[ "do" = "$rvm_action" ]] ; then rvm_action="ruby" ; fi
|
184
182
|
rvm_action=$(echo $rvm_token | sed 's#do##g')
|
185
183
|
|
186
|
-
if [ "rake" = "$rvm_action"
|
187
|
-
if [ -z "$1" ] ; then
|
184
|
+
if [[ "rake" = "$rvm_action" ]] || [[ "gem" = "$rvm_action" ]] || [[ "ruby" = "$rvm_action" ]] ; then
|
185
|
+
if [[ -z "$1" ]] ; then
|
188
186
|
rvm_action="error"
|
189
187
|
rvm_error_message="the 'ruby' and 'gem' actions must be followed by arguments."
|
190
|
-
rvm_parse_break=1
|
191
188
|
else
|
192
189
|
rvm_action="ruby"
|
193
190
|
rvm_ruby_args="$rvm_token $@"
|
194
191
|
rvm_parse_break=1
|
195
192
|
fi
|
196
193
|
else
|
197
|
-
if [ ! -z "$(echo $1 | awk '/^-/')" ] ; then
|
194
|
+
if [[ ! -z "$(echo $1 | awk '/^-/')" ]] ; then
|
198
195
|
unset rvm_ruby_version
|
199
196
|
else
|
200
|
-
if [ ! -z "$(echo $1 | awk '/^[0-9]/')" ] ; then
|
197
|
+
if [[ ! -z "$(echo $1 | awk '/^[0-9]/')" ]] ; then
|
201
198
|
rvm_ruby_version=$(echo "$1" | tr ',' ' ') ; shift
|
202
199
|
unset rvm_ruby_interpreter
|
203
200
|
else
|
204
|
-
if [ "jruby" = "$1"
|
201
|
+
if [[ "jruby" = "$1" ]] || [[ "rbx" = "$1" ]] || [[ "rubinius" = "$1" ]] || [[ "macruby" = "$1" ]] || [[ "ree" = "$1" ]] || [[ "ruby-enterprise" = "$1" ]] ; then
|
205
202
|
rvm_ruby_interpreter=$1 ; shift
|
206
203
|
else
|
207
204
|
unset rvm_ruby_interpreter rvm_ruby_version
|
@@ -227,9 +224,9 @@ function __rvm_parse_args {
|
|
227
224
|
;;
|
228
225
|
|
229
226
|
1.2.0|1.3|1.3.0|1.3.1|1.4|1.4.0)
|
230
|
-
if [ "1.3" = "$rvm_token" ] ; then
|
227
|
+
if [[ "1.3" = "$rvm_token" ]] ; then
|
231
228
|
rvm_ruby_version="1.3.1"
|
232
|
-
elif [ "1.4" = "$rvm_token" ] ; then
|
229
|
+
elif [[ "1.4" = "$rvm_token" ]] ; then
|
233
230
|
rvm_ruby_version="1.4.0"
|
234
231
|
else
|
235
232
|
rvm_ruby_version="$rvm_token"
|
@@ -239,7 +236,7 @@ function __rvm_parse_args {
|
|
239
236
|
;;
|
240
237
|
|
241
238
|
-v|--version)
|
242
|
-
if [ -z "$1" ] ; then
|
239
|
+
if [[ -z "$1" ]] ; then
|
243
240
|
rvm_action="version"
|
244
241
|
else
|
245
242
|
rvm_ruby_version="$1"
|
@@ -251,6 +248,10 @@ function __rvm_parse_args {
|
|
251
248
|
rvm_ruby_repo_url=$rvm_token
|
252
249
|
;;
|
253
250
|
|
251
|
+
--ree-options)
|
252
|
+
rvm_ree_options="$rvm_token"
|
253
|
+
;;
|
254
|
+
|
254
255
|
-t|--tag)
|
255
256
|
rvm_ruby_tag="$1";
|
256
257
|
rvm_action="${rvm_action:-use}"
|
@@ -276,7 +277,7 @@ function __rvm_parse_args {
|
|
276
277
|
;;
|
277
278
|
|
278
279
|
--bin)
|
279
|
-
if [ "update" = "$rvm_action" ] ; then
|
280
|
+
if [[ "update" = "$rvm_action" ]] ; then
|
280
281
|
rvm_bin_flag=1
|
281
282
|
else
|
282
283
|
rvm_bin_path="$1" ; shift
|
@@ -284,7 +285,7 @@ function __rvm_parse_args {
|
|
284
285
|
;;
|
285
286
|
|
286
287
|
-j)
|
287
|
-
if [ ! -z "$1" ] ; then
|
288
|
+
if [[ ! -z "$1" ]] ; then
|
288
289
|
rvm_make_flags="$rvm_make_flags -j$1"
|
289
290
|
shift
|
290
291
|
else
|
@@ -295,7 +296,7 @@ function __rvm_parse_args {
|
|
295
296
|
|
296
297
|
|
297
298
|
-C|--configure)
|
298
|
-
if [ ! -z "$1" ] ; then
|
299
|
+
if [[ ! -z "$1" ]] ; then
|
299
300
|
rvm_ruby_configure="$(echo $1 | tr ',' ' ')"
|
300
301
|
shift
|
301
302
|
else
|
@@ -305,7 +306,7 @@ function __rvm_parse_args {
|
|
305
306
|
;;
|
306
307
|
|
307
308
|
-r|--require)
|
308
|
-
if [ -z "$1" ] ; then
|
309
|
+
if [[ -z "$1" ]] ; then
|
309
310
|
rvm_action="error"
|
310
311
|
rvm_error_message="-r|--require *must* be followed by a library name."
|
311
312
|
else
|
@@ -315,7 +316,7 @@ function __rvm_parse_args {
|
|
315
316
|
;;
|
316
317
|
|
317
318
|
-I|--include)
|
318
|
-
if [ -z "$1" ] ; then
|
319
|
+
if [[ -z "$1" ]] ; then
|
319
320
|
rvm_action="error"
|
320
321
|
rvm_error_message="-I|--include *must* be followed by a path."
|
321
322
|
else
|
@@ -373,32 +374,33 @@ function __rvm_parse_args {
|
|
373
374
|
;;
|
374
375
|
|
375
376
|
*)
|
376
|
-
if [ ! -z "$rvm_token" ] ; then
|
377
|
-
if [ "gems" = "$rvm_action" ] ; then
|
378
|
-
if [ ! -z "$(echo $rvm_token | awk '/\.gems$/')" ] ; then
|
377
|
+
if [[ ! -z "$rvm_token" ]] ; then
|
378
|
+
if [[ "gems" = "$rvm_action" ]] ; then
|
379
|
+
if [[ ! -z "$(echo $rvm_token | awk '/\.gems$/')" ]] ; then
|
379
380
|
rvm_file_name="$(echo $rvm_token | sed 's#\.gems##g').gems"
|
380
|
-
# elif [ ! -z "$(echo $rvm_token | awk '/\.gems$/')" ] ; then
|
381
|
+
# elif [[ ! -z "$(echo $rvm_token | awk '/\.gems$/')" ]] ; then
|
381
382
|
else
|
382
383
|
rvm_gem_set_name="$(echo $rvm_token | sed 's#\.gems##g')"
|
383
384
|
rvm_file_name="$rvm_gem_set_name.gems"
|
384
385
|
fi
|
385
|
-
elif [ ! -z "$(echo $rvm_token | awk '/,/')" ] ; then
|
386
|
+
elif [[ ! -z "$(echo $rvm_token | awk '/,/')" ]] ; then
|
386
387
|
rvm_ruby_version="$rvm_token"
|
387
|
-
if [ -z "$rvm_action" ] ; then
|
388
|
+
if [[ -z "$rvm_action" ]] ; then
|
388
389
|
rvm_action="do" # Not sure if we really want to do this but we'll try it out.
|
389
390
|
fi
|
390
|
-
elif [ ! -z "$(echo $rvm_token | awk '/^.+%.+$/')" ] ; then
|
391
|
+
elif [[ ! -z "$(echo $rvm_token | awk '/^.+%.+$/')" ]] ; then
|
391
392
|
rvm_gem_set_name="$(echo $rvm_token | awk -F'%' '{print $2}')"
|
392
393
|
rvm_ruby_string="$(echo $rvm_token | awk -F'%' '{print $1}')"
|
393
|
-
#elif [ ! -z "$(echo $rvm_token | awk '/^[0-9].[0-9]/')" ] ; then
|
394
|
+
#elif [[ ! -z "$(echo $rvm_token | awk '/^[0-9].[0-9]/')" ]] ; then
|
394
395
|
elif [[ ! -z "$rvm_token" ]] && [[ "$rvm_token" =~ ^[0-9].[0-9] ]] ; then
|
395
396
|
rvm_ruby_string="$rvm_token"
|
397
|
+
rvm_action="${rvm_action:-rvm_token}"
|
396
398
|
else
|
397
|
-
if [ ! -z "$(echo $rvm_token | awk '/\.rb$/{print}')" ] ; then # we have a specified ruby script
|
399
|
+
if [[ ! -z "$(echo $rvm_token | awk '/\.rb$/{print}')" ]] ; then # we have a specified ruby script
|
398
400
|
#if [[ ! -z "$rvm_token" ]] && [[ " ! $rvm_token =~ \.rb$ ]] ; then # we have a specified ruby script
|
399
401
|
rvm_ruby_args=$rvm_token
|
400
402
|
rvm_ruby_file=$rvm_token
|
401
|
-
if [ -z "$rvm_action" ] ; then
|
403
|
+
if [[ -z "$rvm_action" ]] ; then
|
402
404
|
rvm_action="ruby" # Not sure if we really want to do this but we'll try it out.
|
403
405
|
fi
|
404
406
|
else
|
@@ -410,18 +412,17 @@ function __rvm_parse_args {
|
|
410
412
|
rvm_action="error"
|
411
413
|
rvm_error_message="Unrecognized command line argument(s): '$rvm_token $@'"
|
412
414
|
fi
|
413
|
-
if [ "error" = "$rvm_action" ] ; then
|
415
|
+
if [[ "error" = "$rvm_action" ]] ; then
|
414
416
|
break;
|
415
417
|
fi
|
416
418
|
|
417
419
|
esac
|
418
420
|
|
419
|
-
if [ -z "$rvm_action"
|
420
|
-
|
421
|
-
if [ ! -z "$rvm_parse_break" -o ! -z "$rvm_error_message" ] ; then unset rvm_parse_break; break; fi
|
421
|
+
if [[ -z "$rvm_action" ]] && [[ ! -z "$rvm_ruby_string" ]] ; then rvm_action="use" ; fi
|
422
|
+
if [[ ! -z "$rvm_parse_break" ]] || [[ ! -z "$rvm_error_message" ]] ; then unset rvm_parse_break; break; fi
|
422
423
|
done
|
423
424
|
|
424
|
-
if [ ! -z "$rvm_error_message" ] ; then __rvm_pushpop ; return 1 ; fi
|
425
|
+
if [[ ! -z "$rvm_error_message" ]] ; then __rvm_pushpop ; return 1 ; fi
|
425
426
|
}
|
426
427
|
|
427
428
|
function rvm {
|
@@ -434,7 +435,7 @@ function rvm {
|
|
434
435
|
__rvm_load_defaults
|
435
436
|
__rvm_parse_args $@
|
436
437
|
|
437
|
-
if [ -z "$rvm_trace_flag" ] ; then set +x ; else set -x ; fi
|
438
|
+
if [[ -z "$rvm_trace_flag" ]] ; then set +x ; else set -x ; fi
|
438
439
|
result=0
|
439
440
|
case "$rvm_action" in
|
440
441
|
use) __rvm_use ; result=$? ;;
|
@@ -445,7 +446,6 @@ function rvm {
|
|
445
446
|
version) __rvm_version ; result=$? ;;
|
446
447
|
reset) __rvm_reset ; result=$? ;;
|
447
448
|
# TODO: how can we use bin_path here for reload, default file?
|
448
|
-
reload) __rvm_reload ; result=$? ;;
|
449
449
|
implode) __rvm_implode ; result=$? ;;
|
450
450
|
update) __rvm_update ; result=$? ;;
|
451
451
|
readline) __rvm_readline_install ; result=$? ;;
|
@@ -455,6 +455,9 @@ function rvm {
|
|
455
455
|
ruby) __rvm_do ; result=$? ;;
|
456
456
|
inspect) __rvm_inspect ; result=$? ;;
|
457
457
|
gems) __rvm_gems ; result=$? ;;
|
458
|
+
reload)
|
459
|
+
source "$rvm_path/scripts/rvm"
|
460
|
+
;;
|
458
461
|
|
459
462
|
iconv|openssl|ncurses|zlib|readline)
|
460
463
|
__rvm_${rvm_action}_install
|
@@ -480,7 +483,7 @@ function rvm {
|
|
480
483
|
info|debug)
|
481
484
|
__rvm_version
|
482
485
|
__rvm_info
|
483
|
-
if [ "debug" = "$rvm_action" ] ; then rvm_debug_flag=1 ; __rvm_debug ; fi
|
486
|
+
if [[ "debug" = "$rvm_action" ]] ; then rvm_debug_flag=1 ; __rvm_debug ; fi
|
484
487
|
;;
|
485
488
|
|
486
489
|
error)
|
@@ -490,7 +493,7 @@ function rvm {
|
|
490
493
|
;;
|
491
494
|
|
492
495
|
*)
|
493
|
-
if [ ! -z "$rvm_action" ] ; then
|
496
|
+
if [[ ! -z "$rvm_action" ]] ; then
|
494
497
|
__rvm_log "fail" "unknown action '$rvm_action'"
|
495
498
|
else
|
496
499
|
__rvm_usage
|
@@ -498,7 +501,7 @@ function rvm {
|
|
498
501
|
result=1
|
499
502
|
esac
|
500
503
|
|
501
|
-
if [ "1" = "$rvm_trace_flag" ] ; then set +x ; unset rvm_trace_flag ; fi
|
504
|
+
if [[ "1" = "$rvm_trace_flag" ]] ; then set +x ; unset rvm_trace_flag ; fi
|
502
505
|
|
503
506
|
return $result
|
504
507
|
}
|