gemrage 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/Gemfile.lock +5 -0
- data/VERSION +1 -1
- data/gemrage.gemspec +148 -3
- data/lib/rubygems/commands/scan_command.rb +77 -4
- data/vendor/ruby/1.8/bin/rvm-install +19 -0
- data/vendor/ruby/1.8/cache/macaddr-1.0.0.gem +0 -0
- data/vendor/ruby/1.8/cache/rvm-1.0.14.gem +0 -0
- data/vendor/ruby/1.8/gems/macaddr-1.0.0/README +33 -0
- data/vendor/ruby/1.8/gems/macaddr-1.0.0/gemspec.rb +27 -0
- data/vendor/ruby/1.8/gems/macaddr-1.0.0/install.rb +210 -0
- data/vendor/ruby/1.8/gems/macaddr-1.0.0/lib/macaddr.rb +69 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/LICENCE +18 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/README +127 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/bin/rvm-install +5 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm +76 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-auto-ruby +24 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-prompt +204 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-shell +35 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-update-head +35 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-update-latest +27 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvmsudo +24 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/config/db +71 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/config/known +55 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/config/md5 +87 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/contrib/gemset_snapshot +25 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/contrib/install-system-wide +191 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/contrib/r +44 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/examples/rvmrc +47 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/gemsets/default.gems +1 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/gemsets/global.gems +1 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/alias +46 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/benchmark +17 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/cleanup +23 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/debug +8 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/disk-usage +15 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/docs +22 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/exec +33 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/fetch +5 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/gem +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/gemdir +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/gemset +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/implode +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/info +64 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/install +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/list +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/migrate +15 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/monitor +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/notes +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/package +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/rake +14 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/remove +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/repair +23 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/reset +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/ruby +84 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/rubygems +11 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/rvmrc +34 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/snapshot +15 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/specs +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/srcdir +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/tests +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/tools +22 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/uninstall +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/update +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/upgrade +18 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/use +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/wrapper +41 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/install +631 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/VERSION.yml +4 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/capistrano.rb +45 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/alias.rb +69 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/cleanup.rb +54 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/configuration.rb +60 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/env.rb +52 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/gemset.rb +222 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/info.rb +13 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/list.rb +124 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/rubies.rb +50 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/sets.rb +123 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/tools.rb +68 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/utility.rb +173 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/wrapper.rb +23 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment.rb +64 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/errors.rb +31 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/install_command_dumper.rb +51 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/abstract_wrapper.rb +145 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/calculate_rvm_path.sh +26 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/result.rb +42 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/shell_wrapper.sh +10 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/single_shot_wrapper.rb +56 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/utility.rb +37 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell.rb +25 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/version.rb +19 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm.rb +156 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/man/man1/rvm.1 +385 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/man/man1/rvm.1.gz +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/rvm.gemspec +184 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/alias +225 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/aliases +4 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/array +32 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/base +49 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cd +87 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cleanup +58 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cli +781 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/color +49 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/completion +151 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/db +87 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/default +64 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/disk-usage +60 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/docs +115 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/env +46 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/environment-convertor +74 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/fetch +229 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/gemsets +950 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/hash +37 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/help +46 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/hook +23 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/info +214 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/initialize +29 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/install +631 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/irbrc +9 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/irbrc.rb +63 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/list +315 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/log +38 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/maglev +193 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/manage +2094 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/match +6 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/md5 +22 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/migrate +175 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/monitor +105 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/notes +121 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/override_gem +14 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/package +301 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patches +64 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patchsets +87 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/repair +199 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/rubygems +157 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/rvm +120 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/rvm-install +631 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/selector +818 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/set +301 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/snapshot +262 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/tools +58 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/update +631 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/upgrade +144 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/utility +1557 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/version +17 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/wrapper +210 -0
- data/vendor/ruby/1.8/specifications/macaddr-1.0.0.gemspec +27 -0
- data/vendor/ruby/1.8/specifications/rvm-1.0.14.gemspec +42 -0
- metadata +149 -4
@@ -0,0 +1,631 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
set -o errtrace
|
4
|
+
set -o errexit
|
5
|
+
|
6
|
+
export PS4='+[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() $ }'
|
7
|
+
|
8
|
+
if [[ -z "$rvm_selfcontained" ]]; then
|
9
|
+
if [[ "root" = "$(whoami)" \
|
10
|
+
|| -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
|
11
|
+
export rvm_selfcontained=0
|
12
|
+
else
|
13
|
+
export rvm_selfcontained=1
|
14
|
+
fi
|
15
|
+
fi
|
16
|
+
|
17
|
+
unset rvm_auto_flag
|
18
|
+
|
19
|
+
install_source_path="$(dirname "$0" | sed 's#\/scripts$##')"
|
20
|
+
|
21
|
+
if [[ -d "$install_source_path/scripts" \
|
22
|
+
&& -s "$install_source_path/scripts/utility" ]] ; then
|
23
|
+
builtin cd "$install_source_path"
|
24
|
+
fi
|
25
|
+
|
26
|
+
source scripts/version
|
27
|
+
source scripts/utility
|
28
|
+
|
29
|
+
usage()
|
30
|
+
{
|
31
|
+
printf "
|
32
|
+
Usage:
|
33
|
+
|
34
|
+
${0} [options]
|
35
|
+
|
36
|
+
options:
|
37
|
+
|
38
|
+
--auto : Automatically update shell profile files.
|
39
|
+
|
40
|
+
--prefix : Installation prefix directory.
|
41
|
+
|
42
|
+
--help : Display help/usage (this) message
|
43
|
+
|
44
|
+
--version : display rvm package version
|
45
|
+
|
46
|
+
"
|
47
|
+
}
|
48
|
+
|
49
|
+
check_rubyopt_conditions()
|
50
|
+
{
|
51
|
+
if [[ -n "${RUBYOPT:-""}" ]]; then
|
52
|
+
printf "
|
53
|
+
|
54
|
+
WARNING: You have RUBYOPT set in your current environment.
|
55
|
+
This may cause rubies to not work as you expect them to as it is not supported
|
56
|
+
by all of them If errors show up, please try unsetting RUBYOPT first.
|
57
|
+
|
58
|
+
"
|
59
|
+
fi
|
60
|
+
}
|
61
|
+
|
62
|
+
andand_return_instructions()
|
63
|
+
{
|
64
|
+
printf "
|
65
|
+
This means that if you see something like:
|
66
|
+
|
67
|
+
'[ -z \"\$PS1\" ] && return'
|
68
|
+
|
69
|
+
then you change this line to:
|
70
|
+
|
71
|
+
if [[ -n \"\$PS1\" ]] ; then
|
72
|
+
|
73
|
+
# ... original content that was below the '&& return' line ...
|
74
|
+
|
75
|
+
fi # <= be sure to close the if at the end of the .bashrc.
|
76
|
+
|
77
|
+
# This is a good place to source rvm v v v
|
78
|
+
[[ -s \"\$HOME/.rvm/scripts/rvm\" ]] && source \"\$HOME/.rvm/scripts/rvm\" # This loads RVM into a shell session.
|
79
|
+
|
80
|
+
EOF - This marks the end of the .bashrc file
|
81
|
+
"
|
82
|
+
}
|
83
|
+
|
84
|
+
installation_complete()
|
85
|
+
{
|
86
|
+
printf "
|
87
|
+
You must now complete the install by loading RVM in new shells.
|
88
|
+
|
89
|
+
1) Place the folowing line at the end of your shell's loading files
|
90
|
+
(.bashrc or .bash_profile for bash and .zshrc for zsh),
|
91
|
+
after all PATH/variable settings:
|
92
|
+
|
93
|
+
[[ -s \"\$HOME/.rvm/scripts/rvm\" ]] && source \"\$HOME/.rvm/scripts/rvm\" # This loads RVM into a shell session.
|
94
|
+
|
95
|
+
You only need to add this line the first time you install rvm.
|
96
|
+
|
97
|
+
2) Ensure that there is no 'return' from inside the ~/.bashrc file,
|
98
|
+
otherwise rvm may be prevented from working properly.
|
99
|
+
|
100
|
+
$(andand_return_instructions)
|
101
|
+
|
102
|
+
Be absolutely *sure* to REMOVE the '&& return'.
|
103
|
+
|
104
|
+
If you wish to DRY up your config you can 'source ~/.bashrc' at the bottom of your .bash_profile.
|
105
|
+
|
106
|
+
Placing all non-interactive (non login) items in the .bashrc,
|
107
|
+
including the 'source' line above and any environment settings.
|
108
|
+
|
109
|
+
3) CLOSE THIS SHELL and open a new one in order to use rvm.
|
110
|
+
\n"
|
111
|
+
}
|
112
|
+
|
113
|
+
andand_return_warning()
|
114
|
+
{
|
115
|
+
printf "
|
116
|
+
WARNING: you have a 'return' statement in your ~/.bashrc
|
117
|
+
This could cause some features of RVM to not work.
|
118
|
+
|
119
|
+
$(andand_return_instructions)
|
120
|
+
|
121
|
+
Even if you are using zsh you should still adjust the ~/.bashrc
|
122
|
+
If you have any questions about this please visit
|
123
|
+
#rvm on irc.freenode.net.
|
124
|
+
\n"
|
125
|
+
}
|
126
|
+
|
127
|
+
thank_you()
|
128
|
+
{
|
129
|
+
printf "
|
130
|
+
${name:-"$(whoami)"},
|
131
|
+
|
132
|
+
Thank you very much for using RVM! I sincerely hope that RVM helps to
|
133
|
+
make your work both easier and more enjoyable.
|
134
|
+
|
135
|
+
If you have any questions, issues and/or ideas for improvement please
|
136
|
+
join#rvm on irc.freenode.net and let me know, note you must register
|
137
|
+
(http://bit.ly/5mGjlm) and identify (/msg nickserv <nick> <pass>) to
|
138
|
+
talk, this prevents spambots from ruining our day.
|
139
|
+
|
140
|
+
My irc nickname is 'wayneeseguin' and I hang out in #rvm typically
|
141
|
+
|
142
|
+
~09:00-17:00EDT and again from ~21:00EDT-~23:00EDT
|
143
|
+
|
144
|
+
If I do not respond right away, please hang around after asking your
|
145
|
+
question, I will respond as soon as I am back. It is best to talk in
|
146
|
+
#rvm itself as then other users can help out should I be offline.
|
147
|
+
|
148
|
+
Be sure to get head often as rvm development happens fast,
|
149
|
+
you can do this by running 'rvm update --head' followed by 'rvm reload'
|
150
|
+
or opening a new shell
|
151
|
+
|
152
|
+
w⦿‿⦿t
|
153
|
+
|
154
|
+
~ Wayne
|
155
|
+
|
156
|
+
"
|
157
|
+
}
|
158
|
+
|
159
|
+
upgrade_notes()
|
160
|
+
{
|
161
|
+
printf "
|
162
|
+
|
163
|
+
Upgrade Notes
|
164
|
+
|
165
|
+
* Ruby package dependency list for your OS is given by:
|
166
|
+
rvm notes
|
167
|
+
|
168
|
+
* If you encounter any issues with a ruby 'X' your best bet is to:
|
169
|
+
rvm remove X ; rvm install X
|
170
|
+
|
171
|
+
* If you wish to have the 'pretty colors' again, set in ~/.rvmrc:
|
172
|
+
export rvm_pretty_print_flag=1
|
173
|
+
"
|
174
|
+
}
|
175
|
+
|
176
|
+
set -o noclobber
|
177
|
+
set -o nounset
|
178
|
+
|
179
|
+
while [[ $# -gt 0 ]] ; do
|
180
|
+
token="$1" ; shift
|
181
|
+
case "$token" in
|
182
|
+
--auto) rvm_auto_flag=1 ;;
|
183
|
+
--prefix) rvm_prefix="$1" ; shift ;;
|
184
|
+
--version) rvm_path="$PWD" ; __rvm_version ; unset rvm_path ; exit ;;
|
185
|
+
--debug)
|
186
|
+
set -o verbose
|
187
|
+
;;
|
188
|
+
--trace)
|
189
|
+
echo "$*"
|
190
|
+
env | grep '^rvm_'
|
191
|
+
set -o xtrace
|
192
|
+
;;
|
193
|
+
--help|*) usage ;;
|
194
|
+
esac
|
195
|
+
done
|
196
|
+
|
197
|
+
if [[ -z "${rvm_prefix:-""}" ]] ; then
|
198
|
+
__rvm_load_rvmrc
|
199
|
+
if [[ "$rvm_selfcontained" = "0" ]] ; then
|
200
|
+
rvm_prefix="${rvm_prefix:-"/usr/local/"}"
|
201
|
+
else
|
202
|
+
rvm_prefix="${rvm_prefix:-"$HOME/."}"
|
203
|
+
fi
|
204
|
+
fi
|
205
|
+
|
206
|
+
if [[ -z "${rvm_path:-""}" ]] ; then
|
207
|
+
rvm_path="${rvm_prefix}rvm"
|
208
|
+
fi
|
209
|
+
|
210
|
+
source scripts/initialize
|
211
|
+
|
212
|
+
if grep -q 'scripts/rvm' "$HOME"/.bash* 2>/dev/null \
|
213
|
+
|| grep -q 'scripts/rvm' "$HOME"/.zsh* 2>/dev/null ; then
|
214
|
+
|
215
|
+
if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then
|
216
|
+
|
217
|
+
export upgrade_flag=1
|
218
|
+
|
219
|
+
else
|
220
|
+
|
221
|
+
export upgrade_flag=0
|
222
|
+
|
223
|
+
fi
|
224
|
+
|
225
|
+
else
|
226
|
+
|
227
|
+
export upgrade_flag=0
|
228
|
+
|
229
|
+
fi
|
230
|
+
|
231
|
+
__rvm_initialize
|
232
|
+
|
233
|
+
#
|
234
|
+
# Setup & Configuration
|
235
|
+
#
|
236
|
+
item="* "
|
237
|
+
question="\n<?>"
|
238
|
+
cwd="$PWD"
|
239
|
+
|
240
|
+
source_path="${source_path:-$cwd}"
|
241
|
+
|
242
|
+
if [[ "$rvm_selfcontained" = "0" ]] ; then
|
243
|
+
rvm_bin_path="${rvm_bin_path:-"${rvm_prefix}bin"}"
|
244
|
+
rvm_man_path="${rvm_man_path:-"${rvm_prefix}share/man"}"
|
245
|
+
rvm_rc_files="${rvm_rc_files:-"/etc/profile /etc/zshenv"}"
|
246
|
+
else
|
247
|
+
rvm_man_path="${rvm_man_path:-"$rvm_path/man"}"
|
248
|
+
rvm_bin_path="${rvm_bin_path:-"$rvm_path/bin"}"
|
249
|
+
rvm_rc_files="${rvm_rc_files:-"$HOME/.bash_profile $HOME/.bashrc $HOME/.zshenv"}"
|
250
|
+
fi
|
251
|
+
|
252
|
+
rvm_gems_path="${rvm_gems_path:-"$rvm_path/gems"}"
|
253
|
+
rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}"
|
254
|
+
|
255
|
+
printf "
|
256
|
+
RVM: Shell scripts enabling management of multiple ruby environments.
|
257
|
+
RTFM: http://rvm.beginrescueend.com/
|
258
|
+
HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
|
259
|
+
"
|
260
|
+
|
261
|
+
if [[ ${upgrade_flag:-0} -eq 1 ]] ;then
|
262
|
+
|
263
|
+
printf "\nUpgrading the RVM installation in $rvm_path/"
|
264
|
+
|
265
|
+
else
|
266
|
+
|
267
|
+
printf "\nInstalling RVM to $rvm_path/"
|
268
|
+
|
269
|
+
fi
|
270
|
+
|
271
|
+
directories=(
|
272
|
+
"${rvm_archives_path:-"$rvm_path/archives"}"
|
273
|
+
"${rvm_src_path:-"$rvm_path/src"}"
|
274
|
+
"${rvm_log_path:-"$rvm_path/log"}"
|
275
|
+
"$rvm_bin_path"
|
276
|
+
"${rvm_gems_path:-"$rvm_path/gems"}"
|
277
|
+
"${rvm_rubies_path:-"$rvm_path/rubies"}"
|
278
|
+
"$rvm_path/config"
|
279
|
+
"${rvm_tmp_path:-"$rvm_path/tmp"}"
|
280
|
+
"$rvm_path/bin"
|
281
|
+
)
|
282
|
+
|
283
|
+
for directory in "${directories[@]}" ; do
|
284
|
+
|
285
|
+
if [[ ! -d "$directory" ]] ; then
|
286
|
+
|
287
|
+
mkdir -p "$directory"
|
288
|
+
|
289
|
+
fi
|
290
|
+
|
291
|
+
done
|
292
|
+
|
293
|
+
files=(README LICENCE)
|
294
|
+
|
295
|
+
for file in "${files[@]}"; do
|
296
|
+
|
297
|
+
cp -f "$source_path/$file" "$rvm_path/"
|
298
|
+
|
299
|
+
done
|
300
|
+
|
301
|
+
#
|
302
|
+
# Scripts
|
303
|
+
#
|
304
|
+
for dir_name in config scripts examples lib hooks help patches; do
|
305
|
+
|
306
|
+
if [[ -d "$source_path/$dir_name" ]] ; then
|
307
|
+
|
308
|
+
if [[ ! -d "$rvm_path/$dir_name" ]] ; then
|
309
|
+
|
310
|
+
mkdir -p "$rvm_path/$dir_name"
|
311
|
+
|
312
|
+
fi
|
313
|
+
|
314
|
+
cp -Rf "$source_path/$dir_name" "$rvm_path"
|
315
|
+
|
316
|
+
fi
|
317
|
+
|
318
|
+
done
|
319
|
+
|
320
|
+
if [[ ! -s "$rvm_path/config/user" ]] ; then
|
321
|
+
echo '# User settings, overrides db settings and persists across installs.' \
|
322
|
+
>> "$rvm_path/config/user"
|
323
|
+
fi
|
324
|
+
|
325
|
+
scripts=(monitor match log install color db fetch log set package)
|
326
|
+
|
327
|
+
for script_name in "${scripts[@]}" ; do
|
328
|
+
|
329
|
+
chmod +x "$rvm_path/scripts/$script_name" 2>/dev/null # Hide errors.
|
330
|
+
|
331
|
+
done
|
332
|
+
|
333
|
+
#
|
334
|
+
# Bin Scripts
|
335
|
+
#
|
336
|
+
# Cleanse and purge...
|
337
|
+
files=(rvm-prompt rvm rvmsudo rvm-shell rvm-auto-ruby)
|
338
|
+
|
339
|
+
for file in "${files[@]}" ; do
|
340
|
+
|
341
|
+
rm -f "$rvm_bin_path/$file"
|
342
|
+
|
343
|
+
cp -f "$source_path/binscripts/$file" "${rvm_bin_path:-"$rvm_path/bin"}/"
|
344
|
+
|
345
|
+
done
|
346
|
+
|
347
|
+
chmod +x "${rvm_bin_path:-"$rvm_path/bin"}"/* # TODO: this is quite suboptimal.
|
348
|
+
|
349
|
+
#
|
350
|
+
# RC Files
|
351
|
+
#
|
352
|
+
if [[ ${rvm_auto_flag:-0} -eq 1 ]] ; then
|
353
|
+
|
354
|
+
printf "Checking rc files... ($rvm_rc_files)"
|
355
|
+
|
356
|
+
if [[ ${rvm_loaded_flag:-0} -ne 1 ]] ; then
|
357
|
+
|
358
|
+
for rcfile in $(printf $rvm_rc_files) ; do
|
359
|
+
|
360
|
+
if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
|
361
|
+
|
362
|
+
if [[ -s "$HOME/.profile" ]] ; then
|
363
|
+
|
364
|
+
if ! grep -q '.profile' "$rcfile" ; then
|
365
|
+
|
366
|
+
echo " Adding profile sourcing line to $rcfile."
|
367
|
+
|
368
|
+
printf "
|
369
|
+
# rvm install added line:
|
370
|
+
[[ -s \"$rvm_path/.profile\" ]] && source \"$rvm_path/.profile\"
|
371
|
+
" >> "$rcfile"
|
372
|
+
|
373
|
+
fi
|
374
|
+
|
375
|
+
fi
|
376
|
+
|
377
|
+
if ! grep -q "scripts\/rvm" "$rcfile" ; then
|
378
|
+
|
379
|
+
echo " Adding rvm loading line to $rcfile."
|
380
|
+
|
381
|
+
printf "
|
382
|
+
# rvm install added:
|
383
|
+
[[ -s \"$rvm_path/.rvm/scripts/rvm\" ]] && . \"$rvm_path/.rvm/scripts/rvm\"
|
384
|
+
" >> "$rcfile"
|
385
|
+
|
386
|
+
fi
|
387
|
+
|
388
|
+
done
|
389
|
+
fi
|
390
|
+
fi
|
391
|
+
|
392
|
+
#
|
393
|
+
# Initial Interpreter Gemsets.
|
394
|
+
#
|
395
|
+
if [[ -d gemsets/ ]] ; then
|
396
|
+
|
397
|
+
if [[ ! -d "$rvm_path/gemsets" ]] ; then
|
398
|
+
|
399
|
+
mkdir -p "$rvm_path/gemsets"
|
400
|
+
|
401
|
+
fi
|
402
|
+
|
403
|
+
for gemset_file in $(find "$PWD/gemsets" -iname '*.gems' | sed 's/^\.\///') ; do
|
404
|
+
|
405
|
+
cwd="${PWD//\//\\/}\/gemsets\/"
|
406
|
+
|
407
|
+
destination="$rvm_path/gemsets/${gemset_file/$cwd}"
|
408
|
+
|
409
|
+
destination_path="$(dirname "$destination")"
|
410
|
+
|
411
|
+
if [[ ! -s "$destination" ]] ; then
|
412
|
+
|
413
|
+
mkdir -p "$destination_path"
|
414
|
+
|
415
|
+
cp "$gemset_file" "$destination"
|
416
|
+
|
417
|
+
fi
|
418
|
+
|
419
|
+
done
|
420
|
+
|
421
|
+
fi
|
422
|
+
|
423
|
+
if [[ -d patchsets/ ]] ; then
|
424
|
+
|
425
|
+
if [[ ! -d "$rvm_path/patchsets" ]] ; then
|
426
|
+
|
427
|
+
mkdir -p "$rvm_path/patchsets"
|
428
|
+
|
429
|
+
fi
|
430
|
+
|
431
|
+
patchsets=($(builtin cd patchsets ; find \. -iname '*' | sed 's/^\.\///'))
|
432
|
+
|
433
|
+
for patchset_file in "${patchsets[@]}" ; do
|
434
|
+
|
435
|
+
destination="$rvm_path/patchsets/$patchset_file"
|
436
|
+
|
437
|
+
if [[ ! -s "$destination" ]] ; then
|
438
|
+
|
439
|
+
destination_path="$(dirname "$destination")"
|
440
|
+
|
441
|
+
mkdir -p "$destination_path"
|
442
|
+
|
443
|
+
cp "patchsets/$patchset_file" "$destination"
|
444
|
+
|
445
|
+
fi
|
446
|
+
done
|
447
|
+
|
448
|
+
fi
|
449
|
+
|
450
|
+
#
|
451
|
+
# Migrate ~/.rvm/ruby-X,jruby-X,... to ~/.rvm/rubies/ for 0.1.0.
|
452
|
+
#
|
453
|
+
mkdir -p "${rvm_rubies_path:-"$rvm_path/rubies"}/"
|
454
|
+
|
455
|
+
for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* \
|
456
|
+
$rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
|
457
|
+
|
458
|
+
if [[ -d "$ruby" ]] ; then
|
459
|
+
|
460
|
+
mv "$ruby" "${rvm_rubies_path:-"$rvm_path/rubies"}/"
|
461
|
+
|
462
|
+
new_path="${rvm_rubies_path:-"$rvm_path/rubies"}/$(basename $ruby)"
|
463
|
+
|
464
|
+
for file in gem rake ; do
|
465
|
+
|
466
|
+
if [[ -s "$new_path/bin/$file" ]] ; then
|
467
|
+
|
468
|
+
sed -e '1,1s=.*=#!'"${new_path}/bin/ruby=" "${new_path}/bin/${file}" \
|
469
|
+
> "${new_path}/bin/${file}.new"
|
470
|
+
|
471
|
+
mv -f "$new_path/bin/$file.new" "$new_path/bin/$file"
|
472
|
+
|
473
|
+
chmod +x "$new_path/bin/$file"
|
474
|
+
|
475
|
+
fi
|
476
|
+
|
477
|
+
done
|
478
|
+
|
479
|
+
fi
|
480
|
+
|
481
|
+
done
|
482
|
+
#
|
483
|
+
# End of rubies migration.
|
484
|
+
#
|
485
|
+
|
486
|
+
#
|
487
|
+
# Migrate old gemset directories to new gemset pattern.
|
488
|
+
#
|
489
|
+
for gemset in "$rvm_path"/gems/*\%* ; do
|
490
|
+
|
491
|
+
new_path=${gemset/\%/${rvm_gemset_separator:-"@"}}
|
492
|
+
|
493
|
+
if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
|
494
|
+
|
495
|
+
printf "\n Renaming $(basename "$gemset") to $(basename "$new_path") for new gemset separator."
|
496
|
+
|
497
|
+
mv "$gemset" "$new_path"
|
498
|
+
|
499
|
+
fi
|
500
|
+
|
501
|
+
done
|
502
|
+
|
503
|
+
for gemset in "$rvm_path"/gems/*\+* ; do
|
504
|
+
|
505
|
+
new_path=${gemset/\+/${rvm_gemset_separator:-"@"}}
|
506
|
+
|
507
|
+
if [[ -d "$gemset" && ! -d "$new_path" ]] ; then
|
508
|
+
|
509
|
+
printf "\n Renaming $(basename "$gemset") to $(basename "$new_path") for new gemset separator."
|
510
|
+
|
511
|
+
mv $gemset $new_path
|
512
|
+
|
513
|
+
fi
|
514
|
+
|
515
|
+
done
|
516
|
+
|
517
|
+
for gemset in "$rvm_path"/gems/*\@ ; do
|
518
|
+
|
519
|
+
new_path=$(echo $gemset | sed -e 's#\@$##')
|
520
|
+
|
521
|
+
if [[ -d "$gemset" && ! -d "$new_path" ]] ; then
|
522
|
+
|
523
|
+
printf "\n Fixing: $(basename "$gemset") to $(basename "$new_path") for new gemset separator."
|
524
|
+
|
525
|
+
mv "$gemset" "$new_path"
|
526
|
+
|
527
|
+
fi
|
528
|
+
|
529
|
+
done
|
530
|
+
|
531
|
+
# Move from legacy defaults to the new, alias based system.
|
532
|
+
if [[ -s "$rvm_path/config/default" ]]; then
|
533
|
+
|
534
|
+
original_version="$(basename "$(grep GEM_HOME "$rvm_path/config/default" \
|
535
|
+
| awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator:-"@"}#")")"
|
536
|
+
|
537
|
+
if [[ -n "$original_version" ]]; then
|
538
|
+
|
539
|
+
"$rvm_path/scripts/alias" create default "$original_version" &> /dev/null
|
540
|
+
|
541
|
+
fi ; unset original_version
|
542
|
+
|
543
|
+
rm -rf "$rvm_path/config/default"
|
544
|
+
|
545
|
+
fi
|
546
|
+
|
547
|
+
#
|
548
|
+
# End of gemset migration.
|
549
|
+
#
|
550
|
+
declare -a files
|
551
|
+
|
552
|
+
printf "\n Correct permissions for base binaries in $rvm_bin_path..."
|
553
|
+
|
554
|
+
mkdir -p "${rvm_bin_path:-"$rvm_path/bin"}"
|
555
|
+
|
556
|
+
files=(rvm rvmsudo rvm-shell rvm-auto-ruby)
|
557
|
+
for file in "${files[@]}" ; do
|
558
|
+
|
559
|
+
if [[ -s "${rvm_bin_path:-"$rvm_path/bin"}/$file" ]] ; then
|
560
|
+
|
561
|
+
chmod +x "${rvm_bin_path:-"$rvm_path/bin"}/$file"
|
562
|
+
|
563
|
+
fi
|
564
|
+
|
565
|
+
done
|
566
|
+
|
567
|
+
printf "\n Copying manpages into place."
|
568
|
+
|
569
|
+
files=($(builtin cd "$install_source_path/man" ; \
|
570
|
+
find . -maxdepth 1 -mindepth 1 -type f -print))
|
571
|
+
|
572
|
+
for file in "${files[@]//.\/}" ; do
|
573
|
+
|
574
|
+
rm -rf "$rvm_man_path/$file"
|
575
|
+
|
576
|
+
cp -R "$install_source_path/man/$file" "$rvm_man_path/"
|
577
|
+
|
578
|
+
done
|
579
|
+
|
580
|
+
files=($( find "$rvm_path/" -mindepth 1 -maxdepth 2 -iname '*.swp' -type f ))
|
581
|
+
|
582
|
+
if [[ ${#files[@]} -gt 0 ]] ; then
|
583
|
+
|
584
|
+
printf "\n Cleanup any .swp files."
|
585
|
+
|
586
|
+
for file in "${files[@]}" ; do
|
587
|
+
|
588
|
+
if [[ -f "$file" ]] ; then
|
589
|
+
rm -f "$file"
|
590
|
+
fi
|
591
|
+
|
592
|
+
done
|
593
|
+
fi
|
594
|
+
|
595
|
+
if [[ $upgrade_flag -eq 0 ]] ; then
|
596
|
+
chmod +x ./scripts/notes # Sometimes things don't clone properly :/
|
597
|
+
./scripts/notes
|
598
|
+
fi
|
599
|
+
|
600
|
+
name="$(awk -F= '/^[[:space:]]*name/{print $2}' ~/.gitconfig 2>/dev/null)"
|
601
|
+
|
602
|
+
if [[ ${upgrade_flag:-0} -eq 1 ]] ; then
|
603
|
+
|
604
|
+
upgrade_notes
|
605
|
+
|
606
|
+
check_rubyopt_conditions
|
607
|
+
|
608
|
+
printf "\nUpgrade of RVM in $rvm_path/ is complete.\n\n"
|
609
|
+
|
610
|
+
else
|
611
|
+
|
612
|
+
if [[ ${rvm_selfcontained:-0} -eq 1 ]] ; then
|
613
|
+
|
614
|
+
installation_complete
|
615
|
+
|
616
|
+
fi
|
617
|
+
|
618
|
+
if [[ -s "$HOME/.bashrc" ]] && grep -q '&& return' "$HOME/.bashrc" ; then
|
619
|
+
|
620
|
+
andand_return_warning
|
621
|
+
|
622
|
+
fi
|
623
|
+
|
624
|
+
check_rubyopt_conditions
|
625
|
+
|
626
|
+
printf "\nInstallation of RVM to $rvm_path/ is complete.\n\n"
|
627
|
+
fi
|
628
|
+
|
629
|
+
thank_you
|
630
|
+
|
631
|
+
exit 0
|
@@ -0,0 +1,9 @@
|
|
1
|
+
|
2
|
+
# This loads some niceties for irb, courtesy of rvm.
|
3
|
+
# It also loads your custom ~/.irbrc if it exists.
|
4
|
+
# If you want to customize the irbrc for ONLY this version of
|
5
|
+
# ruby then edit this file. It will only be deleted if you do
|
6
|
+
# an "rvm install" over this ruby version.
|
7
|
+
|
8
|
+
require File.join(ENV["rvm_path"], "scripts", "irbrc")
|
9
|
+
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# This is the common irbrc file used by all rvm ruby installations.
|
2
|
+
# This file will be overriden every time you update rvm.
|
3
|
+
|
4
|
+
# Turn on completion.
|
5
|
+
begin
|
6
|
+
require "readline"
|
7
|
+
|
8
|
+
require "irb/completion" rescue nil
|
9
|
+
|
10
|
+
# Turn on history saving.
|
11
|
+
# require "irb/ext/save-history"
|
12
|
+
# IRB.conf[:HISTORY_FILE] = File.join(ENV["HOME"], ".irb-history")
|
13
|
+
|
14
|
+
# Use an alternate way to on history saving until save-history is fixed.
|
15
|
+
#
|
16
|
+
# bug: http://redmine.ruby-lang.org/issues/show/1556
|
17
|
+
# patch: http://pastie.org/513500
|
18
|
+
#
|
19
|
+
# This technique was adopted from /etc/irbrc on OS X.
|
20
|
+
histfile = File.expand_path(".irb-history", ENV["HOME"])
|
21
|
+
|
22
|
+
if File.exists?(histfile)
|
23
|
+
lines = IO.readlines(histfile).collect { |line| line.chomp }
|
24
|
+
Readline::HISTORY.push(*lines)
|
25
|
+
end
|
26
|
+
|
27
|
+
Kernel::at_exit do
|
28
|
+
maxhistsize = 100
|
29
|
+
histfile = File::expand_path(".irb-history", ENV["HOME"])
|
30
|
+
lines = Readline::HISTORY.to_a.reverse.uniq.reverse
|
31
|
+
lines = lines[-maxhistsize, maxhistsize] if lines.compact.length > maxhistsize
|
32
|
+
File::open(histfile, "w+") { |io| io.puts lines.join("\n") }
|
33
|
+
end
|
34
|
+
|
35
|
+
rescue
|
36
|
+
puts "Readline was unable to be required, if you need completion or history install readline then reinstall the ruby.\nYou may follow 'rvm notes' for dependencies and/or read the docs page http://rvm.beginrescueend.com/packages/readline/ . Be sure you 'rvm remove X ; rvm install X' to re-compile your ruby with readline support after obtaining the readline libraries."
|
37
|
+
end
|
38
|
+
|
39
|
+
# Calculate the ruby string.
|
40
|
+
rvm_ruby_string = ENV["rvm_ruby_string"] || `rvm tools identifier`.strip.split("@", 2)[0]
|
41
|
+
|
42
|
+
# Set up the prompt to be RVM specific.
|
43
|
+
@prompt = {
|
44
|
+
:PROMPT_I => "#{rvm_ruby_string} > ", # default prompt
|
45
|
+
:PROMPT_S => "#{rvm_ruby_string}%l> ", # known continuation
|
46
|
+
:PROMPT_C => "#{rvm_ruby_string} > ",
|
47
|
+
:PROMPT_N => "#{rvm_ruby_string} ?> ", # unknown continuation
|
48
|
+
:RETURN => " => %s \n",
|
49
|
+
:AUTO_INDENT => true
|
50
|
+
}
|
51
|
+
IRB.conf[:PROMPT][:RVM] = @prompt
|
52
|
+
IRB.conf[:PROMPT_MODE] = :RVM
|
53
|
+
|
54
|
+
# Load the user's irbrc file, if possible.
|
55
|
+
# Report any errors that occur.
|
56
|
+
begin
|
57
|
+
load File.join(ENV["HOME"], ".irbrc") if File.exists?("#{ENV["HOME"]}/.irbrc")
|
58
|
+
rescue LoadError => load_error
|
59
|
+
puts load_error
|
60
|
+
rescue => exception
|
61
|
+
puts "Error : 'load #{ENV["HOME"]}/.irbrc' : #{exception.message}"
|
62
|
+
end
|
63
|
+
|