rvm 1.0.11 → 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
data/scripts/version CHANGED
@@ -1,14 +1,17 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- __rvm_meta() {
3
+ __rvm_meta()
4
+ {
4
5
  rvm_meta_author="Wayne E. Seguin"
5
6
  rvm_meta_author_email="wayneeseguin@gmail.com"
6
7
  rvm_meta_website="http://rvm.beginrescueend.com/"
7
8
  rvm_meta_version="${rvm_version}"
8
9
  }
9
10
 
10
- __rvm_version() {
11
+ __rvm_version()
12
+ {
11
13
  __rvm_meta
14
+
12
15
  echo -e "\nrvm ${rvm_meta_version} by ${rvm_meta_author} (${rvm_meta_author_email}) [${rvm_meta_website}]\n"
13
16
  }
14
17
 
data/scripts/wrapper CHANGED
@@ -8,7 +8,8 @@ unset rvm_default_flag rvm_wrapper_name prefix
8
8
 
9
9
  source "$rvm_path/scripts/base"
10
10
 
11
- usage() {
11
+ usage()
12
+ {
12
13
  printf "
13
14
  Usage:
14
15
 
@@ -18,12 +19,20 @@ usage() {
18
19
 
19
20
  ruby, gem, rake, irb, rdoc, ri, testrb
20
21
 
21
- For more information, see 'rvm help wrapper'
22
+ Notes
23
+
24
+ For more information, see 'rvm help wrapper'
25
+
26
+ Example
27
+
28
+ # Wrap the spec binary as 'rails3_spec' for 1.9.2@rails3
29
+ rvm wrapper 1.9.2@rails3 rails3 spec
22
30
 
23
31
  "
24
32
  }
25
33
 
26
- wrap() {
34
+ wrap()
35
+ {
27
36
 
28
37
  if [[ -n "${file_name:-""}" ]] ;then
29
38
 
@@ -34,13 +43,13 @@ wrap() {
34
43
  if [[ "root" = "$USER" ]] ; then
35
44
  path="${rvm_path:-"/usr/local/rvm"}"
36
45
  else
37
- path="$HOME/.rvm"
46
+ path="${rvm_path:-"$HOME/.rvm"}"
38
47
  fi
39
48
 
40
49
  printf "#!/usr/bin/env bash
41
50
 
42
51
  if [[ -s \"$path/environments/${environment_identifier}\" ]] ; then
43
- \\. \"$path/environments/${environment_identifier}\"
52
+ source \"$path/environments/${environment_identifier}\"
44
53
  exec $binary_name \"\$@\"
45
54
  else
46
55
  echo \"ERROR: Missing RVM environment file: '$path/environments/${environment_identifier}'\" >&2
@@ -64,7 +73,8 @@ fi
64
73
  fi
65
74
  }
66
75
 
67
- symlink_binary() {
76
+ symlink_binary()
77
+ {
68
78
  # Generate the default wrapper with the given binary name.
69
79
  # We first check if we can wrap the binary and if we were able to,
70
80
  # we then symlink it into place.
@@ -75,9 +85,11 @@ symlink_binary() {
75
85
  ln -fs "$file_name" "$rvm_bin_path/${prefix}_${binary_name}"
76
86
 
77
87
  fi
88
+
78
89
  }
79
90
 
80
- wrap_binary() {
91
+ wrap_binary()
92
+ {
81
93
  # We wrap when the given binary is in the path or override_check is set to one.
82
94
  if [[ "$override_check" = "1" ]] || command -v $binary_name > /dev/null; then
83
95
 
@@ -85,15 +97,16 @@ wrap_binary() {
85
97
 
86
98
  else
87
99
 
88
- "$rvm_path/scripts/log" "error" "Binary '$binary_name' not found in path."
100
+ "$rvm_path/scripts/log" "error" "Binary '$binary_name' not found."
89
101
 
90
102
  return 1
91
103
 
92
104
  fi
105
+
93
106
  }
94
107
 
95
108
  # Empty ruby string: show usage and exit.
96
- if [[ "$#" -eq 0 ]] ; then
109
+ if [[ $# -eq 0 ]] ; then
97
110
  usage
98
111
  exit 1
99
112
  else
@@ -101,12 +114,17 @@ else
101
114
  shift
102
115
  fi
103
116
 
104
- if [[ "$#" -gt 0 ]] ; then
117
+ if [[ $# -gt 0 ]] ; then
105
118
  prefix="${1:-""}"
106
119
  shift
107
120
  fi
108
121
 
109
- binaries=($(echo "$@"))
122
+ if [[ -z "$ruby_string" ]] ; then
123
+ usage
124
+ exit 1
125
+ fi
126
+
127
+ binaries=($@)
110
128
  override_check=0
111
129
 
112
130
  # Default the list of binaries to those we use regularily.
@@ -125,7 +143,7 @@ environment_identifier="$(__rvm_environment_identifier)"
125
143
  # it to the existing wrapper if needed.
126
144
  for binary_name in "${binaries[@]}"; do
127
145
 
128
- file_name="$rvm_path/wrappers/${environment_identifier}/${binary_name}"
146
+ file_name="$rvm_path/wrappers/${environment_identifier}/${binary_name##*\/}"
129
147
 
130
148
  if [[ ${rvm_default_flag:-0} -gt 0 ]] ; then
131
149
 
@@ -133,6 +151,10 @@ for binary_name in "${binaries[@]}"; do
133
151
 
134
152
  fi
135
153
 
154
+ if [[ ! -d "$rvm_bin_path" ]] ; then
155
+ mkdir -p "$rvm_bin_path"
156
+ fi
157
+
136
158
  if [[ -z "$prefix" ]] ; then
137
159
 
138
160
  override_check=1
@@ -148,18 +170,17 @@ for binary_name in "${binaries[@]}"; do
148
170
 
149
171
  else
150
172
 
151
- destination="$rvm_bin_path/${binary_name}-${environment_identifier}"
173
+ destination="$rvm_bin_path/${binary_name##*\/}-${environment_identifier}"
152
174
 
153
175
  fi
154
176
 
155
- rm -rf "$destination"
177
+ rm -f "$destination"
156
178
 
157
179
  ln -nsf "$file_name" "$destination"
158
180
 
159
- fi; unset destination
160
-
181
+ fi
161
182
 
162
- elif [[ "$prefix" == "--no-prefix" ]]; then
183
+ elif [[ "--no-prefix" == "$prefix" ]]; then
163
184
 
164
185
  override_check=1
165
186
 
@@ -167,11 +188,11 @@ for binary_name in "${binaries[@]}"; do
167
188
 
168
189
  if [[ -f "$file_name" ]]; then
169
190
 
170
- destination="$rvm_bin_path/$binary_name"
191
+ destination="$rvm_bin_path/${binary_name##*\/}"
171
192
 
172
193
  if [[ -s "$destination" ]] ; then
173
194
 
174
- rm -rf "$destination"
195
+ rm -f "$destination"
175
196
 
176
197
  fi
177
198
 
@@ -184,7 +205,6 @@ for binary_name in "${binaries[@]}"; do
184
205
 
185
206
  fi
186
207
 
187
-
188
208
  done
189
209
 
190
210
  exit $?
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rvm
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 11
10
- version: 1.0.11
9
+ - 13
10
+ version: 1.0.13
11
11
  platform: ruby
12
12
  authors:
13
13
  - Wayne E. Seguin
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-20 00:00:00 -04:00
18
+ date: 2010-10-03 00:00:00 -04:00
19
19
  default_executable: rvm-install
20
20
  dependencies: []
21
21