rvm 0.0.61 → 0.0.62
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/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/scripts/rvm
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# http://gitub.com/wayneeseguin/rvm
|
7
7
|
#
|
8
8
|
|
9
|
-
if [ -s ~/.rvmrc ] ; then source ~/.rvmrc ; fi
|
9
|
+
if [[ -s ~/.rvmrc ]] ; then source ~/.rvmrc ; fi
|
10
10
|
eval rvm_path="${rvm_path:-~/.rvm}"
|
11
11
|
|
12
12
|
source $rvm_path/scripts/color
|
@@ -18,5 +18,5 @@ source $rvm_path/scripts/gems
|
|
18
18
|
|
19
19
|
rvm_loaded_flag=1 ; export rvm_loaded_flag
|
20
20
|
|
21
|
-
if [ -f $rvm_path/default ] ; then source $rvm_path/default ; fi
|
21
|
+
if [[ -f "$rvm_path/default" ]] ; then source $rvm_path/default ; fi
|
22
22
|
|
data/scripts/rvm-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/scripts/rvm-prompt
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
#!/bin/bash
|
2
|
-
if [ ! -z "$(which ruby | awk '/\.rvm/{print}')" ] ; then
|
3
|
-
|
2
|
+
if [[ ! -z "$(which ruby | awk '/\.rvm/{print}')" ]] ; then
|
3
|
+
command=$(which ruby)
|
4
|
+
if [[ ! -z "$command" ]] ; then
|
5
|
+
echo "[$(echo $command | xargs dirname | xargs dirname | xargs basename | tr '-' ':')]"
|
6
|
+
fi ; unset command
|
4
7
|
fi
|
5
8
|
|
data/scripts/selector
CHANGED
@@ -2,21 +2,21 @@
|
|
2
2
|
|
3
3
|
# __rvm_select implementation version patch_level
|
4
4
|
function __rvm_select {
|
5
|
-
if [ ! -z "$rvm_ruby_string" ] ; then
|
6
|
-
if [ ! -z "$(echo "$rvm_ruby_string" | awk '/^.+%.+$/')" ] ; then
|
5
|
+
if [[ ! -z "$rvm_ruby_string" ]] ; then
|
6
|
+
if [[ ! -z "$(echo "$rvm_ruby_string" | awk '/^.+%.+$/')" ]] ; then
|
7
7
|
rvm_gem_set_name="$(echo "$rvm_ruby_string" | awk -F'%' '{print $2}')"
|
8
8
|
rvm_ruby_string="$(echo "$rvm_ruby_string" | awk -F'%' '{print $1}')"
|
9
9
|
fi
|
10
10
|
|
11
|
-
if [ ! -z "$(echo "$rvm_ruby_string" | awk '/^[0-9]/')" ] ; then
|
11
|
+
if [[ ! -z "$(echo "$rvm_ruby_string" | awk '/^[0-9]/')" ]] ; then
|
12
12
|
rvm_ruby_interpreter="${rvm_ruby_interpreter:-ruby}"
|
13
13
|
rvm_ruby_version=$rvm_ruby_string
|
14
14
|
else
|
15
15
|
rvm_ruby_interpreter="$rvm_ruby_string"
|
16
16
|
unset rvm_ruby_version
|
17
17
|
fi
|
18
|
-
elif [ ! -z "$rvm_ruby_interpreter" ] ; then
|
19
|
-
if [ ! -z "$(echo $rvm_ruby_interpreter | awk '/^[0-9]/')" ] ; then
|
18
|
+
elif [[ ! -z "$rvm_ruby_interpreter" ]] ; then
|
19
|
+
if [[ ! -z "$(echo $rvm_ruby_interpreter | awk '/^[0-9]/')" ]] ; then
|
20
20
|
rvm_ruby_version=$rvm_ruby_interpreter
|
21
21
|
rvm_ruby_interpreter="ruby"
|
22
22
|
else
|
@@ -24,13 +24,13 @@ function __rvm_select {
|
|
24
24
|
fi
|
25
25
|
fi
|
26
26
|
|
27
|
-
if [ ! -z "$rvm_ruby_string" ] ; then __rvm_ruby_string ; fi
|
28
|
-
if [ "1.8" = "$rvm_ruby_version" ] ; then rvm_ruby_version="1.8.6" ; fi
|
29
|
-
if [ "1.9" = "$rvm_ruby_version" ] ; then rvm_ruby_version="1.9.1" ; fi
|
27
|
+
if [[ ! -z "$rvm_ruby_string" ]] ; then __rvm_ruby_string ; fi
|
28
|
+
if [[ "1.8" = "$rvm_ruby_version" ]] ; then rvm_ruby_version="1.8.6" ; fi
|
29
|
+
if [[ "1.9" = "$rvm_ruby_version" ]] ; then rvm_ruby_version="1.9.1" ; fi
|
30
30
|
|
31
31
|
case "$rvm_ruby_interpreter" in
|
32
32
|
macruby)
|
33
|
-
if [ "Darwin" = "$(uname)" ] ; then
|
33
|
+
if [[ "Darwin" = "$(uname)" ]] ; then
|
34
34
|
rvm_ruby_repo_url="${rvm_ruby_repo_url:-"$(__rvm_db "macruby_repo_url")"}"
|
35
35
|
rvm_ruby_version="${rvm_ruby_version:-head}"
|
36
36
|
rvm_ruby_package_name=${rvm_ruby_interpreter}-${rvm_ruby_version}
|
@@ -58,7 +58,7 @@ function __rvm_select {
|
|
58
58
|
jruby)
|
59
59
|
rvm_ruby_version="${rvm_ruby_version:-"$(__rvm_db "jruby_version")"}"
|
60
60
|
rvm_jruby_repo_url="${rvm_jruby_repo_url:-"git://kenai.com/jruby~main"}"
|
61
|
-
if [ ! -z "$(echo $rvm_ruby_version | awk '/^1.4/')" ] ; then
|
61
|
+
if [[ ! -z "$(echo $rvm_ruby_version | awk '/^1.4/')" ]] ; then
|
62
62
|
rvm_ruby_version="1.4.0RC1"
|
63
63
|
rvm_package_file="$rvm_ruby_interpreter-bin-${rvm_ruby_version}"
|
64
64
|
else
|
@@ -66,7 +66,7 @@ function __rvm_select {
|
|
66
66
|
fi
|
67
67
|
rvm_url="http://dist.codehaus.org/$rvm_ruby_interpreter/$rvm_ruby_version/$rvm_package_file.tar.gz"
|
68
68
|
unset rvm_ruby_patch_level
|
69
|
-
if [ -z "$(echo $rvm_ruby_version | awk '/^1\.[2-4]/')" ] ; then
|
69
|
+
if [[ -z "$(echo $rvm_ruby_version | awk '/^1\.[2-4]/')" ]] ; then
|
70
70
|
__rvm_log "fail" "Unknown jRuby version: $rvm_ruby_version"
|
71
71
|
fi
|
72
72
|
alias jruby_ng="jruby --ng"
|
@@ -76,26 +76,26 @@ function __rvm_select {
|
|
76
76
|
ruby-enterprise|ree)
|
77
77
|
rvm_ruby_interpreter=ree
|
78
78
|
rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "ree_version")"}
|
79
|
-
if [ "$rvm_ruby_version" != "head" ] ; then
|
79
|
+
if [[ "$rvm_ruby_version" != "head" ]] ; then
|
80
80
|
rvm_ruby_patch_level="${rvm_ruby_patch_level:-$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_patch_level")}"
|
81
81
|
fi
|
82
82
|
rvm_ruby_package_name="ree-$rvm_ruby_version-$rvm_ruby_patch_level"
|
83
83
|
rvm_ruby_package_file="ruby-enterprise-$rvm_ruby_version-$rvm_ruby_patch_level"
|
84
|
-
if [ -z "$(echo $rvm_ruby_version | awk '/^1\.8/')" ] ; then
|
84
|
+
if [[ -z "$(echo $rvm_ruby_version | awk '/^1\.8/')" ]] ; then
|
85
85
|
__rvm_log "fail" "Unknown Ruby Enterprise Edition version: $rvm_ruby_version"
|
86
86
|
fi
|
87
87
|
;;
|
88
88
|
|
89
89
|
ruby)
|
90
|
-
if [ ! -z "$rvm_ruby_tag" ] ; then
|
90
|
+
if [[ ! -z "$rvm_ruby_tag" ]] ; then
|
91
91
|
rvm_ruby_version=$(echo $rvm_ruby_tag | sed 's#^v##' | sed 's#/##' | awk -F'_' '{print 1 "." $2 "." $3 }')
|
92
92
|
# rvm_ruby_patch_level=$rvm_ruby_tag # $(echo $rvm_ruby_tag | sed 's#^v##' | sed 's#/##' | awk -F'_' '{print $4 }')
|
93
|
-
if [ -z "$rvm_ruby_patch_level" ] ; then rvm_ruby_patch_level=$rvm_Ruby_tag ; fi
|
93
|
+
if [[ -z "$rvm_ruby_patch_level" ]] ; then rvm_ruby_patch_level=$rvm_Ruby_tag ; fi
|
94
94
|
fi
|
95
|
-
if [ -z "$rvm_ruby_version" ] ; then rvm_ruby_version=$(__rvm_db "ruby_version") ; fi
|
96
|
-
if [ -z "$rvm_ruby_patch_level" ] ; then rvm_ruby_patch_level="$(__rvm_db "ruby_${rvm_ruby_version/ /}_patch_level")" ; fi
|
97
|
-
if [ -z "$rvm_ruby_patch_level" ] ; then unset rvm_ruby_patch_level ; fi
|
98
|
-
if [ -z "$rvm_ruby_version" ] ; then __rvm_log "fail" "Unknown ruby version: $rvm_ruby_version" ; fi
|
95
|
+
if [[ -z "$rvm_ruby_version" ]] ; then rvm_ruby_version=$(__rvm_db "ruby_version") ; fi
|
96
|
+
if [[ -z "$rvm_ruby_patch_level" ]] ; then rvm_ruby_patch_level="$(__rvm_db "ruby_${rvm_ruby_version/ /}_patch_level")" ; fi
|
97
|
+
if [[ -z "$rvm_ruby_patch_level" ]] ; then unset rvm_ruby_patch_level ; fi
|
98
|
+
if [[ -z "$rvm_ruby_version" ]] ; then __rvm_log "fail" "Unknown ruby version: $rvm_ruby_version" ; fi
|
99
99
|
;;
|
100
100
|
|
101
101
|
default|system|current|user)
|
@@ -103,7 +103,7 @@ function __rvm_select {
|
|
103
103
|
;;
|
104
104
|
|
105
105
|
*)
|
106
|
-
if [ ! -z "$MY_RUBY_HOME" ] ; then
|
106
|
+
if [[ ! -z "$MY_RUBY_HOME" ]] ; then
|
107
107
|
rvm_ruby_string=$(basename $MY_RUBY_HOME)
|
108
108
|
__rvm_select
|
109
109
|
else
|
@@ -111,8 +111,8 @@ function __rvm_select {
|
|
111
111
|
fi
|
112
112
|
esac
|
113
113
|
|
114
|
-
if [ ! -z "$rvm_ruby_revision" ] ; then
|
115
|
-
if [ "head" = "$rvm_ruby_revision"
|
114
|
+
if [[ ! -z "$rvm_ruby_revision" ]] ; then
|
115
|
+
if [[ "head" = "$rvm_ruby_revision" ]] || [[ "trunk" = "$rvm_ruby_revision" ]] ; then
|
116
116
|
rvm_ruby_patch_level="head"
|
117
117
|
else
|
118
118
|
rvm_ruby_patch_level="$rvm_ruby_revision"
|
@@ -121,16 +121,16 @@ function __rvm_select {
|
|
121
121
|
|
122
122
|
__rvm_gems_select
|
123
123
|
|
124
|
-
if [ ! -z "$rvm_ruby_interpreter"
|
124
|
+
if [[ ! -z "$rvm_ruby_interpreter" ]] && [[ ! -z "$rvm_ruby_version" ]] && [[ "system" != "$rvm_ruby_interpreter" ]] ; then
|
125
125
|
rvm_major_version=$(echo $rvm_ruby_version | awk -F'.' '{ print $2 }')
|
126
126
|
rvm_minor_version=$(echo $rvm_ruby_version | awk -F'.' '{ print $3 }')
|
127
127
|
|
128
|
-
if [ -z "$rvm_ruby_patch_level" ] ; then
|
128
|
+
if [[ -z "$rvm_ruby_patch_level" ]] ; then
|
129
129
|
rvm_ruby_package_name="${rvm_ruby_package_name:-"$rvm_ruby_interpreter-$rvm_ruby_version"}"
|
130
130
|
rvm_ruby_home="${rvm_ruby_home:-"$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version"}"
|
131
131
|
else
|
132
|
-
if [ "$rvm_ruby_interpreter" != "ree" ] ; then
|
133
|
-
if [ ! -z "$(echo $rvm_ruby_patch_level | awk '/^[0-9]/')" ] ; then
|
132
|
+
if [[ "$rvm_ruby_interpreter" != "ree" ]] ; then
|
133
|
+
if [[ ! -z "$(echo $rvm_ruby_patch_level | awk '/^[0-9]/')" ]] ; then
|
134
134
|
rvm_ruby_patch_level="p$rvm_ruby_patch_level"
|
135
135
|
fi
|
136
136
|
rvm_ruby_patch_level="$(echo $rvm_ruby_patch_level | sed 's#^pp#p#')" # sanity check, thanks sfpyra
|
@@ -148,36 +148,36 @@ function __rvm_select {
|
|
148
148
|
|
149
149
|
export rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_url rvm_ruby_patch_level rvm_ruby_configure rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_gem_set_name rvm_gem_path rvm_ruby_gem_home rvm_path rvm_src_path rvm_bin_path rvm_ruby_binary rvm_ruby_home rvm_log_path rvm_ruby_log_path rvm_src_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string
|
150
150
|
else
|
151
|
-
rvm_ruby_gem_home
|
151
|
+
rvm_ruby_gem_home="$GEM_HOME"
|
152
152
|
fi
|
153
153
|
}
|
154
154
|
|
155
155
|
function __rvm_use {
|
156
|
-
if [ -z "$rvm_ruby_selected_flag" ] ; then __rvm_select $* ; fi
|
157
|
-
if [ -z "$rvm_ruby_interpreter" ] ; then rvm_ruby_interpreter="default" ; fi
|
156
|
+
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select $* ; fi
|
157
|
+
if [[ -z "$rvm_ruby_interpreter" ]] ; then rvm_ruby_interpreter="default" ; fi
|
158
158
|
|
159
|
-
if [ "default" = "$rvm_ruby_interpreter" ] ; then
|
159
|
+
if [[ "default" = "$rvm_ruby_interpreter" ]] ; then
|
160
160
|
|
161
161
|
PATH=$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)
|
162
162
|
PATH=$rvm_bin_path:$PATH ; export PATH
|
163
163
|
|
164
|
-
if [ -s $rvm_path/default ] ; then
|
164
|
+
if [[ -s $rvm_path/default ]] ; then
|
165
165
|
source $rvm_path/default
|
166
166
|
else
|
167
167
|
rvm_ruby_interpreter="system"
|
168
168
|
__rvm_log "warn" "no default rvm specified, defaulting to pre-rvm sytem."
|
169
169
|
unset GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC
|
170
|
-
if [ -s $rvm_path/system ] ; then source $rvm_path/system ; fi
|
170
|
+
if [[ -s $rvm_path/system ]] ; then source $rvm_path/system ; fi
|
171
171
|
fi
|
172
172
|
|
173
|
-
elif [ "system" = "$rvm_ruby_interpreter" ] ; then
|
173
|
+
elif [[ "system" = "$rvm_ruby_interpreter" ]] ; then
|
174
174
|
|
175
175
|
unset GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION IRBRC
|
176
176
|
PATH=$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)
|
177
177
|
PATH=$rvm_bin_path:$PATH ; export PATH
|
178
|
-
if [ -s $rvm_path/system ] ; then
|
178
|
+
if [[ -s $rvm_path/system ]] ; then
|
179
179
|
grep "^MY_RUBY_HOME='$rvm_path" "$rvm_path/system" > /dev/null
|
180
|
-
if [ $? -eq 0 ] ; then
|
180
|
+
if [[ $? -eq 0 ]] ; then
|
181
181
|
rm -f $rvm_path/system # 'system' should *not* point to an rvm ruby.
|
182
182
|
else
|
183
183
|
source $rvm_path/system
|
@@ -190,11 +190,11 @@ function __rvm_use {
|
|
190
190
|
MY_RUBY_HOME=$rvm_ruby_home ; export MY_RUBY_HOME
|
191
191
|
RUBY_VERSION=$rvm_ruby_package_name ; export RUBY_VERSION
|
192
192
|
IRBRC="$rvm_ruby_irbrc" ; export IRBRC
|
193
|
-
if [ -z "$IRBRC" ] ; then unset IRBRC ; fi
|
193
|
+
if [[ -z "$IRBRC" ]] ; then unset IRBRC ; fi
|
194
194
|
|
195
|
-
if [ ! -d $MY_RUBY_HOME ] ; then
|
195
|
+
if [[ ! -d $MY_RUBY_HOME ]] ; then
|
196
196
|
__rvm_log "warn" "$rvm_ruby_interpreter $rvm_ruby_version is not installed."
|
197
|
-
if [ ! -z "$rvm_install_on_use_flag" ] ; then
|
197
|
+
if [[ ! -z "$rvm_install_on_use_flag" ]] ; then
|
198
198
|
__rvm_install_ruby $rvm_ruby_interpreter $rvm_ruby_version $rvm_ruby_patch_level
|
199
199
|
fi
|
200
200
|
fi
|
@@ -207,8 +207,8 @@ function __rvm_use {
|
|
207
207
|
|
208
208
|
fi
|
209
209
|
|
210
|
-
if [ ! -z "$rvm_default_flag"
|
211
|
-
if [ "system" = "$rvm_ruby_interpreter" ] ; then
|
210
|
+
if [[ ! -z "$rvm_default_flag" ]] && [[ "default" != "$rvm_ruby_interpreter" ]] ; then
|
211
|
+
if [[ "system" = "$rvm_ruby_interpreter" ]] ; then
|
212
212
|
rm -f $rvm_path/default
|
213
213
|
rm -f $rvm_path/bin/default*
|
214
214
|
else
|
@@ -220,14 +220,14 @@ function __rvm_use {
|
|
220
220
|
for variable in RUBY_VERSION GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC ; do
|
221
221
|
eval "export $variable"
|
222
222
|
eval value=\$${variable}
|
223
|
-
if [ ! -z "$value" ] ; then
|
223
|
+
if [[ ! -z "$value" ]] ; then
|
224
224
|
echo "${variable}='$value' ; export ${variable}" >> $rvm_path/default
|
225
225
|
else
|
226
226
|
echo "unset ${variable}" >> $rvm_path/default
|
227
227
|
fi
|
228
228
|
done ; unset variable value
|
229
229
|
|
230
|
-
if [ -s $rvm_path/bin/$rvm_ruby_package_name ] ; then
|
230
|
+
if [[ -s $rvm_path/bin/$rvm_ruby_package_name ]] ; then
|
231
231
|
ln -fs $rvm_path/bin/$rvm_ruby_package_name $rvm_path/bin/default-ruby # So that people know what it's for :)
|
232
232
|
ln -fs $rvm_path/bin/gem-$rvm_ruby_package_name $rvm_path/bin/default-gem
|
233
233
|
ln -fs $rvm_path/bin/irb-$rvm_ruby_package_name $rvm_path/bin/default-irb
|
@@ -238,16 +238,16 @@ function __rvm_use {
|
|
238
238
|
unset rvm_default_flag
|
239
239
|
fi
|
240
240
|
|
241
|
-
if [ ! -z "$rvm_load_flag" ] ; then __rvm_gems_load ; fi
|
242
|
-
if [ ! -z "$rvm_dump_flag" ] ; then __rvm_gems_dump ; fi
|
241
|
+
if [[ ! -z "$rvm_load_flag" ]] ; then __rvm_gems_load ; fi
|
242
|
+
if [[ ! -z "$rvm_dump_flag" ]] ; then __rvm_gems_dump ; fi
|
243
243
|
}
|
244
244
|
|
245
245
|
function __rvm_ruby_string {
|
246
|
-
if [ "system" = "$rvm_ruby_interpreter" ] ; then
|
246
|
+
if [[ "system" = "$rvm_ruby_interpreter" ]] ; then
|
247
247
|
rvm_ruby_string="system"
|
248
|
-
elif [ ! -z "$rvm_ruby_string" ] ; then
|
248
|
+
elif [[ ! -z "$rvm_ruby_string" ]] ; then
|
249
249
|
ruby_string=$(echo "$rvm_ruby_string" | sed 's#ruby-enterprise#ree#g') # dash-antics
|
250
|
-
if [ ! -z "$(echo "$rvm_ruby_string" | awk -F'%' '{print $2}')" ] ; then
|
250
|
+
if [[ ! -z "$(echo "$rvm_ruby_string" | awk -F'%' '{print $2}')" ]] ; then
|
251
251
|
rvm_gem_set_name=$(echo "$rvm_ruby_string" | awk -F'%' '{print $2}')
|
252
252
|
fi
|
253
253
|
set +x
|
@@ -256,45 +256,45 @@ function __rvm_ruby_string {
|
|
256
256
|
|
257
257
|
rvm_ruby_interpreter=$(echo $ruby_string | awk -F'-' '{print $1}')
|
258
258
|
rvm_ruby_version=$(echo $ruby_string | awk -F'-' '{print $2}')
|
259
|
-
if [ "$rvm_ruby_version" != "head" ] ; then
|
259
|
+
if [[ "$rvm_ruby_version" != "head" ]] ; then
|
260
260
|
patch_level=$(echo $ruby_string | awk -F'-' '{print $3}')
|
261
|
-
if [ ! -z "$patch_level" ] ; then rvm_ruby_patch_level="$patch_level" ; fi
|
261
|
+
if [[ ! -z "$patch_level" ]] ; then rvm_ruby_patch_level="$patch_level" ; fi
|
262
262
|
else
|
263
263
|
rvm_ruby_patch_level="head"
|
264
264
|
fi
|
265
265
|
|
266
|
-
if [ ! -z "$(echo $rvm_ruby_interpreter | awk '/^1\.[8-9]/')" ] ; then
|
266
|
+
if [[ ! -z "$(echo $rvm_ruby_interpreter | awk '/^1\.[8-9]/')" ]] ; then
|
267
267
|
rvm_ruby_patch_level=$rvm_ruby_version
|
268
268
|
rvm_ruby_version=$rvm_ruby_interpreter
|
269
269
|
rvm_ruby_interpreter="ruby"
|
270
|
-
if [ -z "$rvm_ruby_patch_level" ] ; then
|
271
|
-
if [ "$rvm_ruby_version" != "head" ] ; then
|
270
|
+
if [[ -z "$rvm_ruby_patch_level" ]] ; then
|
271
|
+
if [[ "$rvm_ruby_version" != "head" ]] ; then
|
272
272
|
rvm_ruby_patch_level="$(__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_patch_level")"
|
273
273
|
else
|
274
274
|
rvm_ruby_patch_level="head"
|
275
275
|
fi
|
276
276
|
fi
|
277
|
-
elif [ ! -z "$(echo $rvm_ruby_interpreter | awk '/^1\.[3-4]/')" ] ; then
|
277
|
+
elif [[ ! -z "$(echo $rvm_ruby_interpreter | awk '/^1\.[3-4]/')" ]] ; then
|
278
278
|
rvm_ruby_version=$rvm_ruby_interpreter
|
279
279
|
rvm_ruby_interpreter=jruby
|
280
280
|
unset rvm_ruby_patch_level
|
281
281
|
fi
|
282
282
|
|
283
|
-
if [ "head" = "$rvm_ruby_version" ] ; then
|
283
|
+
if [[ "head" = "$rvm_ruby_version" ]] ; then
|
284
284
|
revision="head"
|
285
|
-
if [ "ree" = "$rvm_ruby_interpreter" ] ; then rvm_ruby_version="1.8.7" ; fi
|
286
|
-
if [ "rbx" = "$rvm_ruby_interpreter" ] ; then unset revision ; fi
|
285
|
+
if [[ "ree" = "$rvm_ruby_interpreter" ]] ; then rvm_ruby_version="1.8.7" ; fi
|
286
|
+
if [[ "rbx" = "$rvm_ruby_interpreter" ]] ; then unset revision ; fi
|
287
287
|
else
|
288
288
|
revision=$(echo $ruby_string | awk -F'-' '{print $3}')
|
289
289
|
fi
|
290
290
|
|
291
|
-
if [ "head" = "$revision"
|
291
|
+
if [[ "head" = "$revision" ]] || [[ "preview" = "$revision" ]] ; then
|
292
292
|
rvm_ruby_revision="$revision"
|
293
293
|
else
|
294
|
-
if [ ! -z "$(echo $revision | awk '/^p[0-9]\+/')" ] ; then
|
294
|
+
if [[ ! -z "$(echo $revision | awk '/^p[0-9]\+/')" ]] ; then
|
295
295
|
rvm_ruby_patch_level=${rvm_ruby_patch_level:-$(echo $revision | awk -F'p' '{print $2}')}
|
296
296
|
else
|
297
|
-
if [ ! -z "$(echo $revision | awk '/^[0-9]\+/')" ] ; then
|
297
|
+
if [[ ! -z "$(echo $revision | awk '/^[0-9]\+/')" ]] ; then
|
298
298
|
rvm_ruby_revision="$revision"
|
299
299
|
else
|
300
300
|
unset rvm_ruby_revision
|
data/scripts/update
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"
|