1 |
commit: 2dab7aa15724cdad83fb524a4a12d857e42f1aac |
2 |
Author: Hans de Graaff <graaff <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 28 12:11:24 2019 +0000 |
4 |
Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 28 12:11:53 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2dab7aa1 |
7 |
|
8 |
dev-ruby/rdoc: port jquery fixes to our 5.x version |
9 |
|
10 |
Package-Manager: Portage-2.3.69, Repoman-2.3.16 |
11 |
Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org> |
12 |
|
13 |
dev-ruby/rdoc/files/rdoc-5.1.0-jquery.patch | 492 ++++++++++++++++++++++++++++ |
14 |
dev-ruby/rdoc/rdoc-5.1.0-r1.ebuild | 98 ++++++ |
15 |
2 files changed, 590 insertions(+) |
16 |
|
17 |
diff --git a/dev-ruby/rdoc/files/rdoc-5.1.0-jquery.patch b/dev-ruby/rdoc/files/rdoc-5.1.0-jquery.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..46166e90e5c |
20 |
--- /dev/null |
21 |
+++ b/dev-ruby/rdoc/files/rdoc-5.1.0-jquery.patch |
22 |
@@ -0,0 +1,492 @@ |
23 |
+From 03c737f3579de998fb8f5142f2c44c96428528dd Mon Sep 17 00:00:00 2001 |
24 |
+From: usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> |
25 |
+Date: Tue, 27 Aug 2019 12:55:42 +0000 |
26 |
+Subject: [PATCH] Update rdoc version from 5.0.0 to 5.0.1. |
27 |
+ |
28 |
+git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@67781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
29 |
+--- |
30 |
+ lib/rdoc.rb | 2 +- |
31 |
+ .../generator/template/darkfish/_head.rhtml | 7 +- |
32 |
+ .../generator/template/darkfish/css/rdoc.css | 23 +++- |
33 |
+ .../template/darkfish/js/darkfish.js | 122 ++++-------------- |
34 |
+ .../generator/template/darkfish/js/search.js | 63 ++++----- |
35 |
+ .../template/json_index/js/navigation.js | 44 +------ |
36 |
+ .../template/json_index/js/searcher.js | 12 +- |
37 |
+ version.h | 10 +- |
38 |
+ 8 files changed, 98 insertions(+), 185 deletions(-) |
39 |
+ |
40 |
+diff --git a/lib/rdoc/generator/template/darkfish/_head.rhtml b/lib/rdoc/generator/template/darkfish/_head.rhtml |
41 |
+index f308526823e2..8304310d4b34 100644 |
42 |
+--- a/lib/rdoc/generator/template/darkfish/_head.rhtml |
43 |
++++ b/lib/rdoc/generator/template/darkfish/_head.rhtml |
44 |
+@@ -7,8 +7,11 @@ |
45 |
+ var index_rel_prefix = "<%= rel_prefix %>/"; |
46 |
+ </script> |
47 |
+ |
48 |
+-<script src="<%= asset_rel_prefix %>/js/jquery.js"></script> |
49 |
+-<script src="<%= asset_rel_prefix %>/js/darkfish.js"></script> |
50 |
++<script src="<%= asset_rel_prefix %>/js/navigation.js" defer></script> |
51 |
++<script src="<%= asset_rel_prefix %>/js/search.js" defer></script> |
52 |
++<script src="<%= asset_rel_prefix %>/js/search_index.js" defer></script> |
53 |
++<script src="<%= asset_rel_prefix %>/js/searcher.js" defer></script> |
54 |
++<script src="<%= asset_rel_prefix %>/js/darkfish.js" defer></script> |
55 |
+ |
56 |
+ <link href="<%= asset_rel_prefix %>/css/fonts.css" rel="stylesheet"> |
57 |
+ <link href="<%= asset_rel_prefix %>/css/rdoc.css" rel="stylesheet"> |
58 |
+diff --git a/lib/rdoc/generator/template/darkfish/css/rdoc.css b/lib/rdoc/generator/template/darkfish/css/rdoc.css |
59 |
+index 2f4dca7e0844..1bdb6e6223c1 100644 |
60 |
+--- a/lib/rdoc/generator/template/darkfish/css/rdoc.css |
61 |
++++ b/lib/rdoc/generator/template/darkfish/css/rdoc.css |
62 |
+@@ -9,6 +9,8 @@ |
63 |
+ /* vim: ft=css et sw=2 ts=2 sts=2 */ |
64 |
+ /* Base Green is: #6C8C22 */ |
65 |
+ |
66 |
++.hide { display: none !important; } |
67 |
++ |
68 |
+ * { padding: 0; margin: 0; } |
69 |
+ |
70 |
+ body { |
71 |
+@@ -48,6 +50,16 @@ h6:hover span { |
72 |
+ display: inline; |
73 |
+ } |
74 |
+ |
75 |
++h1:target, |
76 |
++h2:target, |
77 |
++h3:target, |
78 |
++h4:target, |
79 |
++h5:target, |
80 |
++h6:target { |
81 |
++ margin-left: -10px; |
82 |
++ border-left: 10px solid #f1edba; |
83 |
++} |
84 |
++ |
85 |
+ :link, |
86 |
+ :visited { |
87 |
+ color: #6C8C22; |
88 |
+@@ -441,7 +453,16 @@ main header h3 { |
89 |
+ /* @group Method Details */ |
90 |
+ |
91 |
+ main .method-source-code { |
92 |
+- display: none; |
93 |
++ max-height: 0; |
94 |
++ overflow: hidden; |
95 |
++ transition-duration: 200ms; |
96 |
++ transition-delay: 0ms; |
97 |
++ transition-property: all; |
98 |
++ transition-timing-function: ease-in-out; |
99 |
++} |
100 |
++ |
101 |
++main .method-source-code.active-menu { |
102 |
++ max-height: 100vh; |
103 |
+ } |
104 |
+ |
105 |
+ main .method-description .method-calls-super { |
106 |
+diff --git a/lib/rdoc/generator/template/darkfish/js/darkfish.js b/lib/rdoc/generator/template/darkfish/js/darkfish.js |
107 |
+index 38f877ed4028..089813fcdef4 100644 |
108 |
+--- a/lib/rdoc/generator/template/darkfish/js/darkfish.js |
109 |
++++ b/lib/rdoc/generator/template/darkfish/js/darkfish.js |
110 |
+@@ -8,6 +8,7 @@ |
111 |
+ */ |
112 |
+ |
113 |
+ /* Provide console simulation for firebug-less environments */ |
114 |
++/* |
115 |
+ if (!("console" in window) || !("firebug" in console)) { |
116 |
+ var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", |
117 |
+ "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; |
118 |
+@@ -16,41 +17,35 @@ if (!("console" in window) || !("firebug" in console)) { |
119 |
+ for (var i = 0; i < names.length; ++i) |
120 |
+ window.console[names[i]] = function() {}; |
121 |
+ }; |
122 |
+- |
123 |
+- |
124 |
+-/** |
125 |
+- * Unwrap the first element that matches the given @expr@ from the targets and return them. |
126 |
+- */ |
127 |
+-$.fn.unwrap = function( expr ) { |
128 |
+- return this.each( function() { |
129 |
+- $(this).parents( expr ).eq( 0 ).after( this ).remove(); |
130 |
+- }); |
131 |
+-}; |
132 |
++*/ |
133 |
+ |
134 |
+ |
135 |
+ function showSource( e ) { |
136 |
+ var target = e.target; |
137 |
+- var codeSections = $(target). |
138 |
+- parents('.method-detail'). |
139 |
+- find('.method-source-code'); |
140 |
+- |
141 |
+- $(target). |
142 |
+- parents('.method-detail'). |
143 |
+- find('.method-source-code'). |
144 |
+- slideToggle(); |
145 |
++ while (!target.classList.contains('method-detail')) { |
146 |
++ target = target.parentNode; |
147 |
++ } |
148 |
++ if (typeof target !== "undefined" && target !== null) { |
149 |
++ target = target.querySelector('.method-source-code'); |
150 |
++ } |
151 |
++ if (typeof target !== "undefined" && target !== null) { |
152 |
++ target.classList.toggle('active-menu') |
153 |
++ } |
154 |
+ }; |
155 |
+ |
156 |
+ function hookSourceViews() { |
157 |
+- $('.method-heading').click( showSource ); |
158 |
++ document.querySelectorAll('.method-heading').forEach(function (codeObject) { |
159 |
++ codeObject.addEventListener('click', showSource); |
160 |
++ }); |
161 |
+ }; |
162 |
+ |
163 |
+ function hookSearch() { |
164 |
+- var input = $('#search-field').eq(0); |
165 |
+- var result = $('#search-results').eq(0); |
166 |
+- $(result).show(); |
167 |
++ var input = document.querySelector('#search-field'); |
168 |
++ var result = document.querySelector('#search-results'); |
169 |
++ result.classList.remove("initially-hidden"); |
170 |
+ |
171 |
+- var search_section = $('#search-section').get(0); |
172 |
+- $(search_section).show(); |
173 |
++ var search_section = document.querySelector('#search-section'); |
174 |
++ search_section.classList.remove("initially-hidden"); |
175 |
+ |
176 |
+ var search = new Search(search_data, input, result); |
177 |
+ |
178 |
+@@ -77,85 +72,14 @@ function hookSearch() { |
179 |
+ } |
180 |
+ |
181 |
+ search.select = function(result) { |
182 |
+- var result_element = result.get(0); |
183 |
+- window.location.href = result_element.firstChild.firstChild.href; |
184 |
++ console.log(result); |
185 |
++ window.location.href = result.firstChild.firstChild.href; |
186 |
+ } |
187 |
+ |
188 |
+ search.scrollIntoView = search.scrollInWindow; |
189 |
+ }; |
190 |
+ |
191 |
+-function highlightTarget( anchor ) { |
192 |
+- console.debug( "Highlighting target '%s'.", anchor ); |
193 |
+- |
194 |
+- $("a[name]").each( function() { |
195 |
+- if ( $(this).attr("name") == anchor ) { |
196 |
+- if ( !$(this).parent().parent().hasClass('target-section') ) { |
197 |
+- console.debug( "Wrapping the target-section" ); |
198 |
+- $('div.method-detail').unwrap( 'div.target-section' ); |
199 |
+- $(this).parent().wrap( '<div class="target-section"></div>' ); |
200 |
+- } else { |
201 |
+- console.debug( "Already wrapped." ); |
202 |
+- } |
203 |
+- } |
204 |
+- }); |
205 |
+-}; |
206 |
+- |
207 |
+-function highlightLocationTarget() { |
208 |
+- console.debug( "Location hash: %s", window.location.hash ); |
209 |
+- if ( ! window.location.hash || window.location.hash.length == 0 ) return; |
210 |
+- |
211 |
+- var anchor = window.location.hash.substring(1); |
212 |
+- console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" ); |
213 |
+- |
214 |
+- highlightTarget( anchor ); |
215 |
+-}; |
216 |
+- |
217 |
+-function highlightClickTarget( event ) { |
218 |
+- console.debug( "Highlighting click target for event %o", event.target ); |
219 |
+- try { |
220 |
+- var anchor = $(event.target).attr( 'href' ).substring(1); |
221 |
+- console.debug( "Found target anchor: %s", anchor ); |
222 |
+- highlightTarget( anchor ); |
223 |
+- } catch ( err ) { |
224 |
+- console.error( "Exception while highlighting: %o", err ); |
225 |
+- }; |
226 |
+-}; |
227 |
+- |
228 |
+-function loadAsync(path, success, prefix) { |
229 |
+- $.ajax({ |
230 |
+- url: prefix + path, |
231 |
+- dataType: 'script', |
232 |
+- success: success, |
233 |
+- cache: true |
234 |
+- }); |
235 |
+-}; |
236 |
+- |
237 |
+-$(document).ready( function() { |
238 |
++document.addEventListener('DOMContentLoaded', function() { |
239 |
+ hookSourceViews(); |
240 |
+- highlightLocationTarget(); |
241 |
+- $('ul.link-list a').bind( "click", highlightClickTarget ); |
242 |
+- |
243 |
+- var search_scripts_loaded = { |
244 |
+- navigation_loaded: false, |
245 |
+- search_loaded: false, |
246 |
+- search_index_loaded: false, |
247 |
+- searcher_loaded: false, |
248 |
+- } |
249 |
+- |
250 |
+- var search_success_function = function(variable) { |
251 |
+- return (function (data, status, xhr) { |
252 |
+- search_scripts_loaded[variable] = true; |
253 |
+- |
254 |
+- if (search_scripts_loaded['navigation_loaded'] == true && |
255 |
+- search_scripts_loaded['search_loaded'] == true && |
256 |
+- search_scripts_loaded['search_index_loaded'] == true && |
257 |
+- search_scripts_loaded['searcher_loaded'] == true) |
258 |
+- hookSearch(); |
259 |
+- }); |
260 |
+- } |
261 |
+- |
262 |
+- loadAsync('js/navigation.js', search_success_function('navigation_loaded'), rdoc_rel_prefix); |
263 |
+- loadAsync('js/search.js', search_success_function('search_loaded'), rdoc_rel_prefix); |
264 |
+- loadAsync('js/search_index.js', search_success_function('search_index_loaded'), index_rel_prefix); |
265 |
+- loadAsync('js/searcher.js', search_success_function('searcher_loaded'), rdoc_rel_prefix); |
266 |
++ hookSearch(); |
267 |
+ }); |
268 |
+diff --git a/lib/rdoc/generator/template/darkfish/js/search.js b/lib/rdoc/generator/template/darkfish/js/search.js |
269 |
+index 60ac295e6cec..b558ca5b4f68 100644 |
270 |
+--- a/lib/rdoc/generator/template/darkfish/js/search.js |
271 |
++++ b/lib/rdoc/generator/template/darkfish/js/search.js |
272 |
+@@ -1,29 +1,29 @@ |
273 |
+ Search = function(data, input, result) { |
274 |
+ this.data = data; |
275 |
+- this.$input = $(input); |
276 |
+- this.$result = $(result); |
277 |
++ this.input = input; |
278 |
++ this.result = result; |
279 |
+ |
280 |
+- this.$current = null; |
281 |
+- this.$view = this.$result.parent(); |
282 |
++ this.current = null; |
283 |
++ this.view = this.result.parentNode; |
284 |
+ this.searcher = new Searcher(data.index); |
285 |
+ this.init(); |
286 |
+ } |
287 |
+ |
288 |
+-Search.prototype = $.extend({}, Navigation, new function() { |
289 |
++Search.prototype = Object.assign({}, Navigation, new function() { |
290 |
+ var suid = 1; |
291 |
+ |
292 |
+ this.init = function() { |
293 |
+ var _this = this; |
294 |
+ var observer = function(e) { |
295 |
+- switch(e.originalEvent.keyCode) { |
296 |
++ switch(e.keyCode) { |
297 |
+ case 38: // Event.KEY_UP |
298 |
+ case 40: // Event.KEY_DOWN |
299 |
+ return; |
300 |
+ } |
301 |
+- _this.search(_this.$input[0].value); |
302 |
++ _this.search(_this.input.value); |
303 |
+ }; |
304 |
+- this.$input.keyup(observer); |
305 |
+- this.$input.click(observer); // mac's clear field |
306 |
++ this.input.addEventListener('keyup', observer); |
307 |
++ this.input.addEventListener('click', observer); // mac's clear field |
308 |
+ |
309 |
+ this.searcher.ready(function(results, isLast) { |
310 |
+ _this.addResults(results, isLast); |
311 |
+@@ -34,7 +34,7 @@ Search.prototype = $.extend({}, Navigation, new function() { |
312 |
+ } |
313 |
+ |
314 |
+ this.search = function(value, selectFirstMatch) { |
315 |
+- value = jQuery.trim(value).toLowerCase(); |
316 |
++ value = value.trim().toLowerCase(); |
317 |
+ if (value) { |
318 |
+ this.setNavigationActive(true); |
319 |
+ } else { |
320 |
+@@ -43,23 +43,23 @@ Search.prototype = $.extend({}, Navigation, new function() { |
321 |
+ |
322 |
+ if (value == '') { |
323 |
+ this.lastQuery = value; |
324 |
+- this.$result.empty(); |
325 |
+- this.$result.attr('aria-expanded', 'false'); |
326 |
++ this.result.innerHTML = ''; |
327 |
++ this.result.setAttribute('aria-expanded', 'false'); |
328 |
+ this.setNavigationActive(false); |
329 |
+ } else if (value != this.lastQuery) { |
330 |
+ this.lastQuery = value; |
331 |
+- this.$result.attr('aria-busy', 'true'); |
332 |
+- this.$result.attr('aria-expanded', 'true'); |
333 |
++ this.result.setAttribute('aria-busy', 'true'); |
334 |
++ this.result.setAttribute('aria-expanded', 'true'); |
335 |
+ this.firstRun = true; |
336 |
+ this.searcher.find(value); |
337 |
+ } |
338 |
+ } |
339 |
+ |
340 |
+ this.addResults = function(results, isLast) { |
341 |
+- var target = this.$result.get(0); |
342 |
++ var target = this.result; |
343 |
+ if (this.firstRun && (results.length > 0 || isLast)) { |
344 |
+- this.$current = null; |
345 |
+- this.$result.empty(); |
346 |
++ this.current = null; |
347 |
++ this.result.innerHTML = ''; |
348 |
+ } |
349 |
+ |
350 |
+ for (var i=0, l = results.length; i < l; i++) { |
351 |
+@@ -70,25 +70,26 @@ Search.prototype = $.extend({}, Navigation, new function() { |
352 |
+ |
353 |
+ if (this.firstRun && results.length > 0) { |
354 |
+ this.firstRun = false; |
355 |
+- this.$current = $(target.firstChild); |
356 |
+- this.$current.addClass('search-selected'); |
357 |
++ this.current = target.firstChild; |
358 |
++ this.current.classList.add('search-selected'); |
359 |
+ } |
360 |
+- if (jQuery.browser.msie) this.$element[0].className += ''; |
361 |
++ //TODO: ECMAScript |
362 |
++ //if (jQuery.browser.msie) this.$element[0].className += ''; |
363 |
+ |
364 |
+- if (isLast) this.$result.attr('aria-busy', 'false'); |
365 |
++ if (isLast) this.result.setAttribute('aria-busy', 'false'); |
366 |
+ } |
367 |
+ |
368 |
+ this.move = function(isDown) { |
369 |
+- if (!this.$current) return; |
370 |
+- var $next = this.$current[isDown ? 'next' : 'prev'](); |
371 |
+- if ($next.length) { |
372 |
+- this.$current.removeClass('search-selected'); |
373 |
+- $next.addClass('search-selected'); |
374 |
+- this.$input.attr('aria-activedescendant', $next.attr('id')); |
375 |
+- this.scrollIntoView($next[0], this.$view[0]); |
376 |
+- this.$current = $next; |
377 |
+- this.$input.val($next[0].firstChild.firstChild.text); |
378 |
+- this.$input.select(); |
379 |
++ if (!this.current) return; |
380 |
++ var next = isDown ? this.current.nextElementSibling : this.current.previousElementSibling; |
381 |
++ if (next) { |
382 |
++ this.current.classList.remove('search-selected'); |
383 |
++ next.classList.add('search-selected'); |
384 |
++ this.input.setAttribute('aria-activedescendant', next.getAttribute('id')); |
385 |
++ this.scrollIntoView(next, this.view); |
386 |
++ this.current = next; |
387 |
++ this.input.value = next.firstChild.firstChild.text; |
388 |
++ this.input.select(); |
389 |
+ } |
390 |
+ return true; |
391 |
+ } |
392 |
+diff --git a/lib/rdoc/generator/template/json_index/js/navigation.js b/lib/rdoc/generator/template/json_index/js/navigation.js |
393 |
+index e41268123ea9..4866fff81922 100644 |
394 |
+--- a/lib/rdoc/generator/template/json_index/js/navigation.js |
395 |
++++ b/lib/rdoc/generator/template/json_index/js/navigation.js |
396 |
+@@ -10,10 +10,8 @@ Navigation = new function() { |
397 |
+ this.initNavigation = function() { |
398 |
+ var _this = this; |
399 |
+ |
400 |
+- $(document).keydown(function(e) { |
401 |
++ document.addEventListener('keydown', function(e) { |
402 |
+ _this.onkeydown(e); |
403 |
+- }).keyup(function(e) { |
404 |
+- _this.onkeyup(e); |
405 |
+ }); |
406 |
+ |
407 |
+ this.navigationActive = true; |
408 |
+@@ -21,20 +19,6 @@ Navigation = new function() { |
409 |
+ |
410 |
+ this.setNavigationActive = function(state) { |
411 |
+ this.navigationActive = state; |
412 |
+- this.clearMoveTimeout(); |
413 |
+- } |
414 |
+- |
415 |
+- this.onkeyup = function(e) { |
416 |
+- if (!this.navigationActive) return; |
417 |
+- |
418 |
+- switch(e.keyCode) { |
419 |
+- case 37: //Event.KEY_LEFT: |
420 |
+- case 38: //Event.KEY_UP: |
421 |
+- case 39: //Event.KEY_RIGHT: |
422 |
+- case 40: //Event.KEY_DOWN: |
423 |
+- this.clearMoveTimeout(); |
424 |
+- break; |
425 |
+- } |
426 |
+ } |
427 |
+ |
428 |
+ this.onkeydown = function(e) { |
429 |
+@@ -46,7 +30,6 @@ Navigation = new function() { |
430 |
+ case 38: //Event.KEY_UP: |
431 |
+ if (e.keyCode == 38 || e.ctrlKey) { |
432 |
+ if (this.moveUp()) e.preventDefault(); |
433 |
+- this.startMoveTimeout(false); |
434 |
+ } |
435 |
+ break; |
436 |
+ case 39: //Event.KEY_RIGHT: |
437 |
+@@ -55,34 +38,15 @@ Navigation = new function() { |
438 |
+ case 40: //Event.KEY_DOWN: |
439 |
+ if (e.keyCode == 40 || e.ctrlKey) { |
440 |
+ if (this.moveDown()) e.preventDefault(); |
441 |
+- this.startMoveTimeout(true); |
442 |
+ } |
443 |
+ break; |
444 |
+ case 13: //Event.KEY_RETURN: |
445 |
+- if (this.$current) |
446 |
++ if (this.current) |
447 |
+ e.preventDefault(); |
448 |
+- this.select(this.$current); |
449 |
++ this.select(this.current); |
450 |
+ break; |
451 |
+ } |
452 |
+- if (e.ctrlKey && e.shiftKey) this.select(this.$current); |
453 |
+- } |
454 |
+- |
455 |
+- this.clearMoveTimeout = function() { |
456 |
+- clearTimeout(this.moveTimeout); |
457 |
+- this.moveTimeout = null; |
458 |
+- } |
459 |
+- |
460 |
+- this.startMoveTimeout = function(isDown) { |
461 |
+- if (!$.browser.mozilla && !$.browser.opera) return; |
462 |
+- if (this.moveTimeout) this.clearMoveTimeout(); |
463 |
+- var _this = this; |
464 |
+- |
465 |
+- var go = function() { |
466 |
+- if (!_this.moveTimeout) return; |
467 |
+- _this[isDown ? 'moveDown' : 'moveUp'](); |
468 |
+- _this.moveTimout = setTimeout(go, 100); |
469 |
+- } |
470 |
+- this.moveTimeout = setTimeout(go, 200); |
471 |
++ if (e.ctrlKey && e.shiftKey) this.select(this.current); |
472 |
+ } |
473 |
+ |
474 |
+ this.moveRight = function() { |
475 |
+diff --git a/lib/rdoc/generator/template/json_index/js/searcher.js b/lib/rdoc/generator/template/json_index/js/searcher.js |
476 |
+index b3b1c58a0f38..e200a168b0f7 100644 |
477 |
+--- a/lib/rdoc/generator/template/json_index/js/searcher.js |
478 |
++++ b/lib/rdoc/generator/template/json_index/js/searcher.js |
479 |
+@@ -51,20 +51,20 @@ Searcher.prototype = new function() { |
480 |
+ |
481 |
+ /* ----- Utilities ------ */ |
482 |
+ function splitQuery(query) { |
483 |
+- return jQuery.grep(query.split(/(\s+|::?|\(\)?)/), function(string) { |
484 |
++ return query.split(/(\s+|::?|\(\)?)/).filter(function(string) { |
485 |
+ return string.match(/\S/); |
486 |
+ }); |
487 |
+ } |
488 |
+ |
489 |
+ function buildRegexps(queries) { |
490 |
+- return jQuery.map(queries, function(query) { |
491 |
++ return queries.map(function(query) { |
492 |
+ return new RegExp(query.replace(/(.)/g, '([$1])([^$1]*?)'), 'i'); |
493 |
+ }); |
494 |
+ } |
495 |
+ |
496 |
+ function buildHilighters(queries) { |
497 |
+- return jQuery.map(queries, function(query) { |
498 |
+- return jQuery.map(query.split(''), function(l, i) { |
499 |
++ return queries.map(function(query) { |
500 |
++ return query.split('').map(function(l, i) { |
501 |
+ return '\u0001$' + (i*2+1) + '\u0002$' + (i*2+2); |
502 |
+ }).join(''); |
503 |
+ }); |
504 |
+@@ -221,9 +221,9 @@ Searcher.prototype = new function() { |
505 |
+ } |
506 |
+ |
507 |
+ function triggerResults(results, isLast) { |
508 |
+- jQuery.each(this.handlers, function(i, fn) { |
509 |
++ this.handlers.forEach(function(fn) { |
510 |
+ fn.call(this, results, isLast) |
511 |
+- }) |
512 |
++ }); |
513 |
+ } |
514 |
+ } |
515 |
|
516 |
diff --git a/dev-ruby/rdoc/rdoc-5.1.0-r1.ebuild b/dev-ruby/rdoc/rdoc-5.1.0-r1.ebuild |
517 |
new file mode 100644 |
518 |
index 00000000000..2b5d676f131 |
519 |
--- /dev/null |
520 |
+++ b/dev-ruby/rdoc/rdoc-5.1.0-r1.ebuild |
521 |
@@ -0,0 +1,98 @@ |
522 |
+# Copyright 1999-2019 Gentoo Authors |
523 |
+# Distributed under the terms of the GNU General Public License v2 |
524 |
+ |
525 |
+EAPI=5 |
526 |
+USE_RUBY="ruby24" |
527 |
+ |
528 |
+RUBY_FAKEGEM_TASK_DOC="" |
529 |
+RUBY_FAKEGEM_DOCDIR="doc" |
530 |
+RUBY_FAKEGEM_EXTRADOC="History.rdoc README.rdoc RI.rdoc TODO.rdoc" |
531 |
+ |
532 |
+RUBY_FAKEGEM_BINWRAP="" |
533 |
+RUBY_FAKEGEM_BINDIR="exe" |
534 |
+ |
535 |
+inherit ruby-fakegem eutils |
536 |
+ |
537 |
+DESCRIPTION="An extended version of the RDoc library from Ruby 1.8" |
538 |
+HOMEPAGE="https://github.com/rdoc/rdoc/" |
539 |
+SRC_URI="https://github.com/rdoc/rdoc/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
540 |
+ |
541 |
+LICENSE="Ruby MIT" |
542 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
543 |
+SLOT="0" |
544 |
+IUSE="" |
545 |
+ |
546 |
+RDEPEND+=">=app-eselect/eselect-ruby-20161226" |
547 |
+ |
548 |
+RUBY_PATCHES=( "${FILESDIR}/${P}-jquery.patch" ) |
549 |
+ |
550 |
+ruby_add_bdepend " |
551 |
+ dev-ruby/kpeg |
552 |
+ dev-ruby/racc |
553 |
+ test? ( |
554 |
+ dev-ruby/bundler |
555 |
+ >=dev-ruby/minitest-5.8:5 |
556 |
+ )" |
557 |
+ |
558 |
+ruby_add_rdepend "dev-ruby/json:2" |
559 |
+ |
560 |
+all_ruby_prepare() { |
561 |
+ # Other packages also have use for a nonexistent directory, bug 321059 |
562 |
+ sed -i -e 's#/nonexistent#/nonexistent_rdoc_tests#g' test/test_rdoc*.rb || die |
563 |
+ |
564 |
+ # Avoid unneeded dependency on bundler, bug 603696 |
565 |
+ sed -i -e '/bundler/ s:^:#:' \ |
566 |
+ -e 's/Bundler::GemHelper.gemspec.full_name/"rdoc"/' Rakefile || die |
567 |
+ |
568 |
+ # Remove test that is depending on the locale, which we can't garantuee. |
569 |
+ sed -i -e '/def test_encode_with/,/^ end/ s:^:#:' test/test_rdoc_options.rb || die |
570 |
+ |
571 |
+ # Remove test depending on FEATURES=userpriv, bug 361959 |
572 |
+ sed -i -e '/def test_check_files/,/^ end/ s:^:#:' test/test_rdoc_options.rb || die |
573 |
+ |
574 |
+ # Remove tests for code that is not included and not listed in Manifest.txt |
575 |
+ rm -f test/test_rdoc_i18n_{locale,text}.rb \ |
576 |
+ test/test_rdoc_generator_pot* || die |
577 |
+ |
578 |
+ # Removal is not included in the upstream patch |
579 |
+ rm -f lib/rdoc/generator/template/darkfish/js/jquery.js || die |
580 |
+} |
581 |
+ |
582 |
+all_ruby_compile() { |
583 |
+ all_fakegem_compile |
584 |
+ |
585 |
+ if use doc ; then |
586 |
+ ruby -Ilib -S exe/rdoc || die |
587 |
+ fi |
588 |
+} |
589 |
+ |
590 |
+each_ruby_compile() { |
591 |
+ ${RUBY} -S rake generate || die |
592 |
+} |
593 |
+ |
594 |
+each_ruby_test() { |
595 |
+ ${RUBY} -Ilib:. -e 'gem "json", "~>2.0"; Dir["test/test_*.rb"].each{|f| require f}' || die |
596 |
+} |
597 |
+ |
598 |
+all_ruby_install() { |
599 |
+ all_fakegem_install |
600 |
+ |
601 |
+ for bin in rdoc ri; do |
602 |
+ ruby_fakegem_binwrapper $bin /usr/bin/$bin-2 |
603 |
+ |
604 |
+ for version in $(ruby_get_use_implementations); do |
605 |
+ version=`echo ${version} | cut -c 5-` |
606 |
+ if use ruby_targets_ruby${version}; then |
607 |
+ ruby_fakegem_binwrapper $bin /usr/bin/${bin}${version} |
608 |
+ sed -i -e "1s/env ruby/ruby${version}/" \ |
609 |
+ "${ED}/usr/bin/${bin}${version}" || die |
610 |
+ fi |
611 |
+ done |
612 |
+ done |
613 |
+} |
614 |
+ |
615 |
+pkg_postinst() { |
616 |
+ if [[ ! -n $(readlink "${ROOT}"usr/bin/rdoc) ]] ; then |
617 |
+ eselect ruby set $(eselect --brief --colour=no ruby show | head -n1) |
618 |
+ fi |
619 |
+} |