rvm 1.1.4 → 1.1.5
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/lib/VERSION.yml +1 -1
- data/lib/rvm/environment.rb +1 -1
- data/lib/rvm/shell/shell_wrapper.sh +1 -1
- data/rvm.gemspec +3 -110
- metadata +4 -111
- data/binscripts/rvm +0 -76
- data/binscripts/rvm-auto-ruby +0 -24
- data/binscripts/rvm-prompt +0 -208
- data/binscripts/rvm-shell +0 -35
- data/binscripts/rvm-update-head +0 -58
- data/binscripts/rvm-update-latest +0 -27
- data/binscripts/rvmsudo +0 -20
- data/config/db +0 -71
- data/config/known +0 -54
- data/config/md5 +0 -139
- data/contrib/gemset_snapshot +0 -25
- data/contrib/install-system-wide +0 -221
- data/contrib/r +0 -44
- data/examples/rvmrc +0 -49
- data/gemsets/default.gems +0 -1
- data/gemsets/global.gems +0 -1
- data/help/alias +0 -46
- data/help/benchmark +0 -17
- data/help/cleanup +0 -23
- data/help/debug +0 -8
- data/help/disk-usage +0 -15
- data/help/docs +0 -22
- data/help/exec +0 -33
- data/help/fetch +0 -5
- data/help/gem +0 -0
- data/help/gemdir +0 -0
- data/help/gemset +0 -14
- data/help/implode +0 -0
- data/help/info +0 -62
- data/help/install +0 -0
- data/help/list +0 -0
- data/help/migrate +0 -15
- data/help/monitor +0 -0
- data/help/notes +0 -0
- data/help/package +0 -0
- data/help/rake +0 -14
- data/help/remove +0 -0
- data/help/repair +0 -23
- data/help/reset +0 -0
- data/help/ruby +0 -84
- data/help/rubygems +0 -11
- data/help/rvmrc +0 -34
- data/help/snapshot +0 -15
- data/help/specs +0 -0
- data/help/srcdir +0 -0
- data/help/tests +0 -0
- data/help/tools +0 -22
- data/help/uninstall +0 -0
- data/help/update +0 -0
- data/help/upgrade +0 -18
- data/help/use +0 -0
- data/help/wrapper +0 -41
- data/install +0 -667
- data/man/man1/rvm.1 +0 -380
- data/man/man1/rvm.1.gz +0 -0
- data/scripts/alias +0 -226
- data/scripts/aliases +0 -4
- data/scripts/array +0 -32
- data/scripts/base +0 -57
- data/scripts/cd +0 -94
- data/scripts/cleanup +0 -58
- data/scripts/cli +0 -798
- data/scripts/color +0 -49
- data/scripts/completion +0 -151
- data/scripts/db +0 -87
- data/scripts/default +0 -64
- data/scripts/disk-usage +0 -60
- data/scripts/docs +0 -115
- data/scripts/env +0 -46
- data/scripts/environment-convertor +0 -74
- data/scripts/fetch +0 -231
- data/scripts/gemsets +0 -1045
- data/scripts/get +0 -126
- data/scripts/hash +0 -37
- data/scripts/help +0 -46
- data/scripts/hook +0 -23
- data/scripts/info +0 -213
- data/scripts/initialize +0 -29
- data/scripts/install +0 -667
- data/scripts/irbrc +0 -13
- data/scripts/irbrc.rb +0 -64
- data/scripts/list +0 -315
- data/scripts/log +0 -38
- data/scripts/maglev +0 -193
- data/scripts/manage +0 -2157
- data/scripts/match +0 -6
- data/scripts/md5 +0 -22
- data/scripts/migrate +0 -175
- data/scripts/monitor +0 -105
- data/scripts/notes +0 -140
- data/scripts/override_gem +0 -14
- data/scripts/package +0 -302
- data/scripts/patches +0 -64
- data/scripts/patchsets +0 -87
- data/scripts/repair +0 -199
- data/scripts/rubygems +0 -157
- data/scripts/rvm +0 -128
- data/scripts/rvm-install +0 -667
- data/scripts/selector +0 -904
- data/scripts/set +0 -301
- data/scripts/snapshot +0 -262
- data/scripts/tools +0 -58
- data/scripts/update +0 -667
- data/scripts/upgrade +0 -144
- data/scripts/utility +0 -1499
- data/scripts/version +0 -17
- data/scripts/wrapper +0 -210
data/man/man1/rvm.1
DELETED
@@ -1,380 +0,0 @@
|
|
1
|
-
'\" t
|
2
|
-
.\" Title: rvm
|
3
|
-
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
|
4
|
-
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
|
5
|
-
.\" Date: 07/16/2010
|
6
|
-
.\" Manual: [FIXME: manual]
|
7
|
-
.\" Source: [FIXME: source]
|
8
|
-
.\" Language: English
|
9
|
-
.\"
|
10
|
-
.TH "RVM" "1" "07/16/2010" "[FIXME: source]" "[FIXME: manual]"
|
11
|
-
.\" -----------------------------------------------------------------
|
12
|
-
.\" * set default formatting
|
13
|
-
.\" -----------------------------------------------------------------
|
14
|
-
.\" disable hyphenation
|
15
|
-
.nh
|
16
|
-
.\" disable justification (adjust text to left margin only)
|
17
|
-
.ad l
|
18
|
-
.\" -----------------------------------------------------------------
|
19
|
-
.\" * MAIN CONTENT STARTS HERE *
|
20
|
-
.\" -----------------------------------------------------------------
|
21
|
-
.SH "NAME"
|
22
|
-
rvm \- The Ruby Version Manager
|
23
|
-
.SH "SYNOPSIS"
|
24
|
-
.sp
|
25
|
-
\fBrvm\fR [\fIFLAGS\fR] [\fIOPTIONS\fR] \fIACTION\fR [\fIIMPLEMENTATION\fR[,\fIIMPLEMENTATION\fR[,\fI\&...\fR]]
|
26
|
-
.SH "DESCRIPTION"
|
27
|
-
.sp
|
28
|
-
RVM is a command line tool which allows us to easily install, manage and work with multiple ruby environments from interpreters to sets of gems\&.
|
29
|
-
.SH "FLAGS"
|
30
|
-
.PP
|
31
|
-
\fB\-\-head\fR
|
32
|
-
.RS 4
|
33
|
-
with update, updates rvm to git head version\&.
|
34
|
-
.RE
|
35
|
-
.PP
|
36
|
-
\fB\-\-rubygems\fR
|
37
|
-
.RS 4
|
38
|
-
with update, updates rubygems for selected ruby
|
39
|
-
.RE
|
40
|
-
.PP
|
41
|
-
\fB\-\-default\fR
|
42
|
-
.RS 4
|
43
|
-
with ruby select, sets a default ruby for new shells\&.
|
44
|
-
.RE
|
45
|
-
.PP
|
46
|
-
\fB\-\-debug\fR
|
47
|
-
.RS 4
|
48
|
-
Toggle debug mode on for very verbose output\&.
|
49
|
-
.RE
|
50
|
-
.PP
|
51
|
-
\fB\-\-trace\fR
|
52
|
-
.RS 4
|
53
|
-
Toggle trace mode on to see EVERYTHING rvm is doing\&.
|
54
|
-
.RE
|
55
|
-
.PP
|
56
|
-
\fB\-\-force\fR
|
57
|
-
.RS 4
|
58
|
-
Force install, removes old install & source before install\&.
|
59
|
-
.RE
|
60
|
-
.PP
|
61
|
-
\fB\-\-summary\fR
|
62
|
-
.RS 4
|
63
|
-
Used with rubydo to print out a summary of the commands run\&.
|
64
|
-
.RE
|
65
|
-
.PP
|
66
|
-
\fB\-\-latest\fR
|
67
|
-
.RS 4
|
68
|
-
with gemset \-\-dump skips version strings for latest gem\&.
|
69
|
-
.RE
|
70
|
-
.PP
|
71
|
-
\fB\-\-gems\fR
|
72
|
-
.RS 4
|
73
|
-
with uninstall/remove removes gems with the interpreter\&.
|
74
|
-
.RE
|
75
|
-
.PP
|
76
|
-
\fB\-\-docs\fR
|
77
|
-
.RS 4
|
78
|
-
with install, attempt to generate ri after installation\&.
|
79
|
-
.RE
|
80
|
-
.PP
|
81
|
-
\fB\-\-reconfigure\fR
|
82
|
-
.RS 4
|
83
|
-
Force \&./configure on install even if Makefile already exists\&.
|
84
|
-
.RE
|
85
|
-
.SH "OPTIONS"
|
86
|
-
.PP
|
87
|
-
\fB\-v, \-\-version\fR
|
88
|
-
.RS 4
|
89
|
-
Emit rvm version loaded for current shell\&.
|
90
|
-
.RE
|
91
|
-
.PP
|
92
|
-
\fB\-l, \-\-level\fR
|
93
|
-
.RS 4
|
94
|
-
patch level to use with rvm use / install
|
95
|
-
.RE
|
96
|
-
.PP
|
97
|
-
\fB\-\-prefix\fR
|
98
|
-
.RS 4
|
99
|
-
path for all rvm files (\fI~/\&.rvm/\fR), with trailing slash!
|
100
|
-
.RE
|
101
|
-
.PP
|
102
|
-
\fB\-\-bin\fR
|
103
|
-
.RS 4
|
104
|
-
path for binaries to be placed (\fI~/\&.rvm/bin/\fR)
|
105
|
-
.RE
|
106
|
-
.PP
|
107
|
-
\fB\-\-source\fR
|
108
|
-
.RS 4
|
109
|
-
src directory to use (\fI~/\&.rvm/src/\fR)
|
110
|
-
.RE
|
111
|
-
.PP
|
112
|
-
\fB\-\-archives\fR
|
113
|
-
.RS 4
|
114
|
-
directory for downladed files (\fI~/\&.rvm/archives/\fR)
|
115
|
-
.RE
|
116
|
-
.PP
|
117
|
-
\fB\-S\fR
|
118
|
-
.RS 4
|
119
|
-
Specify a script file to attempt to load and run (rubydo)\&.
|
120
|
-
.RE
|
121
|
-
.PP
|
122
|
-
\fB\-e\fR
|
123
|
-
.RS 4
|
124
|
-
Execute code from the command line\&.
|
125
|
-
.RE
|
126
|
-
.PP
|
127
|
-
\fB\-G\fR
|
128
|
-
.RS 4
|
129
|
-
root gem path to use
|
130
|
-
.RE
|
131
|
-
.PP
|
132
|
-
\fB\-\-gems\fR
|
133
|
-
.RS 4
|
134
|
-
Used to set the
|
135
|
-
\fIgems_flag\fR, use with
|
136
|
-
\fIremove\fR
|
137
|
-
to remove gems\&.
|
138
|
-
.RE
|
139
|
-
.PP
|
140
|
-
\fB\-\-archive\fR
|
141
|
-
.RS 4
|
142
|
-
Used to set the
|
143
|
-
\fIarchive_flag\fR, use with
|
144
|
-
\fIremove\fR
|
145
|
-
to remove archive\&.
|
146
|
-
.RE
|
147
|
-
.PP
|
148
|
-
\fB\-\-patch\fR, \fB\-\-patches\fR
|
149
|
-
.RS 4
|
150
|
-
With any ruby build from source, allows you to specify patch paths and patch names to be applied prior to building\&. Values should be a relative / absolute path to a patch or the name of known patch / patchset\&. Optionally, paths or names may be followed by
|
151
|
-
\fI%someinteger\fR
|
152
|
-
\- e\&.g\&.
|
153
|
-
\fI\-\-patches mypatch%2\fR
|
154
|
-
\- where the number following the % specifies the value of the \-p argument to patch, defaulting to two\&.
|
155
|
-
.RE
|
156
|
-
.PP
|
157
|
-
\fB\-C, \-\-configure\fR
|
158
|
-
.RS 4
|
159
|
-
custom configure options\&. If you need to pass several configure options then append them comma separated:
|
160
|
-
\fI\-C \-\-\&...,\-\-\&...,\-\-\&...\fR\&.
|
161
|
-
.RE
|
162
|
-
.PP
|
163
|
-
\fB\-\-nice\fR
|
164
|
-
.RS 4
|
165
|
-
process niceness (for slow computers, default 0)
|
166
|
-
.RE
|
167
|
-
.PP
|
168
|
-
\fB\-\-ree\-options\fR
|
169
|
-
.RS 4
|
170
|
-
Options passed directly to ree\(cqs
|
171
|
-
\fI\&./installer\fR
|
172
|
-
on the command line\&.
|
173
|
-
.RE
|
174
|
-
.SH "ACTIONS"
|
175
|
-
.PP
|
176
|
-
\fBusage\fR
|
177
|
-
.RS 4
|
178
|
-
Show this usage information\&.
|
179
|
-
.RE
|
180
|
-
.PP
|
181
|
-
\fBversion\fR
|
182
|
-
.RS 4
|
183
|
-
Show the rvm version installed in rvm_path\&.
|
184
|
-
.RE
|
185
|
-
.PP
|
186
|
-
\fBuse\fR
|
187
|
-
.RS 4
|
188
|
-
Setup current shell to use a specific ruby version\&.
|
189
|
-
.RE
|
190
|
-
.PP
|
191
|
-
\fBreload\fR
|
192
|
-
.RS 4
|
193
|
-
Reload rvm source itself (useful after changing rvm source)\&.
|
194
|
-
.RE
|
195
|
-
.PP
|
196
|
-
\fBenv\fR
|
197
|
-
.RS 4
|
198
|
-
Displays information about an environment specified but the given ruby string\&. Useful for getting a sourceable path or an evaluatable set of shell variable declarations\&.
|
199
|
-
.RE
|
200
|
-
.PP
|
201
|
-
\fBimplode\fR
|
202
|
-
.RS 4
|
203
|
-
(seppuku) removes the rvm installation completely\&. This means everything in $rvm_path (\fI~/\&.rvm\fR)\&. This does not touch your profiles, which is why there is an if around the sourcing
|
204
|
-
\fIscripts/rvm\fR\&.
|
205
|
-
.RE
|
206
|
-
.PP
|
207
|
-
\fBupdate\fR
|
208
|
-
.RS 4
|
209
|
-
Upgrades rvm to the latest version\&. (If you experience bugs try this first with \-\-head)\&.
|
210
|
-
.RE
|
211
|
-
.PP
|
212
|
-
\fBreset\fR
|
213
|
-
.RS 4
|
214
|
-
Remove current and stored default & system settings\&. (If you experience odd behavior try this second)\&.
|
215
|
-
.RE
|
216
|
-
.PP
|
217
|
-
\fBinfo\fR
|
218
|
-
.RS 4
|
219
|
-
Show the
|
220
|
-
\fBcurrent\fR
|
221
|
-
environment information for current ruby\&.
|
222
|
-
.RE
|
223
|
-
.PP
|
224
|
-
\fBdebug\fR
|
225
|
-
.RS 4
|
226
|
-
Show info plus additional information for common issues\&.
|
227
|
-
.RE
|
228
|
-
.PP
|
229
|
-
\fBinstall\fR
|
230
|
-
.RS 4
|
231
|
-
Install one or many ruby versions\&.
|
232
|
-
http://rvm\&.beginrescueend\&.com/rubies/installing/
|
233
|
-
.RE
|
234
|
-
.PP
|
235
|
-
\fBuninstall\fR
|
236
|
-
.RS 4
|
237
|
-
Uninstall one or many ruby versions, leaves their sources\&.
|
238
|
-
.RE
|
239
|
-
.PP
|
240
|
-
\fBremove\fR
|
241
|
-
.RS 4
|
242
|
-
Uninstall one or many ruby versions and remove their sources\&.
|
243
|
-
.RE
|
244
|
-
.PP
|
245
|
-
\fBwrapper\fR
|
246
|
-
.RS 4
|
247
|
-
Generates a set of wrapper executables for a given ruby with the specified ruby and gemset combination\&. Used under the hood for passenger support and the like\&.
|
248
|
-
.RE
|
249
|
-
.PP
|
250
|
-
\fBruby\fR
|
251
|
-
.RS 4
|
252
|
-
Runs a named ruby file against specified and/or all rubies\&.
|
253
|
-
.RE
|
254
|
-
.PP
|
255
|
-
\fBgem\fR
|
256
|
-
.RS 4
|
257
|
-
Runs a gem command using selected ruby\(cqs
|
258
|
-
\fIgem\fR\&.
|
259
|
-
.RE
|
260
|
-
.PP
|
261
|
-
\fBrake\fR
|
262
|
-
.RS 4
|
263
|
-
Runs a rake task against specified and/or all rubies\&.
|
264
|
-
.RE
|
265
|
-
.PP
|
266
|
-
\fBtests\fR
|
267
|
-
.RS 4
|
268
|
-
Runs
|
269
|
-
\fIrake test\fR
|
270
|
-
across selected ruby versions\&.
|
271
|
-
.RE
|
272
|
-
.PP
|
273
|
-
\fBspecs\fR
|
274
|
-
.RS 4
|
275
|
-
Runs
|
276
|
-
\fIrake spec\fR
|
277
|
-
across selected ruby versions\&.
|
278
|
-
.RE
|
279
|
-
.PP
|
280
|
-
\fBmonitor\fR
|
281
|
-
.RS 4
|
282
|
-
Monitor cwd for testing, run
|
283
|
-
\fIrake {spec,test}\fR
|
284
|
-
on changes\&.
|
285
|
-
.RE
|
286
|
-
.PP
|
287
|
-
\fBgemset\fR
|
288
|
-
.RS 4
|
289
|
-
gemsets:
|
290
|
-
http://rvm\&.beginrescueend\&.com/gemsets/
|
291
|
-
.RE
|
292
|
-
.PP
|
293
|
-
\fBgemdir\fR
|
294
|
-
.RS 4
|
295
|
-
Display the path to the current gem directory (\fI$GEM_HOME\fR)\&.
|
296
|
-
.RE
|
297
|
-
.PP
|
298
|
-
\fBsrcdir\fR
|
299
|
-
.RS 4
|
300
|
-
Display the path to rvm source directory (may be yanked)\&.
|
301
|
-
.RE
|
302
|
-
.PP
|
303
|
-
\fBfetch\fR
|
304
|
-
.RS 4
|
305
|
-
Performs an archive / src fetch only of the selected ruby\&.
|
306
|
-
.RE
|
307
|
-
.PP
|
308
|
-
\fBlist\fR
|
309
|
-
.RS 4
|
310
|
-
Show currently installed rubies, interactive output\&.
|
311
|
-
http://rvm\&.beginrescueend\&.com/rubies/list/
|
312
|
-
.RE
|
313
|
-
.PP
|
314
|
-
\fBpackage\fR
|
315
|
-
.RS 4
|
316
|
-
Install a dependency package {readline,iconv,zlib,openssl}\&.
|
317
|
-
http://rvm\&.beginrescueend\&.com/packages/
|
318
|
-
.RE
|
319
|
-
.PP
|
320
|
-
\fBnotes\fR
|
321
|
-
.RS 4
|
322
|
-
Display notes, with operating system specifics\&.
|
323
|
-
.RE
|
324
|
-
.SH "IMPLEMENTATION"
|
325
|
-
.PP
|
326
|
-
\fBruby\fR
|
327
|
-
.RS 4
|
328
|
-
MRI/YARV Ruby (The Gold Standard) {1\&.8\&.6,1\&.8\&.7,1\&.9\&.1,1\&.9\&.2\&...}
|
329
|
-
.RE
|
330
|
-
.PP
|
331
|
-
\fBjruby\fR
|
332
|
-
.RS 4
|
333
|
-
JRuby, Ruby interpreter on the Java Virtual Machine\&.
|
334
|
-
.RE
|
335
|
-
.PP
|
336
|
-
\fBrbx\fR
|
337
|
-
.RS 4
|
338
|
-
Rubinius
|
339
|
-
.RE
|
340
|
-
.PP
|
341
|
-
\fBree\fR
|
342
|
-
.RS 4
|
343
|
-
Ruby Enterprise Edition, MRI Ruby with several custom patches for performance, stability, and memory\&.
|
344
|
-
.RE
|
345
|
-
.PP
|
346
|
-
\fBmacruby\fR
|
347
|
-
.RS 4
|
348
|
-
MacRuby, insanely fast, can make real apps (Mac OS X Only)\&.
|
349
|
-
.RE
|
350
|
-
.PP
|
351
|
-
\fBmaglev\fR
|
352
|
-
.RS 4
|
353
|
-
GemStone Ruby, awesome persistent ruby object store\&.
|
354
|
-
.RE
|
355
|
-
.PP
|
356
|
-
\fBironruby\fR
|
357
|
-
.RS 4
|
358
|
-
IronRuby, NOT supported yet\&. Looking for volunteers to help\&.
|
359
|
-
.RE
|
360
|
-
.PP
|
361
|
-
\fBsystem\fR
|
362
|
-
.RS 4
|
363
|
-
Use the system ruby (eg\&. pre\-rvm state)\&.
|
364
|
-
.RE
|
365
|
-
.PP
|
366
|
-
\fBdefault\fR
|
367
|
-
.RS 4
|
368
|
-
Use rvm set default ruby and system if it hasn\(cqt been set\&.
|
369
|
-
http://rvm\&.beginrescueend\&.com/rubies/default/
|
370
|
-
.RE
|
371
|
-
.SH "RESOURCES"
|
372
|
-
.sp
|
373
|
-
Main web site
|
374
|
-
.sp
|
375
|
-
Online issue\-tracker
|
376
|
-
.SH "COPYING"
|
377
|
-
.sp
|
378
|
-
Copyright (c) 2009 Wayne E\&. Seguin
|
379
|
-
.sp
|
380
|
-
See LICENCE file for details\&.
|
data/man/man1/rvm.1.gz
DELETED
Binary file
|
data/scripts/alias
DELETED
@@ -1,226 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
unset rvm_default_flag rvm_wrapper_name
|
4
|
-
|
5
|
-
source "$rvm_path/scripts/base"
|
6
|
-
|
7
|
-
usage() {
|
8
|
-
printf "
|
9
|
-
|
10
|
-
Usage:
|
11
|
-
|
12
|
-
rvm alias [action] [arguments]
|
13
|
-
|
14
|
-
Examples:
|
15
|
-
|
16
|
-
rvm alias create [alias_name] [ruby]
|
17
|
-
rvm alias delete [alias_name]
|
18
|
-
rvm alias show [alias_name]
|
19
|
-
rvm alias list
|
20
|
-
|
21
|
-
"
|
22
|
-
}
|
23
|
-
|
24
|
-
alias_conflicts_with_ruby() {
|
25
|
-
# If default exists, we should return true.
|
26
|
-
[[ "$1" == "default" && ! -L "$rvm_path/rubies/default" ]] && return 1
|
27
|
-
# Open for suggestions to a better way of doing this...
|
28
|
-
alias_check_result="$(
|
29
|
-
\. "$rvm_path/scripts/initialize"
|
30
|
-
\. "$rvm_path/scripts/selector"
|
31
|
-
export rvm_ruby_string=\"$1\"
|
32
|
-
__rvm_ruby_string > /dev/null 2>&1
|
33
|
-
echo "$?"
|
34
|
-
)"
|
35
|
-
|
36
|
-
if [[ "0" == "$alias_check_result" ]]; then
|
37
|
-
"$rvm_path/scripts"/log "error" \
|
38
|
-
"\nYou have attempted to create an alias called '$1', which is recognized as a rvm ruby.\n"
|
39
|
-
return 0
|
40
|
-
fi
|
41
|
-
|
42
|
-
return 1
|
43
|
-
|
44
|
-
unset alias_check_result
|
45
|
-
}
|
46
|
-
|
47
|
-
alias_show() {
|
48
|
-
local expanded_alias_name
|
49
|
-
|
50
|
-
if [[ -z "$alias_name" ]]; then
|
51
|
-
"$rvm_path/scripts"/log "error" "\nusage: 'rvm alias show [alias_name]'\n"
|
52
|
-
result=1
|
53
|
-
return
|
54
|
-
fi
|
55
|
-
|
56
|
-
expanded_alias_name="$("$rvm_path/scripts"/db "$rvm_path/config/alias" "$alias_name")"
|
57
|
-
|
58
|
-
if [[ -z "$expanded_alias_name" ]]; then
|
59
|
-
"$rvm_path/scripts"/log "error" "\nUnknown alias name: '$alias_name'\n"
|
60
|
-
result=1
|
61
|
-
else
|
62
|
-
result=0
|
63
|
-
if [[ -n "$gemset_name" ]] ; then
|
64
|
-
printf "${rvm_gemset_separator:-"@"}${rvm_gemset_separator:-"@"}${gemset_name}\n"
|
65
|
-
else
|
66
|
-
printf "$expanded_alias_name\n"
|
67
|
-
fi
|
68
|
-
fi
|
69
|
-
}
|
70
|
-
|
71
|
-
alias_delete() {
|
72
|
-
echo "Deleting alias: $alias_name"
|
73
|
-
|
74
|
-
for link in "$rvm_path/rubies/$alias_name" ; do
|
75
|
-
if [[ -L "$link" ]] ; then rm -f $link ; fi
|
76
|
-
done
|
77
|
-
|
78
|
-
"$rvm_path/scripts"/db "$rvm_path/config/alias" "$alias_name" "delete"
|
79
|
-
}
|
80
|
-
|
81
|
-
alias_create() {
|
82
|
-
|
83
|
-
alias_name="${alias_name:-""}"
|
84
|
-
|
85
|
-
rvm_ruby_string="${rvm_ruby_string:-""}"
|
86
|
-
|
87
|
-
if [[ "default" != "$alias_name" ]] && alias_conflicts_with_ruby "$alias_name"; then
|
88
|
-
# Force it to an empty alias name to trigger the usage.
|
89
|
-
alias_name=""
|
90
|
-
fi
|
91
|
-
|
92
|
-
if [[ -z "${rvm_environment_identifier:-""}" || -z "$alias_name" ]] ; then
|
93
|
-
|
94
|
-
"$rvm_path/scripts"/log "error" \
|
95
|
-
"\nusage: 'rvm alias [alias_name] [ruby_string]'\n"
|
96
|
-
|
97
|
-
result=1
|
98
|
-
else
|
99
|
-
|
100
|
-
if [[ "default" = "$alias_name" ]] ; then
|
101
|
-
rvm_alias=""
|
102
|
-
fi
|
103
|
-
|
104
|
-
if [[ -z "$rvm_alias" ]] ; then
|
105
|
-
|
106
|
-
rvm_ruby_string="$rvm_environment_identifier"
|
107
|
-
|
108
|
-
if [[ -z "$rvm_alias_expanded" ]]; then
|
109
|
-
|
110
|
-
rvm_expanding_aliases=1
|
111
|
-
|
112
|
-
__rvm_become
|
113
|
-
|
114
|
-
unset rvm_expanding_aliases
|
115
|
-
|
116
|
-
else
|
117
|
-
|
118
|
-
rvm_ruby_string="$rvm_environment_identifier"
|
119
|
-
|
120
|
-
fi
|
121
|
-
|
122
|
-
if [[ -z "$rvm_ruby_string" ]]; then
|
123
|
-
|
124
|
-
"$rvm_path/scripts"/log "error" \
|
125
|
-
"\nUnknown ruby string '$rvm_ruby_string' specified\n"
|
126
|
-
|
127
|
-
result=1
|
128
|
-
|
129
|
-
return $result
|
130
|
-
fi
|
131
|
-
|
132
|
-
final_environment_identifier="${rvm_environment_identifier:-$(__rvm_environment_identifier)}"
|
133
|
-
|
134
|
-
"$rvm_path/scripts"/log "info" \
|
135
|
-
"Creating alias $alias_name for $final_environment_identifier."
|
136
|
-
|
137
|
-
ln -nfs "$rvm_path/rubies/$rvm_ruby_string" "$rvm_path/rubies/$alias_name"
|
138
|
-
|
139
|
-
"$rvm_path/scripts"/log "info" \
|
140
|
-
"Recording alias $alias_name for $final_environment_identifier."
|
141
|
-
|
142
|
-
"$rvm_path/scripts"/db "$rvm_path/config/alias" "$alias_name" "$final_environment_identifier"
|
143
|
-
|
144
|
-
else
|
145
|
-
|
146
|
-
if [[ -d "$rvm_path/rubies/$alias_name" ]] ; then
|
147
|
-
|
148
|
-
"$rvm_path/scripts"/log "error" \
|
149
|
-
"\n$rvm_path/rubies/$alias_name is taken and is *not* able to be an alias name.\n"
|
150
|
-
|
151
|
-
result=1
|
152
|
-
|
153
|
-
else
|
154
|
-
|
155
|
-
"$rvm_path/scripts"/log "error" \
|
156
|
-
"\n$rvm_path/rubies/$alias_name is already aliased.\n"
|
157
|
-
|
158
|
-
result=1
|
159
|
-
|
160
|
-
fi
|
161
|
-
fi
|
162
|
-
fi
|
163
|
-
}
|
164
|
-
|
165
|
-
alias_list() {
|
166
|
-
|
167
|
-
local item items
|
168
|
-
|
169
|
-
items=($(cd "$rvm_path/rubies" ; find . -maxdepth 1 -mindepth 1 -type l | sed -e 's#./##'))
|
170
|
-
|
171
|
-
for item in "${items[@]}" ; do
|
172
|
-
|
173
|
-
echo "$(basename "$item") => $("$rvm_path/scripts"/db "$rvm_path/config/alias" "$(basename "$item")")"
|
174
|
-
|
175
|
-
done
|
176
|
-
|
177
|
-
}
|
178
|
-
|
179
|
-
args=($*)
|
180
|
-
action="${args[0]:-""}"
|
181
|
-
alias_name="${args[1]:-""}"
|
182
|
-
rvm_environment_identifier="${args[2]:-""}"
|
183
|
-
args="$(echo ${args[@]:3}) " # Strip trailing / leading / extra spacing.
|
184
|
-
result=0
|
185
|
-
|
186
|
-
if [[ ! -f "$rvm_path/config/alias" ]] ; then touch "$rvm_path/config/alias" ; fi
|
187
|
-
|
188
|
-
if printf "$alias_name" | grep -q "${rvm_gemset_separator:-"@"}" ; then
|
189
|
-
gemset_name="${alias_name/*${rvm_gemset_separator:-"@"}/}"
|
190
|
-
alias_name="${alias_name/${rvm_gemset_separator:-"@"}*/}"
|
191
|
-
else
|
192
|
-
gemset_name=""
|
193
|
-
fi
|
194
|
-
|
195
|
-
if [[ -n "$alias_name" ]] ; then
|
196
|
-
rvm_alias="$("$rvm_path/scripts/db" "$rvm_path/config/alias" "$alias_name")"
|
197
|
-
fi
|
198
|
-
|
199
|
-
if [[ "$action" = "delete" ]] ; then
|
200
|
-
|
201
|
-
alias_delete
|
202
|
-
|
203
|
-
elif [[ "$action" = "create" ]] ; then
|
204
|
-
|
205
|
-
alias_create
|
206
|
-
|
207
|
-
elif [[ "$action" = "list" ]] ; then
|
208
|
-
|
209
|
-
alias_list
|
210
|
-
|
211
|
-
elif [[ "$action" = "show" ]]; then
|
212
|
-
|
213
|
-
alias_show
|
214
|
-
|
215
|
-
|
216
|
-
elif [[ "$action" = "help" ]]; then
|
217
|
-
|
218
|
-
usage
|
219
|
-
|
220
|
-
else
|
221
|
-
|
222
|
-
usage
|
223
|
-
exit 1
|
224
|
-
fi
|
225
|
-
|
226
|
-
exit $?
|