gemrage 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. data/Gemfile +2 -0
  2. data/Gemfile.lock +5 -0
  3. data/VERSION +1 -1
  4. data/gemrage.gemspec +148 -3
  5. data/lib/rubygems/commands/scan_command.rb +77 -4
  6. data/vendor/ruby/1.8/bin/rvm-install +19 -0
  7. data/vendor/ruby/1.8/cache/macaddr-1.0.0.gem +0 -0
  8. data/vendor/ruby/1.8/cache/rvm-1.0.14.gem +0 -0
  9. data/vendor/ruby/1.8/gems/macaddr-1.0.0/README +33 -0
  10. data/vendor/ruby/1.8/gems/macaddr-1.0.0/gemspec.rb +27 -0
  11. data/vendor/ruby/1.8/gems/macaddr-1.0.0/install.rb +210 -0
  12. data/vendor/ruby/1.8/gems/macaddr-1.0.0/lib/macaddr.rb +69 -0
  13. data/vendor/ruby/1.8/gems/rvm-1.0.14/LICENCE +18 -0
  14. data/vendor/ruby/1.8/gems/rvm-1.0.14/README +127 -0
  15. data/vendor/ruby/1.8/gems/rvm-1.0.14/bin/rvm-install +5 -0
  16. data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm +76 -0
  17. data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-auto-ruby +24 -0
  18. data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-prompt +204 -0
  19. data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-shell +35 -0
  20. data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-update-head +35 -0
  21. data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-update-latest +27 -0
  22. data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvmsudo +24 -0
  23. data/vendor/ruby/1.8/gems/rvm-1.0.14/config/db +71 -0
  24. data/vendor/ruby/1.8/gems/rvm-1.0.14/config/known +55 -0
  25. data/vendor/ruby/1.8/gems/rvm-1.0.14/config/md5 +87 -0
  26. data/vendor/ruby/1.8/gems/rvm-1.0.14/contrib/gemset_snapshot +25 -0
  27. data/vendor/ruby/1.8/gems/rvm-1.0.14/contrib/install-system-wide +191 -0
  28. data/vendor/ruby/1.8/gems/rvm-1.0.14/contrib/r +44 -0
  29. data/vendor/ruby/1.8/gems/rvm-1.0.14/examples/rvmrc +47 -0
  30. data/vendor/ruby/1.8/gems/rvm-1.0.14/gemsets/default.gems +1 -0
  31. data/vendor/ruby/1.8/gems/rvm-1.0.14/gemsets/global.gems +1 -0
  32. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/alias +46 -0
  33. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/benchmark +17 -0
  34. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/cleanup +23 -0
  35. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/debug +8 -0
  36. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/disk-usage +15 -0
  37. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/docs +22 -0
  38. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/exec +33 -0
  39. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/fetch +5 -0
  40. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/gem +0 -0
  41. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/gemdir +0 -0
  42. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/gemset +0 -0
  43. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/implode +0 -0
  44. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/info +64 -0
  45. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/install +0 -0
  46. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/list +0 -0
  47. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/migrate +15 -0
  48. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/monitor +0 -0
  49. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/notes +0 -0
  50. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/package +0 -0
  51. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/rake +14 -0
  52. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/remove +0 -0
  53. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/repair +23 -0
  54. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/reset +0 -0
  55. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/ruby +84 -0
  56. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/rubygems +11 -0
  57. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/rvmrc +34 -0
  58. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/snapshot +15 -0
  59. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/specs +0 -0
  60. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/srcdir +0 -0
  61. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/tests +0 -0
  62. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/tools +22 -0
  63. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/uninstall +0 -0
  64. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/update +0 -0
  65. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/upgrade +18 -0
  66. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/use +0 -0
  67. data/vendor/ruby/1.8/gems/rvm-1.0.14/help/wrapper +41 -0
  68. data/vendor/ruby/1.8/gems/rvm-1.0.14/install +631 -0
  69. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/VERSION.yml +4 -0
  70. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/capistrano.rb +45 -0
  71. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/alias.rb +69 -0
  72. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/cleanup.rb +54 -0
  73. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/configuration.rb +60 -0
  74. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/env.rb +52 -0
  75. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/gemset.rb +222 -0
  76. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/info.rb +13 -0
  77. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/list.rb +124 -0
  78. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/rubies.rb +50 -0
  79. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/sets.rb +123 -0
  80. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/tools.rb +68 -0
  81. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/utility.rb +173 -0
  82. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/wrapper.rb +23 -0
  83. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment.rb +64 -0
  84. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/errors.rb +31 -0
  85. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/install_command_dumper.rb +51 -0
  86. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/abstract_wrapper.rb +145 -0
  87. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/calculate_rvm_path.sh +26 -0
  88. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/result.rb +42 -0
  89. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/shell_wrapper.sh +10 -0
  90. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/single_shot_wrapper.rb +56 -0
  91. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/utility.rb +37 -0
  92. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell.rb +25 -0
  93. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/version.rb +19 -0
  94. data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm.rb +156 -0
  95. data/vendor/ruby/1.8/gems/rvm-1.0.14/man/man1/rvm.1 +385 -0
  96. data/vendor/ruby/1.8/gems/rvm-1.0.14/man/man1/rvm.1.gz +0 -0
  97. data/vendor/ruby/1.8/gems/rvm-1.0.14/rvm.gemspec +184 -0
  98. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/alias +225 -0
  99. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/aliases +4 -0
  100. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/array +32 -0
  101. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/base +49 -0
  102. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cd +87 -0
  103. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cleanup +58 -0
  104. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cli +781 -0
  105. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/color +49 -0
  106. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/completion +151 -0
  107. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/db +87 -0
  108. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/default +64 -0
  109. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/disk-usage +60 -0
  110. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/docs +115 -0
  111. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/env +46 -0
  112. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/environment-convertor +74 -0
  113. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/fetch +229 -0
  114. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/gemsets +950 -0
  115. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/hash +37 -0
  116. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/help +46 -0
  117. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/hook +23 -0
  118. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/info +214 -0
  119. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/initialize +29 -0
  120. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/install +631 -0
  121. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/irbrc +9 -0
  122. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/irbrc.rb +63 -0
  123. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/list +315 -0
  124. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/log +38 -0
  125. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/maglev +193 -0
  126. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/manage +2094 -0
  127. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/match +6 -0
  128. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/md5 +22 -0
  129. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/migrate +175 -0
  130. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/monitor +105 -0
  131. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/notes +121 -0
  132. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/override_gem +14 -0
  133. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/package +301 -0
  134. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patches +64 -0
  135. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patchsets +87 -0
  136. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/repair +199 -0
  137. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/rubygems +157 -0
  138. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/rvm +120 -0
  139. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/rvm-install +631 -0
  140. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/selector +818 -0
  141. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/set +301 -0
  142. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/snapshot +262 -0
  143. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/tools +58 -0
  144. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/update +631 -0
  145. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/upgrade +144 -0
  146. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/utility +1557 -0
  147. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/version +17 -0
  148. data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/wrapper +210 -0
  149. data/vendor/ruby/1.8/specifications/macaddr-1.0.0.gemspec +27 -0
  150. data/vendor/ruby/1.8/specifications/rvm-1.0.14.gemspec +42 -0
  151. metadata +149 -4
@@ -0,0 +1,315 @@
1
+ #!/usr/bin/env bash
2
+
3
+ rvm_base_except="selector"
4
+
5
+ source "$rvm_path/scripts/base"
6
+
7
+ usage()
8
+ {
9
+ printf "
10
+ Usage:
11
+
12
+ rvm list [action]
13
+
14
+ Actions:
15
+
16
+ {help,known,gemsets,default [string],rubies,strings,known_strings,ruby_svn_tags}
17
+
18
+ "
19
+
20
+ return 0
21
+ }
22
+
23
+ list_gemsets()
24
+ {
25
+ local all_rubies version versions ruby_version_name current_ruby selected system_ruby system_version string binary
26
+
27
+ if [[ "${1:-""}" = "strings" ]]; then
28
+ list_gemset_strings
29
+ return 0
30
+ fi
31
+
32
+ current_ruby="$(__rvm_environment_identifier)"
33
+
34
+ all_rubies="$(list_strings)"
35
+
36
+ printf "\nrvm gemsets\n"
37
+
38
+ versions=($(builtin cd "${rvm_gems_path:-"$rvm_path/gems"}/" ; find . -maxdepth 1 -mindepth 1 -type d -print 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}'))
39
+
40
+ for version in "${versions[@]//.\/}" ; do
41
+
42
+ ruby_version_name="$(echo "$version" | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}')"
43
+
44
+ [[ "$all_rubies" != *"$ruby_version_name"* ]] && continue
45
+
46
+ if echo "$version" | grep -q '^jruby-' ; then
47
+ string="[ $("$rvm_path/rubies/$ruby_version_name/bin/ruby" -v | awk '{print $NF}' | sed -e 's/\[//' -e 's/\]//') ]"
48
+
49
+ elif [[ -n "$(echo "$version" | awk '/^maglev-|^macruby-/')" ]] ; then
50
+ string="[ x86_64 ]"
51
+
52
+ else
53
+ string="[ $(file "$rvm_path/rubies/$ruby_version_name/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
54
+ fi
55
+
56
+ printf "\n"
57
+
58
+ if [[ "$version" = "$current_ruby" ]]; then
59
+ printf "=> "
60
+ else
61
+ printf " "
62
+ fi
63
+
64
+ if [[ ${rvm_pretty_print_flag:-0} -eq 1 ]] ; then
65
+
66
+ printf "$(tput setaf 2)$version$(tput sgr0) $string"
67
+ else
68
+ printf "$version $string"
69
+ fi
70
+
71
+ done
72
+
73
+ if [[ -f "$rvm_path/config/default" && -s "$rvm_path/config/default" ]] ; then
74
+
75
+ version=$(grep 'MY_RUBY_HOME' "$rvm_path/config/default" | head -n1 | awk -F"'" '{print $2}' | xargs basename --)
76
+
77
+ if [[ -n "$version" ]] ; then
78
+
79
+ printf "\nDefault Ruby (for new shells)\n"
80
+
81
+ string="[ $(file "$rvm_path/rubies/$version/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
82
+
83
+ if [[ ${rvm_pretty_print_flag:-0} -eq 1 ]] ; then
84
+
85
+ printf "\n $(tput setaf 2)$version$(tput sgr0) $string\n"
86
+ else
87
+ printf "\n $version $string\n"
88
+ fi
89
+
90
+ fi
91
+
92
+ fi
93
+
94
+ printf "\n\n"
95
+
96
+ return 0
97
+ }
98
+
99
+ list_default()
100
+ {
101
+
102
+ local version string
103
+
104
+ if [[ "${args[0]:-""}" = "string" ]] ; then
105
+
106
+ "$rvm_path/scripts/alias" show default 2>/dev/null | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}' | xargs basename --
107
+
108
+ else
109
+ if [[ -L "$rvm_path/rubies/default" ]]; then
110
+
111
+ version=$("$rvm_path/scripts/alias" show default 2>/dev/null | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}' | xargs basename --)
112
+
113
+ if [[ -n "$version" ]] ; then
114
+
115
+ printf "\nDefault Ruby (for new shells)\n"
116
+
117
+ string="[ $(file "$rvm_path/rubies/$version/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | \tr "\n" ' ')]"
118
+
119
+ if [[ ${rvm_pretty_print_flag:-0} -eq 1 ]] ; then
120
+
121
+ printf "\n $(tput setaf 2)$version$(tput sgr0) $string\n"
122
+
123
+ else
124
+ printf "\n $version $string\n"
125
+ fi
126
+ fi
127
+ fi
128
+ fi
129
+
130
+ printf "\n"
131
+
132
+ return 0
133
+ }
134
+
135
+ list_ruby_svn_tags()
136
+ {
137
+ local prefix tag
138
+
139
+ while read -r tag
140
+ do
141
+ prefix="$(echo ${tag/\//} | sed 's#^v1_##' | awk -F'_' '{print "(ruby-)1."$1"."$2}' | sed 's#p$##')"
142
+
143
+ echo "${prefix}-t${tag/\//}"
144
+
145
+ done < <(svn list http://svn.ruby-lang.org/repos/ruby/tags/ | awk '/^v1_[8|9]/')
146
+
147
+ return 0
148
+ }
149
+
150
+ # Query for valid rvm ruby strings
151
+ # This is meant to be used with scripting.
152
+ list_strings()
153
+ {
154
+ (
155
+ cd "$rvm_path/rubies"
156
+
157
+ find . -maxdepth 1 -mindepth 1 -type d | sed -e 's#./##g'
158
+ )
159
+
160
+ return $?
161
+ }
162
+
163
+ # This is meant to be used with scripting.
164
+ list_gemset_strings()
165
+ {
166
+ local all_rubies ruby_name gemset gemsets
167
+
168
+ all_rubies="$(list_strings)"
169
+
170
+ gemsets=($(builtin cd "${rvm_gems_path:-"$rvm_path/gems"}" ; find . -maxdepth 1 -mindepth 1 -type d 2>/dev/null | xargs -n1 basename -- | \grep -v '^\(@\|doc$\|cache$\|system$\)' | sort))
171
+
172
+ for gemset in "${gemsets[@]//.\/}" ; do
173
+
174
+ ruby_name="${gemset//${rvm_gemset_separator:-"@"}*}"
175
+
176
+ [[ "$all_rubies" != *"$ruby_name"* ]] && continue
177
+
178
+ echo "$gemset"
179
+ done
180
+
181
+ return 0
182
+ }
183
+
184
+ # This is meant to be used with scripting.
185
+ list_known_strings()
186
+ {
187
+ sed -e 's/#.*$//g' -e 's#\[##g' -e 's#\]##g' < "$rvm_path/config/known" | sort -r | uniq
188
+
189
+ return $?
190
+ }
191
+
192
+ list_known()
193
+ {
194
+ if [[ "${1:-""}" = "strings" ]]; then
195
+
196
+ list_known_strings
197
+
198
+ return 0
199
+ fi
200
+
201
+ if [[ ${rvm_interactive_flag:-0} -eq 0 ]] ; then
202
+
203
+ cat "$rvm_path/config/known"
204
+
205
+ else
206
+
207
+ ${PAGER:-less} "$rvm_path/config/known"
208
+
209
+ fi
210
+
211
+ return $?
212
+ }
213
+
214
+ list_rubies_strings()
215
+ {
216
+ ( builtin cd "$rvm_path/rubies" ; find -maxdepth 0 -type d | tail -n+2 | xargs -n1 basename -- | __rvm_strip )
217
+
218
+ return $?
219
+ }
220
+
221
+ list_rubies()
222
+ {
223
+ local current_ruby rubies version selected system_ruby system_version string binary
224
+
225
+ if [[ "${1:-""}" = "strings" ]]; then list_rubies_strings ; return 0 ; fi
226
+
227
+ current_ruby="$(__rvm_environment_identifier | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}')"
228
+
229
+ printf "\nrvm rubies\n"
230
+
231
+ rubies=($(builtin cd "$rvm_path/rubies/" ; find . -maxdepth 1 -mindepth 1 -type d 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}'))
232
+
233
+ for version in "${rubies[@]//.\/}" ; do
234
+
235
+ [[ ! -x "$rvm_path/rubies/$version/bin/ruby" ]] && continue
236
+
237
+ if echo "$version" | grep -q '^jruby-' ; then
238
+
239
+ string="[ $("$rvm_path/rubies/$version/bin/ruby" -v | awk '{print $NF}' | sed -e 's/\[//' -e 's/\]//') ]"
240
+
241
+ elif [[ ! -z "$(echo "$version" | awk '/^maglev-|^macruby-/')" ]] ; then
242
+
243
+ string="[ x86_64 ]"
244
+
245
+ else
246
+
247
+ string="[ $(file "$rvm_path/rubies/$version/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
248
+ fi
249
+
250
+ printf "\n"
251
+
252
+ if [[ "$version" = "$current_ruby" ]]; then
253
+ printf "=> "
254
+ else
255
+ printf " "
256
+ fi
257
+
258
+ # TODO: Only use tput for interactive terminal sessions.
259
+ if [[ ${rvm_pretty_print_flag:-0} -eq 1 ]] ; then
260
+
261
+ printf "$(tput setaf 2)$version$(tput sgr0) $string"
262
+ else
263
+ printf "$version $string"
264
+ fi
265
+
266
+ done
267
+
268
+ if [[ -f "$rvm_path/config/default" ]] && [[ -s "$rvm_path/config/default" ]] ; then
269
+
270
+ version=$(grep 'MY_RUBY_HOME' "$rvm_path/config/default" | head -n 1 | awk -F"'" '{print $2}' | xargs basename --)
271
+
272
+ if [[ -n "$version" ]] ; then
273
+
274
+ printf "Default Ruby (for new shells)\n"
275
+
276
+ string="[ $(file "$rvm_path/rubies/$version/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | \tr "\n" ' ')]"
277
+
278
+ if [[ ${rvm_pretty_print_flag:-0} -eq 1 ]] ; then
279
+ printf " $(tput setaf 2)$version$(tput sgr0) $string\n"
280
+ else
281
+ printf " $version $string\n"
282
+ fi
283
+
284
+ fi
285
+
286
+ fi
287
+
288
+ printf "\n\n"
289
+
290
+ return 0
291
+ }
292
+
293
+ # List all rvm installed rubies, default ruby and system ruby.
294
+ # Display the rubies, indicate their architecture and indicate which is currently used.
295
+ # This is not meant to be used with scripting. This is for interactive mode usage only.
296
+ args=($*)
297
+ action="${args[0]:-""}"
298
+ args=${args[@]:1} # Strip trailing / leading / extra spacing.
299
+
300
+
301
+ if [[ -z "$action" ]] ; then list_rubies ; exit 0 ; fi
302
+
303
+ case "$action" in
304
+ known) list_known ;;
305
+ known_strings) list_known_strings ;;
306
+ gemsets) list_gemsets "$args" ;;
307
+ default) list_default ;;
308
+ rubies) list_rubies "$args" ;;
309
+ strings) list_strings ;;
310
+ ruby_svn_tags) list_ruby_svn_tags ;;
311
+ help) usage ;;
312
+ *) usage ; exit 1 ;;
313
+ esac
314
+
315
+ exit $?
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # When rvm_silence_logging is set, don't show anything.
4
+ [[ -n "$rvm_silence_logging" ]] && exit 0
5
+
6
+ if [[ "$rvm_trace_flag" -eq 2 ]] ; then set -x ; export rvm_trace_flag ; fi
7
+
8
+ if [[ ! -z "$2" ]] ; then level=$1 ; shift ; else level="info" ; fi
9
+
10
+ message="${1//\%/%%}"
11
+
12
+ if [[ ${rvm_pretty_print_flag:-0} -eq 0 ]] ; then
13
+
14
+ if [[ ${rvm_verbose_flag:-0} -gt 0 && -n "$level" ]] ; then
15
+ message="$level: $message"
16
+ fi
17
+
18
+ case "$level" in
19
+ info) printf "${message#*: }\n" ;;
20
+ debug|warn) printf "$message\n" ;;
21
+ error|fail) printf "$message\n" >&2 ;;
22
+ *) printf "$message"
23
+ esac
24
+
25
+ else
26
+
27
+ case "$level" in
28
+ debug) printf "$(tput setaf 5)$level$(tput sgr0): $message\n" ;;
29
+ info) printf "$(tput setaf 2)$level$(tput sgr0): $message\n" ;;
30
+ warn) printf "$(tput setaf 3)$level$(tput sgr0): $message\n" ;;
31
+ error) printf "$(tput setaf 1)$level$(tput sgr0): $message\n" >&2 ;;
32
+ fail) printf "$(tput setaf 1)$level$(tput sgr0): $message\n" >&2 ;;
33
+ *) printf "$message"
34
+ esac
35
+
36
+ fi
37
+
38
+ exit 0
@@ -0,0 +1,193 @@
1
+ #!/usr/bin/env bash
2
+
3
+ if [[ "$rvm_trace_flag" -eq 2 ]] ; then set -x ; export rvm_trace_flag ; fi
4
+
5
+ system="$(uname -s)"
6
+ if [[ $system = "SunOS" ]] && [[ "$(uname -m)" = "i86pc" ]] ; then system="Solaris-x86" ; fi
7
+ version="MagLev-${1}.${system}"
8
+ gsname="GemStone-${1}.${system}"
9
+ zipfile=${version}.zip
10
+
11
+ # Check we're on a suitable 64-bit machine
12
+ case "$system" in
13
+ Linux)
14
+ if [[ "$(uname -sm)" != "Linux x86_64" ]]; then
15
+ "$rvm_path/scripts/log" "error" "This script only works on a 64-bit Linux OS."
16
+ echo "The result from \"uname -sm\" is \"`uname -sm`\" not \"Linux x86_64\""
17
+ exit 1
18
+ fi
19
+ ;;
20
+ Darwin)
21
+ system_version="$(sw_vers -productVersion)"
22
+ MAJOR="$(echo $system_version | cut -f1 -d.)"
23
+ MINOR="$(echo $system_version | cut -f2 -d.)"
24
+ CPU_TYPE="$(uname -p)"
25
+ CPU_CAPABLE="$(sysctl hw.cpu64bit_capable | cut -f2 -d' ')"
26
+ #
27
+ # Check the CPU and Mac OS profile.
28
+ if [[ $CPU_TYPE != "i386" || $CPU_CAPABLE -ne 1 || $MAJOR -lt 10 || $MINOR -lt 5 ]] ; then
29
+ "$rvm_path/scripts/log" "error" "This script requires Mac OS 10.5 or later on a 64-bit Intel CPU."
30
+ exit 1
31
+ fi
32
+ ;;
33
+ Solaris-x86)
34
+ if [[ "$(uname -sm)" != "SunOS i86pc" ]]; then
35
+ "$rvm_path/scripts/log" "error" "This script only works on a 64-bit Solaris-x86 OS."
36
+ echo "The result from \"uname -sm\" is \"`uname -sm`\" not \"SunOS i86pc\""
37
+ exit 1
38
+ fi
39
+ ;;
40
+ *)
41
+ "$rvm_path/scripts/log" "error" "This script only works on a 64-bit Linux, Mac OS X, or Solaris-x86 machine"
42
+ echo "The result from \"uname -sm\" is \"`uname -sm`\""
43
+ exit 1
44
+ ;;
45
+ esac
46
+
47
+ # We should run this as a normal user, not root.
48
+ if [[ `id | cut -f2 -d= | cut -f1 -d\(` -eq 0 ]]; then
49
+ "$rvm_path/scripts/log" "error" "This script should be run as a normal user, not root."
50
+ exit 1
51
+ fi
52
+
53
+ # Check that the current directory is writable
54
+ if [[ ! -w "." ]]; then
55
+ "$rvm_path/scripts/log" "error" "This script requires write permission on your current directory."
56
+ \ls -ld $PWD
57
+ exit 1
58
+ fi
59
+
60
+ # We're good to go. Let user know.
61
+ machine_name="`uname -n`"
62
+ "$rvm_path/scripts/log" "info" "Starting installation of $version on $machine_name"
63
+
64
+ # Figure out how much total memory is installed
65
+ "$rvm_path/scripts/log" "info" "Setting up shared memory"
66
+ #
67
+ # Ref: http://wiki.finkproject.org/index.php/Shared_Memory_Regions_on_Darwin
68
+ # Ref: http://developer.postgresql.org/pgdocs/postgres/kernel-resources.html
69
+ # Ref: http://www.idevelopment.info/data/Oracle/DBA_tips/Linux/LINUX_8.shtml
70
+ #
71
+ case "$system" in
72
+ Linux)
73
+ # use TotalMem: kB because Ubuntu doesn't have Mem: in Bytes
74
+ totalMemKB=`awk '/MemTotal:/{print($2);}' /proc/meminfo`
75
+ totalMem=$(($totalMemKB * 1024))
76
+ # Figure out the max shared memory segment size currently allowed
77
+ shmmax=`cat /proc/sys/kernel/shmmax`
78
+ # Figure out the max shared memory currently allowed
79
+ shmall=`cat /proc/sys/kernel/shmall`
80
+ ;;
81
+ Darwin)
82
+ totalMem="`sysctl hw.memsize | cut -f2 -d' '`"
83
+ # Figure out the max shared memory segment size currently allowed
84
+ shmmax="`sysctl kern.sysv.shmmax | cut -f2 -d' '`"
85
+ # Figure out the max shared memory currently allowed
86
+ shmall="`sysctl kern.sysv.shmall | cut -f2 -d' '`"
87
+ ;;
88
+ Solaris-x86)
89
+ # TODO: figure memory needs for Solaris-x86
90
+ # Investigate project.max-shm-memory
91
+ totalMemMB="`/usr/sbin/prtconf | \grep Memory | cut -f3 -d' '`"
92
+ totalMem=$(($totalMemMB * 1048576))
93
+ shmmax=$(($totalMem / 4))
94
+ shmall=$(($shmmax / 4096))
95
+ ;;
96
+ *)
97
+ "$rvm_path/scripts/log" "error" "Can't determine operating system. Check script."
98
+ exit 1
99
+ ;;
100
+ esac
101
+ totalMemMB=$(($totalMem / 1048576))
102
+ shmmaxMB=$(($shmmax / 1048576))
103
+ shmallMB=$(($shmall / 256))
104
+
105
+ # Print current values
106
+ echo " Total memory available is $totalMemMB MB"
107
+ echo " Max shared memory segment size is $shmmaxMB MB"
108
+ echo " Max shared memory allowed is $shmallMB MB"
109
+
110
+ # Figure out the max shared memory segment size (shmmax) we want
111
+ # Use 75% of available memory but not more than 2GB
112
+ shmmaxNew=$(($totalMem * 3/4))
113
+ [[ $shmmaxNew -gt 2147483648 ]] && shmmaxNew=2147483648
114
+ shmmaxNewMB=$(($shmmaxNew / 1048576))
115
+
116
+ # Figure out the max shared memory allowed (shmall) we want
117
+ # The Darwin (OSX) default is 4MB, way too small
118
+ # The Linux default is 2097152 or 8GB, so we should never need this
119
+ # but things will certainly break if it's been reset too small
120
+ # so ensure it's at least big enough to hold a fullsize shared memory segment
121
+ shmallNew=$(($shmmaxNew / 4096))
122
+ [[ $shmallNew -lt $shmall ]] && shmallNew=$shmall
123
+ shmallNewMB=$(($shmallNew / 256))
124
+
125
+ # Increase shmmax if appropriate
126
+ if [[ $shmmaxNew -gt $shmmax ]]; then
127
+ "$rvm_path/scripts/log" "info" "Increasing max shared memory segment size to $shmmaxNewMB MB"
128
+ [[ $system = "Darwin" ]] && sudo sysctl -w kern.sysv.shmmax=$shmmaxNew
129
+ [[ $system = "Linux" ]] && sudo bash -c "echo $shmmaxNew > /proc/sys/kernel/shmmax"
130
+ [[ $system = "Solaris-x86" ]] && echo "[[Warning]] shmmax must be set manually on Solaris-x86"
131
+ else
132
+ "$rvm_path/scripts/log" "info" "No need to increase max shared memory segment size"
133
+ fi
134
+
135
+ # Increase shmall if appropriate
136
+ if [[ $shmallNew -gt $shmall ]]; then
137
+ "$rvm_path/scripts/log" "info" "Increasing max shared memory allowed to $shmallNewMB MB"
138
+ [[ $system = "Darwin" ]] && sudo sysctl -w kern.sysv.shmall=$shmallNew
139
+ [[ $system = "Linux" ]] && sudo bash -c "echo $shmallNew > /proc/sys/kernel/shmall"
140
+ [[ $system = "Solaris-x86" ]] && echo "[[Warning]]shmall must be set manually on Solaris-x86"
141
+ else
142
+ "$rvm_path/scripts/log" "info" "No need to increase max shared memory allowed"
143
+ fi
144
+
145
+ # At this point, shared memory settings contain the values we want,
146
+ # put them in sysctl.conf so they are preserved.
147
+ if [[ ! -f /etc/sysctl.conf ]] || [[ "$(\grep -sc "kern.*.shm" /etc/sysctl.conf)" -eq 0 ]] ; then
148
+ case "$system" in
149
+ Linux)
150
+ echo "# kernel.shm* settings added by MagLev installation" > /tmp/sysctl.conf.$$
151
+ echo "kernel.shmmax=$(cat /proc/sys/kernel/shmmax)" >> /tmp/sysctl.conf.$$
152
+ echo "kernel.shmall=$(cat /proc/sys/kernel/shmall)" >> /tmp/sysctl.conf.$$
153
+ ;;
154
+ Darwin)
155
+ # On Mac OS X Leopard, you must have all five settings in sysctl.conf
156
+ # before they will take effect.
157
+ echo "# kern.sysv.shm* settings added by MagLev installation" > /tmp/sysctl.conf.$$
158
+ sysctl kern.sysv.shmmax kern.sysv.shmall kern.sysv.shmmin kern.sysv.shmmni \
159
+ kern.sysv.shmseg | \tr ":" "=" | \tr -d " " >> /tmp/sysctl.conf.$$
160
+ ;;
161
+ Solaris-x86)
162
+ # Do nothing in Solaris-x86 since /etc/sysctl.conf is ignored on Solaris 10.
163
+ # Must configure shared memory settings manually.
164
+ ;;
165
+ *)
166
+ "$rvm_path/scripts/log" "error" "Can't determine operating system. Check script."
167
+ exit 1
168
+ ;;
169
+ esac
170
+ # Do nothing on Solaris-x86 since /etc/sysctl.conf is ignored on Solaris 10.
171
+ if [[ "$system" != "Solaris-x86" ]]; then
172
+ "$rvm_path/scripts/log" "info" "Adding the following section to /etc/sysctl.conf"
173
+ cat /tmp/sysctl.conf.$$
174
+ sudo bash -c "cat /tmp/sysctl.conf.$$ >> /etc/sysctl.conf"
175
+ /bin/rm -f /tmp/sysctl.conf.$$
176
+ fi
177
+ else
178
+ "$rvm_path/scripts/log" "info" "The following shared memory settings already exist in /etc/sysctl.conf"
179
+ echo "To change them, remove the following lines from /etc/sysctl.conf and rerun this script"
180
+ \grep "kern.*.shm" /etc/sysctl.conf
181
+ fi
182
+
183
+ # Now setup for NetLDI in case we ever need it.
184
+ "$rvm_path/scripts/log" "info" "Setting up GemStone netldi service port"
185
+ if [[ $(\grep -sc "^gs64ldi" /etc/services) -eq 0 ]]; then
186
+ echo '[[Info]] Adding "gs64ldi 50378/tcp" to /etc/services'
187
+ sudo bash -c 'echo "gs64ldi 50378/tcp # Gemstone netldi" >> /etc/services'
188
+ else
189
+ "$rvm_path/scripts/log" "info" "GemStone netldi service port is already set in /etc/services"
190
+ echo "To change it, remove the following line from /etc/services and rerun this script"
191
+ \grep "^gs64ldi" /etc/services
192
+ fi
193
+