yard 0.9.37 → 0.9.41

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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +52 -1
  3. data/README.md +27 -30
  4. data/docs/GettingStarted.md +41 -15
  5. data/docs/Tags.md +5 -5
  6. data/docs/Templates.md +5 -4
  7. data/docs/WhatsNew.md +59 -7
  8. data/docs/templates/default/yard_tags/html/setup.rb +1 -1
  9. data/lib/yard/autoload.rb +17 -0
  10. data/lib/yard/cli/diff.rb +7 -2
  11. data/lib/yard/code_objects/base.rb +1 -1
  12. data/lib/yard/code_objects/extra_file_object.rb +1 -0
  13. data/lib/yard/code_objects/proxy.rb +1 -1
  14. data/lib/yard/handlers/base.rb +23 -1
  15. data/lib/yard/handlers/processor.rb +1 -0
  16. data/lib/yard/handlers/rbs/attribute_handler.rb +43 -0
  17. data/lib/yard/handlers/rbs/base.rb +38 -0
  18. data/lib/yard/handlers/rbs/constant_handler.rb +18 -0
  19. data/lib/yard/handlers/rbs/method_handler.rb +327 -0
  20. data/lib/yard/handlers/rbs/mixin_handler.rb +20 -0
  21. data/lib/yard/handlers/rbs/namespace_handler.rb +26 -0
  22. data/lib/yard/handlers/ruby/attribute_handler.rb +7 -4
  23. data/lib/yard/handlers/ruby/constant_handler.rb +24 -6
  24. data/lib/yard/handlers/ruby/legacy/visibility_handler.rb +2 -1
  25. data/lib/yard/handlers/ruby/visibility_handler.rb +1 -0
  26. data/lib/yard/i18n/locale.rb +1 -1
  27. data/lib/yard/i18n/pot_generator.rb +1 -1
  28. data/lib/yard/parser/rbs/rbs_parser.rb +325 -0
  29. data/lib/yard/parser/rbs/statement.rb +75 -0
  30. data/lib/yard/parser/ruby/ast_node.rb +5 -4
  31. data/lib/yard/parser/ruby/legacy/irb/slex.rb +19 -1
  32. data/lib/yard/parser/ruby/legacy/ruby_lex.rb +1 -1
  33. data/lib/yard/parser/ruby/ruby_parser.rb +109 -24
  34. data/lib/yard/parser/source_parser.rb +3 -2
  35. data/lib/yard/registry_resolver.rb +7 -0
  36. data/lib/yard/rubygems/specification.rb +1 -1
  37. data/lib/yard/server/library_version.rb +1 -1
  38. data/lib/yard/server/templates/default/fulldoc/html/js/autocomplete.js +208 -12
  39. data/lib/yard/server/templates/default/layout/html/breadcrumb.erb +1 -17
  40. data/lib/yard/server/templates/default/method_details/html/permalink.erb +4 -2
  41. data/lib/yard/server/templates/doc_server/library_list/html/headers.erb +3 -3
  42. data/lib/yard/server/templates/doc_server/library_list/html/library_list.erb +2 -3
  43. data/lib/yard/server/templates/doc_server/processing/html/processing.erb +22 -16
  44. data/lib/yard/tags/directives.rb +7 -0
  45. data/lib/yard/tags/library.rb +3 -3
  46. data/lib/yard/tags/overload_tag.rb +2 -1
  47. data/lib/yard/tags/tag.rb +1 -1
  48. data/lib/yard/tags/types_explainer.rb +5 -4
  49. data/lib/yard/templates/helpers/base_helper.rb +1 -1
  50. data/lib/yard/templates/helpers/html_helper.rb +21 -6
  51. data/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +6 -1
  52. data/lib/yard/templates/helpers/markup/hybrid_markdown.rb +2147 -0
  53. data/lib/yard/templates/helpers/markup/rdoc_markup.rb +2 -0
  54. data/lib/yard/templates/helpers/markup_helper.rb +4 -2
  55. data/lib/yard/version.rb +1 -1
  56. data/po/ja.po +82 -82
  57. data/templates/default/fulldoc/html/css/style.css +33 -15
  58. data/templates/default/fulldoc/html/full_list.erb +4 -4
  59. data/templates/default/fulldoc/html/js/app.js +567 -271
  60. data/templates/default/fulldoc/html/js/full_list.js +341 -211
  61. data/templates/default/layout/html/headers.erb +1 -1
  62. data/templates/default/layout/html/layout.erb +2 -1
  63. data/templates/default/method/html/header.erb +3 -3
  64. data/templates/default/module/html/defines.erb +3 -3
  65. data/templates/default/module/html/inherited_methods.erb +1 -0
  66. data/templates/default/module/html/method_summary.erb +8 -0
  67. data/templates/default/module/setup.rb +20 -0
  68. data/templates/default/onefile/html/layout.erb +3 -4
  69. data/templates/guide/fulldoc/html/js/app.js +57 -26
  70. data/templates/guide/layout/html/layout.erb +9 -11
  71. metadata +18 -8
@@ -1,242 +1,372 @@
1
1
  (function() {
2
+ var clicked = null;
3
+ var searchTimeout = null;
4
+ var searchCache = [];
5
+ var caseSensitiveMatch = false;
6
+ var ignoreKeyCodeMin = 8;
7
+ var ignoreKeyCodeMax = 46;
8
+ var commandKey = 91;
2
9
 
3
- var $clicked = $(null);
4
- var searchTimeout = null;
5
- var searchCache = [];
6
- var caseSensitiveMatch = false;
7
- var ignoreKeyCodeMin = 8;
8
- var ignoreKeyCodeMax = 46;
9
- var commandKey = 91;
10
+ function query(selector, root) {
11
+ return (root || document).querySelector(selector);
12
+ }
13
+
14
+ function queryAll(selector, root) {
15
+ return Array.prototype.slice.call(
16
+ (root || document).querySelectorAll(selector)
17
+ );
18
+ }
19
+
20
+ function isVisible(element) {
21
+ if (!element) return false;
22
+ if (window.getComputedStyle(element).display === "none") return false;
23
+ if (element.parentElement && element.parentElement !== document.body) {
24
+ return isVisible(element.parentElement);
25
+ }
26
+ return true;
27
+ }
10
28
 
11
- RegExp.escape = function(text) {
29
+ RegExp.escape = function(text) {
12
30
  return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
13
- }
31
+ };
14
32
 
15
- function escapeShortcut() {
16
- $(document).keydown(function(evt) {
17
- if (evt.which == 27) {
18
- window.parent.postMessage('navEscape', '*');
33
+ function ready(callback) {
34
+ if (document.readyState === "loading") {
35
+ document.addEventListener("DOMContentLoaded", callback, { once: true });
36
+ } else {
37
+ callback();
19
38
  }
20
- });
21
- }
22
-
23
- function navResizer() {
24
- $(window).mousemove(function(e) {
25
- window.parent.postMessage({
26
- action: 'mousemove', event: {pageX: e.pageX, which: e.which}
27
- }, '*');
28
- }).mouseup(function(e) {
29
- window.parent.postMessage({action: 'mouseup'}, '*');
30
- });
31
- window.parent.postMessage("navReady", "*");
32
- }
33
-
34
- function clearSearchTimeout() {
35
- clearTimeout(searchTimeout);
36
- searchTimeout = null;
37
- }
38
-
39
- function enableLinks() {
40
- // load the target page in the parent window
41
- $('#full_list li').on('click', function(evt) {
42
- $('#full_list li').removeClass('clicked');
43
- $clicked = $(this);
44
- $clicked.addClass('clicked');
45
- evt.stopPropagation();
46
-
47
- if (evt.target.tagName === 'A') return true;
48
-
49
- var elem = $clicked.find('> .item .object_link a')[0];
50
- var e = evt.originalEvent;
51
- var newEvent = new MouseEvent(evt.originalEvent.type);
52
- newEvent.initMouseEvent(e.type, e.canBubble, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);
53
- elem.dispatchEvent(newEvent);
54
- evt.preventDefault();
55
- return false;
56
- });
57
- }
58
-
59
- function enableToggles() {
60
- // show/hide nested classes on toggle click
61
- $('#full_list a.toggle').on('click', function(evt) {
62
- evt.stopPropagation();
63
- evt.preventDefault();
64
- $(this).parent().parent().toggleClass('collapsed');
65
- $(this).attr('aria-expanded', function (i, attr) {
66
- return attr == 'true' ? 'false' : 'true'
39
+ }
40
+
41
+ function escapeShortcut() {
42
+ document.addEventListener("keydown", function(event) {
43
+ if (event.key === "Escape") {
44
+ window.parent.postMessage("navEscape", "*");
45
+ }
46
+ });
47
+ }
48
+
49
+ function clearSearchTimeout() {
50
+ clearTimeout(searchTimeout);
51
+ searchTimeout = null;
52
+ }
53
+
54
+ function setClicked(item) {
55
+ queryAll("#full_list li.clicked").forEach(function(node) {
56
+ node.classList.remove("clicked");
67
57
  });
58
+ clicked = item;
59
+ if (clicked) clicked.classList.add("clicked");
60
+ }
61
+
62
+ function pathForItem(item) {
63
+ if (!item || !item.id || item.id.indexOf("object_") !== 0) return null;
64
+ return item.id.substring("object_".length);
65
+ }
66
+
67
+ function enableLinks() {
68
+ queryAll("#full_list li").forEach(function(item) {
69
+ var itemRow = item.querySelector(":scope > .item");
70
+
71
+ if (!itemRow) return;
72
+
73
+ itemRow.addEventListener("click", function(event) {
74
+ var targetLink;
75
+ var mouseEvent;
76
+ var url;
77
+
78
+ if (
79
+ event.defaultPrevented ||
80
+ event.button !== 0 ||
81
+ event.metaKey ||
82
+ event.ctrlKey ||
83
+ event.shiftKey ||
84
+ event.altKey
85
+ ) {
86
+ return true;
87
+ }
88
+
89
+ setClicked(item);
90
+ event.stopPropagation();
91
+ targetLink = event.target.closest("a");
92
+
93
+ if (window.origin === "null") {
94
+ if (targetLink) return true;
95
+
96
+ targetLink = item.querySelector(":scope > .item .object_link a");
97
+ if (!targetLink) return false;
98
+ mouseEvent = new MouseEvent("click", {
99
+ bubbles: true,
100
+ cancelable: true,
101
+ view: event.view || window,
102
+ detail: event.detail,
103
+ screenX: event.screenX,
104
+ screenY: event.screenY,
105
+ clientX: event.clientX,
106
+ clientY: event.clientY,
107
+ ctrlKey: event.ctrlKey,
108
+ shiftKey: event.shiftKey,
109
+ altKey: event.altKey,
110
+ metaKey: event.metaKey,
111
+ button: event.button,
112
+ buttons: event.buttons,
113
+ relatedTarget: event.relatedTarget
114
+ });
115
+ targetLink.dispatchEvent(mouseEvent);
116
+ event.preventDefault();
117
+ } else {
118
+ if (!targetLink || !targetLink.matches(".object_link a")) {
119
+ targetLink = item.querySelector(":scope > .item .object_link a");
120
+ }
121
+ if (!targetLink) return false;
122
+
123
+ event.preventDefault();
124
+ url = targetLink.getAttribute("href");
125
+ try {
126
+ url = new URL(url, window.location.href).href;
127
+ } catch (error) {}
128
+ window.top.postMessage(
129
+ { action: "navigate", url: url, path: pathForItem(item) },
130
+ "*"
131
+ );
132
+ }
133
+ return false;
134
+ });
135
+ });
136
+ }
137
+
138
+ function toggleItem(toggle) {
139
+ var item = toggle.parentElement.parentElement;
140
+ var expanded = item.classList.contains("collapsed");
141
+
142
+ item.classList.toggle("collapsed");
143
+ toggle.setAttribute("aria-expanded", expanded ? "true" : "false");
68
144
  highlight();
69
- });
145
+ }
70
146
 
71
- // navigation of nested classes using keyboard
72
- $('#full_list a.toggle').on('keypress',function(evt) {
73
- // enter key is pressed
74
- if (evt.which == 13) {
75
- evt.stopPropagation();
76
- evt.preventDefault();
77
- $(this).parent().parent().toggleClass('collapsed');
78
- $(this).attr('aria-expanded', function (i, attr) {
79
- return attr == 'true' ? 'false' : 'true'
147
+ function enableToggles() {
148
+ queryAll("#full_list a.toggle").forEach(function(toggle) {
149
+ toggle.addEventListener("click", function(event) {
150
+ event.stopPropagation();
151
+ event.preventDefault();
152
+ toggleItem(toggle);
80
153
  });
81
- highlight();
82
- }
83
- });
84
- }
85
154
 
86
- function populateSearchCache() {
87
- $('#full_list li .item').each(function() {
88
- var $node = $(this);
89
- var $link = $node.find('.object_link a');
90
- if ($link.length > 0) {
155
+ toggle.addEventListener("keypress", function(event) {
156
+ if (event.key !== "Enter") return;
157
+ event.stopPropagation();
158
+ event.preventDefault();
159
+ toggleItem(toggle);
160
+ });
161
+ });
162
+ }
163
+
164
+ function populateSearchCache() {
165
+ queryAll("#full_list li .item").forEach(function(node) {
166
+ var link = query(".object_link a", node);
167
+ if (!link) return;
168
+
91
169
  searchCache.push({
92
- node: $node,
93
- link: $link,
94
- name: $link.text(),
95
- fullName: $link.attr('title').split(' ')[0]
170
+ node: node,
171
+ link: link,
172
+ name: link.textContent,
173
+ fullName: link.getAttribute("title").split(" ")[0]
96
174
  });
175
+ });
176
+ }
177
+
178
+ function enableSearch() {
179
+ var input = query("#search input");
180
+ var fullList = query("#full_list");
181
+
182
+ if (!input || !fullList) return;
183
+
184
+ input.addEventListener("keyup", function(event) {
185
+ if (ignoredKeyPress(event)) return;
186
+ if (input.value === "") {
187
+ clearSearch();
188
+ } else {
189
+ performSearch(input.value);
190
+ }
191
+ });
192
+
193
+ fullList.insertAdjacentHTML(
194
+ "afterend",
195
+ "<div id='noresults' role='status' style='display: none'></div>"
196
+ );
197
+ }
198
+
199
+ function ignoredKeyPress(event) {
200
+ return (
201
+ (event.keyCode > ignoreKeyCodeMin && event.keyCode < ignoreKeyCodeMax) ||
202
+ event.keyCode === commandKey
203
+ );
204
+ }
205
+
206
+ function clearSearch() {
207
+ clearSearchTimeout();
208
+ queryAll("#full_list .found").forEach(function(node) {
209
+ var link = query(".object_link a", node);
210
+ node.classList.remove("found");
211
+ link.textContent = link.textContent;
212
+ });
213
+ query("#full_list").classList.remove("insearch");
214
+ query("#content").classList.remove("insearch");
215
+ if (clicked) {
216
+ var current = clicked.parentElement;
217
+ while (current) {
218
+ if (current.tagName === "LI") current.classList.remove("collapsed");
219
+ if (current.id === "full_list") break;
220
+ current = current.parentElement;
221
+ }
97
222
  }
98
- });
99
- }
223
+ highlight();
224
+ }
225
+
226
+ function performSearch(searchString) {
227
+ clearSearchTimeout();
228
+ query("#full_list").classList.add("insearch");
229
+ query("#content").classList.add("insearch");
230
+ query("#noresults").textContent = "";
231
+ query("#noresults").style.display = "none";
232
+ partialSearch(searchString, 0);
233
+ }
100
234
 
101
- function enableSearch() {
102
- $('#search input').keyup(function(event) {
103
- if (ignoredKeyPress(event)) return;
104
- if (this.value === "") {
105
- clearSearch();
235
+ function partialSearch(searchString, offset) {
236
+ var lastRowClass = "";
237
+ var i;
238
+
239
+ for (i = offset; i < Math.min(offset + 50, searchCache.length); i += 1) {
240
+ var item = searchCache[i];
241
+ var searchName =
242
+ searchString.indexOf("::") !== -1 ? item.fullName : item.name;
243
+ var matchRegexp = new RegExp(
244
+ buildMatchString(searchString),
245
+ caseSensitiveMatch ? "" : "i"
246
+ );
247
+
248
+ if (!searchName.match(matchRegexp)) {
249
+ item.node.classList.remove("found");
250
+ item.link.textContent = item.link.textContent;
251
+ } else {
252
+ item.node.classList.add("found");
253
+ if (lastRowClass) item.node.classList.remove(lastRowClass);
254
+ item.node.classList.add(lastRowClass === "r1" ? "r2" : "r1");
255
+ lastRowClass = item.node.classList.contains("r1") ? "r1" : "r2";
256
+ item.link.innerHTML = item.name.replace(matchRegexp, "<strong>$&</strong>");
257
+ }
258
+ }
259
+
260
+ if (i === searchCache.length) {
261
+ searchDone();
106
262
  } else {
107
- performSearch(this.value);
263
+ searchTimeout = setTimeout(function() {
264
+ partialSearch(searchString, i);
265
+ }, 0);
108
266
  }
109
- });
267
+ }
110
268
 
111
- $('#full_list').after("<div id='noresults' role='status' style='display: none'></div>");
112
- }
269
+ function searchDone() {
270
+ var found = queryAll("#full_list li").filter(isVisible).length;
113
271
 
114
- function ignoredKeyPress(event) {
115
- if (
116
- (event.keyCode > ignoreKeyCodeMin && event.keyCode < ignoreKeyCodeMax) ||
117
- (event.keyCode == commandKey)
118
- ) {
119
- return true;
120
- } else {
121
- return false;
122
- }
123
- }
272
+ searchTimeout = null;
273
+ highlight();
124
274
 
125
- function clearSearch() {
126
- clearSearchTimeout();
127
- $('#full_list .found').removeClass('found').each(function() {
128
- var $link = $(this).find('.object_link a');
129
- $link.text($link.text());
130
- });
131
- $('#full_list, #content').removeClass('insearch');
132
- $clicked.parents().removeClass('collapsed');
133
- highlight();
134
- }
135
-
136
- function performSearch(searchString) {
137
- clearSearchTimeout();
138
- $('#full_list, #content').addClass('insearch');
139
- $('#noresults').text('').hide();
140
- partialSearch(searchString, 0);
141
- }
142
-
143
- function partialSearch(searchString, offset) {
144
- var lastRowClass = '';
145
- var i = null;
146
- for (i = offset; i < Math.min(offset + 50, searchCache.length); i++) {
147
- var item = searchCache[i];
148
- var searchName = (searchString.indexOf('::') != -1 ? item.fullName : item.name);
149
- var matchString = buildMatchString(searchString);
150
- var matchRegexp = new RegExp(matchString, caseSensitiveMatch ? "" : "i");
151
- if (searchName.match(matchRegexp) == null) {
152
- item.node.removeClass('found');
153
- item.link.text(item.link.text());
275
+ if (found === 0) {
276
+ query("#noresults").textContent = "No results were found.";
277
+ } else {
278
+ query("#noresults").textContent = "There are " + found + " results.";
154
279
  }
155
- else {
156
- item.node.addClass('found');
157
- item.node.removeClass(lastRowClass).addClass(lastRowClass == 'r1' ? 'r2' : 'r1');
158
- lastRowClass = item.node.hasClass('r1') ? 'r1' : 'r2';
159
- item.link.html(item.name.replace(matchRegexp, "<strong>$&</strong>"));
280
+ query("#noresults").style.display = "block";
281
+ query("#content").classList.remove("insearch");
282
+ }
283
+
284
+ function buildMatchString(searchString) {
285
+ var regexSearchString;
286
+
287
+ caseSensitiveMatch = /[A-Z]/.test(searchString);
288
+ regexSearchString = RegExp.escape(searchString);
289
+ if (caseSensitiveMatch) {
290
+ regexSearchString +=
291
+ "|" +
292
+ searchString
293
+ .split("")
294
+ .map(function(character) {
295
+ return RegExp.escape(character);
296
+ })
297
+ .join(".+?");
160
298
  }
299
+ return regexSearchString;
161
300
  }
162
- if(i == searchCache.length) {
163
- searchDone();
164
- } else {
165
- searchTimeout = setTimeout(function() {
166
- partialSearch(searchString, i);
167
- }, 0);
168
- }
169
- }
170
-
171
- function searchDone() {
172
- searchTimeout = null;
173
- highlight();
174
- var found = $('#full_list li:visible').size();
175
- if (found === 0) {
176
- $('#noresults').text('No results were found.');
177
- } else {
178
- // This is read out to screen readers
179
- $('#noresults').text('There are ' + found + ' results.');
180
- }
181
- $('#noresults').show();
182
- $('#content').removeClass('insearch');
183
- }
184
-
185
- function buildMatchString(searchString, event) {
186
- caseSensitiveMatch = searchString.match(/[A-Z]/) != null;
187
- var regexSearchString = RegExp.escape(searchString);
188
- if (caseSensitiveMatch) {
189
- regexSearchString += "|" +
190
- $.map(searchString.split(''), function(e) { return RegExp.escape(e); }).
191
- join('.+?');
192
- }
193
- return regexSearchString;
194
- }
195
-
196
- function highlight() {
197
- $('#full_list li:visible').each(function(n) {
198
- $(this).removeClass('even odd').addClass(n % 2 == 0 ? 'odd' : 'even');
199
- });
200
- }
201
-
202
- /**
203
- * Expands the tree to the target element and its immediate
204
- * children.
205
- */
206
- function expandTo(path) {
207
- var $target = $(document.getElementById('object_' + path));
208
- $target.addClass('clicked');
209
- $target.removeClass('collapsed');
210
- $target.parentsUntil('#full_list', 'li').removeClass('collapsed');
211
-
212
- $target.find('a.toggle').attr('aria-expanded', 'true')
213
- $target.parentsUntil('#full_list', 'li').each(function(i, el) {
214
- $(el).find('> div > a.toggle').attr('aria-expanded', 'true');
215
- });
216
301
 
217
- if($target[0]) {
218
- window.scrollTo(window.scrollX, $target.offset().top - 250);
219
- highlight();
302
+ function highlight() {
303
+ queryAll("#full_list li")
304
+ .filter(isVisible)
305
+ .forEach(function(item, index) {
306
+ item.classList.remove("even");
307
+ item.classList.remove("odd");
308
+ item.classList.add(index % 2 === 0 ? "odd" : "even");
309
+ });
310
+ }
311
+
312
+ function isInView(element) {
313
+ var rect = element.getBoundingClientRect();
314
+ var windowHeight =
315
+ window.innerHeight || document.documentElement.clientHeight;
316
+ return rect.left >= 0 && rect.bottom <= windowHeight;
220
317
  }
221
- }
222
318
 
223
- function windowEvents(event) {
224
- var msg = event.data;
225
- if (msg.action === "expand") {
226
- expandTo(msg.path);
319
+ function expandTo(path) {
320
+ var target = document.getElementById("object_" + path);
321
+
322
+ if (!target) return;
323
+
324
+ setClicked(target);
325
+ target.classList.remove("collapsed");
326
+
327
+ var current = target.parentElement;
328
+ while (current && current.id !== "full_list") {
329
+ if (current.tagName === "LI") current.classList.remove("collapsed");
330
+ current = current.parentElement;
331
+ }
332
+
333
+ queryAll("a.toggle", target).forEach(function(toggle) {
334
+ toggle.setAttribute("aria-expanded", "true");
335
+ });
336
+
337
+ current = target.parentElement;
338
+ while (current && current.id !== "full_list") {
339
+ if (current.tagName === "LI") {
340
+ var toggle = current.querySelector(":scope > div > a.toggle");
341
+ if (toggle) toggle.setAttribute("aria-expanded", "true");
342
+ }
343
+ current = current.parentElement;
344
+ }
345
+
346
+ if (!isInView(target)) {
347
+ window.scrollTo(
348
+ window.scrollX,
349
+ target.getBoundingClientRect().top + window.scrollY - 250
350
+ );
351
+ highlight();
352
+ }
227
353
  }
228
- return false;
229
- }
230
354
 
231
- window.addEventListener("message", windowEvents, false);
355
+ function windowEvents(event) {
356
+ var msg = event.data;
357
+ if (msg.action === "expand") {
358
+ expandTo(msg.path);
359
+ }
360
+ return false;
361
+ }
232
362
 
233
- $(document).ready(function() {
234
- escapeShortcut();
235
- navResizer();
236
- enableLinks();
237
- enableToggles();
238
- populateSearchCache();
239
- enableSearch();
240
- });
363
+ window.addEventListener("message", windowEvents, false);
241
364
 
365
+ ready(function() {
366
+ escapeShortcut();
367
+ enableLinks();
368
+ enableToggles();
369
+ populateSearchCache();
370
+ enableSearch();
371
+ });
242
372
  })();
@@ -7,7 +7,7 @@
7
7
  <% end %>
8
8
  </title>
9
9
  <% stylesheets.each do |stylesheet| %>
10
- <link rel="stylesheet" href="<%= mtime_url(stylesheet) %>" type="text/css" />
10
+ <link rel="stylesheet" href="<%= mtime_url(stylesheet) %>" type="text/css">
11
11
  <% end %>
12
12
  <%= erb :script_setup %>
13
13
  <% javascripts.each do |javascript| %>
@@ -10,6 +10,7 @@
10
10
  </div>
11
11
 
12
12
  <div id="main" tabindex="-1">
13
+ <div id="main_progress" aria-hidden="true"></div>
13
14
  <div id="header">
14
15
  <%= erb(:breadcrumb) %>
15
16
  <%= erb(:search) %>
@@ -21,4 +22,4 @@
21
22
  <%= erb(:footer) %>
22
23
  </div>
23
24
  </body>
24
- </html>
25
+ </html>
@@ -3,8 +3,8 @@
3
3
  <dl>
4
4
  <dt class="">Defined in:</dt>
5
5
  <dd class="">
6
- <%= object.file %><% if object.files.size > 1 %><span class="defines">,<br />
7
- <%= object.files[1..-1].map {|f| f.first }.join(",<br /> ") %></div>
6
+ <%= object.file %><% if object.files.size > 1 %><span class="defines">,<br>
7
+ <%= object.files[1..-1].map {|f| f.first }.join(",<br> ") %></div>
8
8
  <% end %>
9
9
  </dd>
10
10
  </dl>
@@ -14,4 +14,4 @@
14
14
  <div id="method_details">
15
15
  <%= yieldall :index => 0 %>
16
16
  </div>
17
- </div>
17
+ </div>
@@ -1,3 +1,3 @@
1
- <%= object.file ? object.file : '(unknown)' %><% if object.files.size > 1 %><span class="defines">,<br />
2
- <%= object.files[1..-1].map {|f| f.first }.join(",<br /> ") %></span>
3
- <% end %>
1
+ <%= object.file ? object.file : '(unknown)' %><% if object.files.size > 1 %><span class="defines">,<br>
2
+ <%= object.files[1..-1].map {|f| f.first }.join(",<br> ") %></span>
3
+ <% end %>
@@ -5,6 +5,7 @@
5
5
  <% meths = prune_method_listing(superclass.meths(:included => false, :inherited => false)) %>
6
6
  <% meths.reject! {|m| object.child(:scope => m.scope, :name => m.name) != nil } %>
7
7
  <% meths.reject! {|m| m.is_alias? || m.is_attribute? } %>
8
+ <% meths.reject! {|m| m.group && object.groups && object.groups.include?(m.group) } %>
8
9
  <% next if meths.size == 0 %>
9
10
  <% if method_listing.size == 0 && !found_method %><h2>Method Summary</h2><% end %>
10
11
  <% found_method = true %>
@@ -10,5 +10,13 @@
10
10
  <%= yieldall :item => meth %>
11
11
  <% end %>
12
12
  </ul>
13
+ <% (inherited_methods_by_group[name] || {}).each do |superclass, meths| %>
14
+ <h3 class="inherited">Methods <%= superclass.type == :class ? 'inherited' : 'included' %> from <%= linkify superclass %></h3>
15
+ <p class="inherited"><%= meths.sort_by {|o| o.name.to_s }.map {|m|
16
+ mname = m.name(true)
17
+ mname = mname.gsub(/^#/, '') if superclass.type == :module && object.class_mixins.include?(superclass)
18
+ linkify(m, mname)
19
+ }.join(", ") %></p>
20
+ <% end %>
13
21
  <% end %>
14
22
  <% end %>
@@ -104,6 +104,26 @@ def inherited_constant_list
104
104
  end
105
105
  end
106
106
 
107
+ def inherited_methods_by_group
108
+ return @inherited_meths_by_group if defined?(@inherited_meths_by_group)
109
+ @inherited_meths_by_group = {}
110
+ return @inherited_meths_by_group unless object.groups
111
+
112
+ object.inheritance_tree(true)[1..-1].each do |superclass|
113
+ next if superclass.is_a?(YARD::CodeObjects::Proxy)
114
+ next if options.embed_mixins.size > 0 && options.embed_mixins_match?(superclass) != false
115
+ meths = prune_method_listing(superclass.meths(:included => false, :inherited => false))
116
+ meths.reject! {|m| object.child(:scope => m.scope, :name => m.name) != nil }
117
+ meths.reject! {|m| m.is_alias? || m.is_attribute? }
118
+ meths.each do |m|
119
+ next unless m.group && object.groups.include?(m.group)
120
+ (@inherited_meths_by_group[m.group] ||= {})[superclass] ||= []
121
+ @inherited_meths_by_group[m.group][superclass] << m
122
+ end
123
+ end
124
+ @inherited_meths_by_group
125
+ end
126
+
107
127
  def docstring_full(obj)
108
128
  docstring = obj.tags(:overload).size == 1 && obj.docstring.empty? ?
109
129
  obj.tag(:overload).docstring : obj.docstring