rubybreaker 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. data/NEWS +48 -0
  2. data/README.md +56 -20
  3. data/Rakefile +9 -34
  4. data/TODO +10 -10
  5. data/VERSION +1 -0
  6. data/bin/gen_stub_rubylib +35 -36
  7. data/bin/rubybreaker +1 -4
  8. data/lib/rubybreaker/debug.rb +8 -4
  9. data/lib/rubybreaker/rubylib/core.rb +738 -571
  10. data/lib/rubybreaker/runtime/inspector.rb +16 -7
  11. data/lib/rubybreaker/runtime/monitor.rb +14 -18
  12. data/lib/rubybreaker/runtime/object_wrapper.rb +9 -3
  13. data/lib/rubybreaker/runtime/overrides.rb +51 -8
  14. data/lib/rubybreaker/runtime/pluggable.rb +1 -3
  15. data/lib/rubybreaker/runtime/type_placeholder.rb +2 -6
  16. data/lib/rubybreaker/runtime/type_system.rb +53 -17
  17. data/lib/rubybreaker/runtime/typesig_parser.rb +1 -0
  18. data/lib/rubybreaker/runtime/util.rb +18 -0
  19. data/lib/rubybreaker/runtime.rb +42 -15
  20. data/lib/rubybreaker/type/type_comparer.rb +10 -10
  21. data/lib/rubybreaker/type/type_grammar.treetop +30 -21
  22. data/lib/rubybreaker/type/type_unparser.rb +2 -2
  23. data/lib/rubybreaker/typing/subtyping.rb +21 -21
  24. data/lib/rubybreaker/util.rb +11 -1
  25. data/lib/rubybreaker.rb +75 -54
  26. data/test/integrated/tc_class_methods.rb +35 -0
  27. data/test/integrated/tc_inherit_broken.rb +29 -0
  28. data/test/integrated/tc_method_missing.rb +1 -1
  29. data/test/runtime/tc_obj_wrapper.rb +104 -4
  30. data/test/ts_integrated.rb +2 -0
  31. data/test/type/tc_comparer.rb +96 -96
  32. data/test/type/tc_parser.rb +18 -0
  33. data/test/type/tc_unparser.rb +16 -0
  34. data/test/typing/tc_typing.rb +20 -20
  35. data/webpage/footer.html +1 -1
  36. data/webpage/header.html +7 -7
  37. data/webpage/index.html +65 -28
  38. data/webpage/rdoc/RubyBreaker/Breakable.html +280 -0
  39. data/webpage/rdoc/RubyBreaker/Broken/BrokenEigen.html +304 -0
  40. data/webpage/rdoc/RubyBreaker/Broken.html +308 -0
  41. data/webpage/rdoc/RubyBreaker/Context.html +421 -0
  42. data/webpage/rdoc/RubyBreaker/Debug.html +411 -0
  43. data/webpage/rdoc/RubyBreaker/Errors/InternalError.html +263 -0
  44. data/webpage/rdoc/RubyBreaker/Errors/InvalidSubtypeCheck.html +263 -0
  45. data/webpage/rdoc/RubyBreaker/Errors/InvalidTypeConstruction.html +214 -0
  46. data/webpage/rdoc/RubyBreaker/Errors/SubtypeFailure.html +212 -0
  47. data/webpage/rdoc/RubyBreaker/Errors/TypeError.html +212 -0
  48. data/webpage/rdoc/RubyBreaker/Errors/UserError.html +264 -0
  49. data/webpage/rdoc/RubyBreaker/Errors.html +209 -0
  50. data/webpage/rdoc/RubyBreaker/Kernel.html +259 -0
  51. data/webpage/rdoc/RubyBreaker/Main.html +560 -0
  52. data/webpage/rdoc/RubyBreaker/ObjectPosition.html +334 -0
  53. data/webpage/rdoc/RubyBreaker/Position.html +463 -0
  54. data/webpage/rdoc/RubyBreaker/RubyTypeUtils.html +308 -0
  55. data/webpage/rdoc/RubyBreaker/Runtime/Inspector.html +380 -0
  56. data/webpage/rdoc/RubyBreaker/Runtime/MethodInfo.html +324 -0
  57. data/webpage/rdoc/RubyBreaker/Runtime/Monitor.html +354 -0
  58. data/webpage/rdoc/RubyBreaker/Runtime/MonitorInstaller.html +379 -0
  59. data/webpage/rdoc/RubyBreaker/Runtime/MonitorSwitch.html +382 -0
  60. data/webpage/rdoc/RubyBreaker/Runtime/MonitorUtils.html +400 -0
  61. data/webpage/rdoc/RubyBreaker/Runtime/ObjectWrapper.html +411 -0
  62. data/webpage/rdoc/RubyBreaker/Runtime/Pluggable.html +305 -0
  63. data/webpage/rdoc/RubyBreaker/Runtime/TypePlaceholder.html +280 -0
  64. data/webpage/rdoc/RubyBreaker/Runtime/TypeSigParser.html +283 -0
  65. data/webpage/rdoc/RubyBreaker/Runtime/TypeSystem.html +630 -0
  66. data/webpage/rdoc/RubyBreaker/Runtime.html +255 -0
  67. data/webpage/rdoc/RubyBreaker/TestCase.html +332 -0
  68. data/webpage/rdoc/RubyBreaker/TypeComparer.html +304 -0
  69. data/webpage/rdoc/RubyBreaker/TypeDefs/AnyType.html +260 -0
  70. data/webpage/rdoc/RubyBreaker/TypeDefs/BlockType.html +310 -0
  71. data/webpage/rdoc/RubyBreaker/TypeDefs/DuckType.html +320 -0
  72. data/webpage/rdoc/RubyBreaker/TypeDefs/FusionType.html +323 -0
  73. data/webpage/rdoc/RubyBreaker/TypeDefs/MethodListType.html +281 -0
  74. data/webpage/rdoc/RubyBreaker/TypeDefs/MethodType.html +282 -0
  75. data/webpage/rdoc/RubyBreaker/TypeDefs/NilType.html +260 -0
  76. data/webpage/rdoc/RubyBreaker/TypeDefs/NominalType.html +282 -0
  77. data/webpage/rdoc/RubyBreaker/TypeDefs/OptionalType.html +281 -0
  78. data/webpage/rdoc/RubyBreaker/TypeDefs/OrType.html +281 -0
  79. data/webpage/rdoc/RubyBreaker/TypeDefs/SelfType.html +329 -0
  80. data/webpage/rdoc/RubyBreaker/TypeDefs/Type.html +409 -0
  81. data/webpage/rdoc/RubyBreaker/TypeDefs/VarLengthType.html +282 -0
  82. data/webpage/rdoc/RubyBreaker/TypeDefs.html +212 -0
  83. data/webpage/rdoc/RubyBreaker/TypeUnparser.html +273 -0
  84. data/webpage/rdoc/RubyBreaker/Typing.html +305 -0
  85. data/webpage/rdoc/RubyBreaker/Utilities.html +294 -0
  86. data/webpage/rdoc/RubyBreaker.html +337 -0
  87. data/webpage/rdoc/created.rid +26 -0
  88. data/webpage/rdoc/images/add.png +0 -0
  89. data/webpage/rdoc/images/brick.png +0 -0
  90. data/webpage/rdoc/images/brick_link.png +0 -0
  91. data/webpage/rdoc/images/bug.png +0 -0
  92. data/webpage/rdoc/images/bullet_black.png +0 -0
  93. data/webpage/rdoc/images/bullet_toggle_minus.png +0 -0
  94. data/webpage/rdoc/images/bullet_toggle_plus.png +0 -0
  95. data/webpage/rdoc/images/date.png +0 -0
  96. data/webpage/rdoc/images/delete.png +0 -0
  97. data/webpage/rdoc/images/find.png +0 -0
  98. data/webpage/rdoc/images/loadingAnimation.gif +0 -0
  99. data/webpage/rdoc/images/macFFBgHack.png +0 -0
  100. data/webpage/rdoc/images/package.png +0 -0
  101. data/webpage/rdoc/images/page_green.png +0 -0
  102. data/webpage/rdoc/images/page_white_text.png +0 -0
  103. data/webpage/rdoc/images/page_white_width.png +0 -0
  104. data/webpage/rdoc/images/plugin.png +0 -0
  105. data/webpage/rdoc/images/ruby.png +0 -0
  106. data/webpage/rdoc/images/tag_blue.png +0 -0
  107. data/webpage/rdoc/images/tag_green.png +0 -0
  108. data/webpage/rdoc/images/transparent.png +0 -0
  109. data/webpage/rdoc/images/wrench.png +0 -0
  110. data/webpage/rdoc/images/wrench_orange.png +0 -0
  111. data/webpage/rdoc/images/zoom.png +0 -0
  112. data/webpage/rdoc/index.html +165 -0
  113. data/webpage/rdoc/js/darkfish.js +153 -0
  114. data/webpage/rdoc/js/jquery.js +18 -0
  115. data/webpage/rdoc/js/navigation.js +142 -0
  116. data/webpage/rdoc/js/search.js +94 -0
  117. data/webpage/rdoc/js/search_index.js +1 -0
  118. data/webpage/rdoc/js/searcher.js +228 -0
  119. data/webpage/rdoc/rdoc.css +543 -0
  120. data/webpage/rdoc/table_of_contents.html +376 -0
  121. data/webpage/rubybreaker.css +31 -31
  122. metadata +93 -6
@@ -0,0 +1,142 @@
1
+ /*
2
+ * Navigation allows movement using the arrow keys through the search results.
3
+ *
4
+ * When using this library you will need to set scrollIntoView to the
5
+ * appropriate function for your layout. Use scrollInWindow if the container
6
+ * is not scrollable and scrollInElement if the container is a separate
7
+ * scrolling region.
8
+ */
9
+ Navigation = new function() {
10
+ this.initNavigation = function() {
11
+ var _this = this;
12
+
13
+ $(document).keydown(function(e) {
14
+ _this.onkeydown(e);
15
+ }).keyup(function(e) {
16
+ _this.onkeyup(e);
17
+ });
18
+
19
+ this.navigationActive = true;
20
+ }
21
+
22
+ this.setNavigationActive = function(state) {
23
+ this.navigationActive = state;
24
+ this.clearMoveTimeout();
25
+ }
26
+
27
+ this.onkeyup = function(e) {
28
+ if (!this.navigationActive) return;
29
+
30
+ switch(e.keyCode) {
31
+ case 37: //Event.KEY_LEFT:
32
+ case 38: //Event.KEY_UP:
33
+ case 39: //Event.KEY_RIGHT:
34
+ case 40: //Event.KEY_DOWN:
35
+ this.clearMoveTimeout();
36
+ break;
37
+ }
38
+ }
39
+
40
+ this.onkeydown = function(e) {
41
+ if (!this.navigationActive) return;
42
+ switch(e.keyCode) {
43
+ case 37: //Event.KEY_LEFT:
44
+ if (this.moveLeft()) e.preventDefault();
45
+ break;
46
+ case 38: //Event.KEY_UP:
47
+ if (e.keyCode == 38 || e.ctrlKey) {
48
+ if (this.moveUp()) e.preventDefault();
49
+ this.startMoveTimeout(false);
50
+ }
51
+ break;
52
+ case 39: //Event.KEY_RIGHT:
53
+ if (this.moveRight()) e.preventDefault();
54
+ break;
55
+ case 40: //Event.KEY_DOWN:
56
+ if (e.keyCode == 40 || e.ctrlKey) {
57
+ if (this.moveDown()) e.preventDefault();
58
+ this.startMoveTimeout(true);
59
+ }
60
+ break;
61
+ case 13: //Event.KEY_RETURN:
62
+ if (this.$current)
63
+ e.preventDefault();
64
+ this.select(this.$current);
65
+ break;
66
+ }
67
+ if (e.ctrlKey && e.shiftKey) this.select(this.$current);
68
+ }
69
+
70
+ this.clearMoveTimeout = function() {
71
+ clearTimeout(this.moveTimeout);
72
+ this.moveTimeout = null;
73
+ }
74
+
75
+ this.startMoveTimeout = function(isDown) {
76
+ if (!$.browser.mozilla && !$.browser.opera) return;
77
+ if (this.moveTimeout) this.clearMoveTimeout();
78
+ var _this = this;
79
+
80
+ var go = function() {
81
+ if (!_this.moveTimeout) return;
82
+ _this[isDown ? 'moveDown' : 'moveUp']();
83
+ _this.moveTimout = setTimeout(go, 100);
84
+ }
85
+ this.moveTimeout = setTimeout(go, 200);
86
+ }
87
+
88
+ this.moveRight = function() {
89
+ }
90
+
91
+ this.moveLeft = function() {
92
+ }
93
+
94
+ this.move = function(isDown) {
95
+ }
96
+
97
+ this.moveUp = function() {
98
+ return this.move(false);
99
+ }
100
+
101
+ this.moveDown = function() {
102
+ return this.move(true);
103
+ }
104
+
105
+ /*
106
+ * Scrolls to the given element in the scrollable element view.
107
+ */
108
+ this.scrollInElement = function(element, view) {
109
+ var offset, viewHeight, viewScroll, height;
110
+ offset = element.offsetTop;
111
+ height = element.offsetHeight;
112
+ viewHeight = view.offsetHeight;
113
+ viewScroll = view.scrollTop;
114
+
115
+ if (offset - viewScroll + height > viewHeight) {
116
+ view.scrollTop = offset - viewHeight + height;
117
+ }
118
+ if (offset < viewScroll) {
119
+ view.scrollTop = offset;
120
+ }
121
+ }
122
+
123
+ /*
124
+ * Scrolls to the given element in the window. The second argument is
125
+ * ignored
126
+ */
127
+ this.scrollInWindow = function(element, ignored) {
128
+ var offset, viewHeight, viewScroll, height;
129
+ offset = element.offsetTop;
130
+ height = element.offsetHeight;
131
+ viewHeight = window.innerHeight;
132
+ viewScroll = window.scrollY;
133
+
134
+ if (offset - viewScroll + height > viewHeight) {
135
+ window.scrollTo(window.scrollX, offset - viewHeight + height);
136
+ }
137
+ if (offset < viewScroll) {
138
+ window.scrollTo(window.scrollX, offset);
139
+ }
140
+ }
141
+ }
142
+
@@ -0,0 +1,94 @@
1
+ Search = function(data, input, result) {
2
+ this.data = data;
3
+ this.$input = $(input);
4
+ this.$result = $(result);
5
+
6
+ this.$current = null;
7
+ this.$view = this.$result.parent();
8
+ this.searcher = new Searcher(data.index);
9
+ this.init();
10
+ }
11
+
12
+ Search.prototype = $.extend({}, Navigation, new function() {
13
+ var suid = 1;
14
+
15
+ this.init = function() {
16
+ var _this = this;
17
+ var observer = function() {
18
+ _this.search(_this.$input[0].value);
19
+ };
20
+ this.$input.keyup(observer);
21
+ this.$input.click(observer); // mac's clear field
22
+
23
+ this.searcher.ready(function(results, isLast) {
24
+ _this.addResults(results, isLast);
25
+ })
26
+
27
+ this.initNavigation();
28
+ this.setNavigationActive(false);
29
+ }
30
+
31
+ this.search = function(value, selectFirstMatch) {
32
+ value = jQuery.trim(value).toLowerCase();
33
+ if (value) {
34
+ this.setNavigationActive(true);
35
+ } else {
36
+ this.setNavigationActive(false);
37
+ }
38
+
39
+ if (value == '') {
40
+ this.lastQuery = value;
41
+ this.$result.empty();
42
+ this.setNavigationActive(false);
43
+ } else if (value != this.lastQuery) {
44
+ this.lastQuery = value;
45
+ this.firstRun = true;
46
+ this.searcher.find(value);
47
+ }
48
+ }
49
+
50
+ this.addResults = function(results, isLast) {
51
+ var target = this.$result.get(0);
52
+ if (this.firstRun && (results.length > 0 || isLast)) {
53
+ this.$current = null;
54
+ this.$result.empty();
55
+ }
56
+
57
+ for (var i=0, l = results.length; i < l; i++) {
58
+ target.appendChild(this.renderItem.call(this, results[i]));
59
+ };
60
+
61
+ if (this.firstRun && results.length > 0) {
62
+ this.firstRun = false;
63
+ this.$current = $(target.firstChild);
64
+ this.$current.addClass('current');
65
+ }
66
+ if (jQuery.browser.msie) this.$element[0].className += '';
67
+ }
68
+
69
+ this.move = function(isDown) {
70
+ if (!this.$current) return;
71
+ var $next = this.$current[isDown ? 'next' : 'prev']();
72
+ if ($next.length) {
73
+ this.$current.removeClass('current');
74
+ $next.addClass('current');
75
+ this.scrollIntoView($next[0], this.$view[0]);
76
+ this.$current = $next;
77
+ }
78
+ return true;
79
+ }
80
+
81
+ this.hlt = function(html) {
82
+ return this.escapeHTML(html).
83
+ replace(/\u0001/g, '<em>').
84
+ replace(/\u0002/g, '</em>');
85
+ }
86
+
87
+ this.escapeHTML = function(html) {
88
+ return html.replace(/[&<>]/g, function(c) {
89
+ return '&#' + c.charCodeAt(0) + ';';
90
+ });
91
+ }
92
+
93
+ });
94
+
@@ -0,0 +1 @@
1
+ var search_data = {"index":{"searchIndex":["rubybreaker","breakable","broken","brokeneigen","context","debug","errors","internalerror","invalidsubtypecheck","invalidtypeconstruction","subtypefailure","typeerror","usererror","kernel","main","objectposition","position","rubytypeutils","runtime","inspector","methodinfo","monitor","monitorinstaller","monitorswitch","monitorutils","objectwrapper","pluggable","typeplaceholder","typesigparser","typesystem","testcase","typecomparer","typedefs","anytype","blocktype","ducktype","fusiontype","methodlisttype","methodtype","niltype","nominaltype","optionaltype","ortype","selftype","type","varlengthtype","typeunparser","typing","utilities","__rubybreaker_obj()","__rubybreaker_type()","add_meth()","after_method()","after_method_call()","before_method()","before_method_call()","camelize()","compare()","convert_caller_to_pos()","debug_mode?()","eql?()","feed_line()","format_with_msg()","get()","get_alt_meth_name()","get_orig_meth_name()","get_self()","included()","included()","included()","input()","inspect_all()","inspect_class_meth()","inspect_meth()","inspect_meths()","install_module_monitor()","is_module?()","is_object_wrapped?()","lub()","lub_helper()","method_missing()","mod()","monitor()","monitor_after_method()","monitor_before_method()","msg()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","new()","output()","parse()","pop()","pp_methods()","pp_module()","push()","rename_meth()","report()","respond_to?()","route()","run()","set()","set_self()","set_to()","setup()","setup()","short_msg()","subclass_rel?()","submodule_rel?()","subtype_of?()","subtype_rel?()","suppress_warning()","teardown()","to_s()","to_s()","token()","turn_off()","turn_on()","typesig()","underscore()","unparse()","unparse()"],"longSearchIndex":["rubybreaker","rubybreaker::breakable","rubybreaker::broken","rubybreaker::broken::brokeneigen","rubybreaker::context","rubybreaker::debug","rubybreaker::errors","rubybreaker::errors::internalerror","rubybreaker::errors::invalidsubtypecheck","rubybreaker::errors::invalidtypeconstruction","rubybreaker::errors::subtypefailure","rubybreaker::errors::typeerror","rubybreaker::errors::usererror","rubybreaker::kernel","rubybreaker::main","rubybreaker::objectposition","rubybreaker::position","rubybreaker::rubytypeutils","rubybreaker::runtime","rubybreaker::runtime::inspector","rubybreaker::runtime::methodinfo","rubybreaker::runtime::monitor","rubybreaker::runtime::monitorinstaller","rubybreaker::runtime::monitorswitch","rubybreaker::runtime::monitorutils","rubybreaker::runtime::objectwrapper","rubybreaker::runtime::pluggable","rubybreaker::runtime::typeplaceholder","rubybreaker::runtime::typesigparser","rubybreaker::runtime::typesystem","rubybreaker::testcase","rubybreaker::typecomparer","rubybreaker::typedefs","rubybreaker::typedefs::anytype","rubybreaker::typedefs::blocktype","rubybreaker::typedefs::ducktype","rubybreaker::typedefs::fusiontype","rubybreaker::typedefs::methodlisttype","rubybreaker::typedefs::methodtype","rubybreaker::typedefs::niltype","rubybreaker::typedefs::nominaltype","rubybreaker::typedefs::optionaltype","rubybreaker::typedefs::ortype","rubybreaker::typedefs::selftype","rubybreaker::typedefs::type","rubybreaker::typedefs::varlengthtype","rubybreaker::typeunparser","rubybreaker::typing","rubybreaker::utilities","rubybreaker::runtime::objectwrapper#__rubybreaker_obj()","rubybreaker::runtime::objectwrapper#__rubybreaker_type()","rubybreaker::typedefs::ducktype#add_meth()","rubybreaker::runtime::typesystem#after_method()","rubybreaker::runtime::pluggable#after_method_call()","rubybreaker::runtime::typesystem#before_method()","rubybreaker::runtime::pluggable#before_method_call()","rubybreaker::utilities::camelize()","rubybreaker::typecomparer::compare()","rubybreaker::position::convert_caller_to_pos()","rubybreaker::debug::debug_mode?()","rubybreaker::typedefs::type#eql?()","rubybreaker::debug::feed_line()","rubybreaker::context#format_with_msg()","rubybreaker::position::get()","rubybreaker::runtime::monitorutils::get_alt_meth_name()","rubybreaker::runtime::monitorutils::get_orig_meth_name()","rubybreaker::typedefs::selftype::get_self()","rubybreaker::breakable::included()","rubybreaker::broken::included()","rubybreaker::testcase::included()","rubybreaker::main::input()","rubybreaker::runtime::inspector::inspect_all()","rubybreaker::runtime::inspector::inspect_class_meth()","rubybreaker::runtime::inspector::inspect_meth()","rubybreaker::runtime::inspector::inspect_meths()","rubybreaker::runtime::monitorinstaller::install_module_monitor()","rubybreaker::runtime::monitorinstaller::is_module?()","rubybreaker::runtime::typesystem#is_object_wrapped?()","rubybreaker::runtime::typesystem#lub()","rubybreaker::runtime::typesystem#lub_helper()","rubybreaker::runtime::objectwrapper#method_missing()","rubybreaker::typedefs::fusiontype#mod()","rubybreaker::monitor()","rubybreaker::runtime::monitor#monitor_after_method()","rubybreaker::runtime::monitor#monitor_before_method()","rubybreaker::debug::msg()","rubybreaker::context::new()","rubybreaker::errors::internalerror::new()","rubybreaker::errors::invalidsubtypecheck::new()","rubybreaker::errors::usererror::new()","rubybreaker::objectposition::new()","rubybreaker::position::new()","rubybreaker::runtime::methodinfo::new()","rubybreaker::runtime::monitor::new()","rubybreaker::runtime::monitorswitch::new()","rubybreaker::runtime::objectwrapper::new()","rubybreaker::runtime::typeplaceholder::new()","rubybreaker::typedefs::anytype::new()","rubybreaker::typedefs::blocktype::new()","rubybreaker::typedefs::ducktype::new()","rubybreaker::typedefs::fusiontype::new()","rubybreaker::typedefs::methodlisttype::new()","rubybreaker::typedefs::methodtype::new()","rubybreaker::typedefs::niltype::new()","rubybreaker::typedefs::nominaltype::new()","rubybreaker::typedefs::optionaltype::new()","rubybreaker::typedefs::ortype::new()","rubybreaker::typedefs::selftype::new()","rubybreaker::typedefs::type::new()","rubybreaker::typedefs::varlengthtype::new()","rubybreaker::main::output()","rubybreaker::runtime::typesigparser::parse()","rubybreaker::context#pop()","rubybreaker::main::pp_methods()","rubybreaker::main::pp_module()","rubybreaker::context#push()","rubybreaker::runtime::monitorinstaller::rename_meth()","rubybreaker::runtime::monitorinstaller::report()","rubybreaker::runtime::objectwrapper#respond_to?()","rubybreaker::runtime::monitorutils::route()","rubybreaker::main::run()","rubybreaker::position::set()","rubybreaker::typedefs::selftype::set_self()","rubybreaker::runtime::monitorswitch#set_to()","rubybreaker::main::setup()","rubybreaker::testcase::setup()","rubybreaker::debug::short_msg()","rubybreaker::rubytypeutils::subclass_rel?()","rubybreaker::rubytypeutils::submodule_rel?()","rubybreaker::typedefs::type#subtype_of?()","rubybreaker::typing::subtype_rel?()","rubybreaker::kernel#suppress_warning()","rubybreaker::testcase::teardown()","rubybreaker::objectposition#to_s()","rubybreaker::position#to_s()","rubybreaker::debug::token()","rubybreaker::runtime::monitorswitch#turn_off()","rubybreaker::runtime::monitorswitch#turn_on()","rubybreaker::broken::brokeneigen#typesig()","rubybreaker::utilities::underscore()","rubybreaker::typedefs::type#unparse()","rubybreaker::typeunparser::unparse()"],"info":[["RubyBreaker","","RubyBreaker.html","","<p>-\n\n<pre>This file contains utility functions that are useful for the Runtime\nLibrary.</pre>\n<p>RubyBreaker is a dynamic …\n"],["RubyBreaker::Breakable","","RubyBreaker/Breakable.html","","<p>This module should be included in classes or modules that you want to\nmonitor during runtime. The concept …\n"],["RubyBreaker::Broken","","RubyBreaker/Broken.html","","<p>This module is included for “broken” classes.\n"],["RubyBreaker::Broken::BrokenEigen","","RubyBreaker/Broken/BrokenEigen.html","","<p>-\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">This</span> <span class=\"ruby-keyword\">module</span> <span class=\"ruby-identifier\">will</span> <span class=\"ruby-identifier\">be</span> <span class=\"ruby-string\">&quot;extended&quot;</span> <span class=\"ruby-identifier\">to</span> <span class=\"ruby-identifier\">the</span> <span class=\"ruby-identifier\">eigen</span> <span class=\"ruby-keyword\">class</span> <span class=\"ruby-identifier\">of</span> <span class=\"ruby-identifier\">the</span> <span class=\"ruby-keyword\">class</span> <span class=\"ruby-identifier\">that</span> \n<span class=\"ruby-identifier\">includes</span> <span class=\"ruby-constant\">Broken</span> <span class=\"ruby-keyword\">module</span>. <span class=\"ruby-constant\">This</span> <span class=\"ruby-identifier\">allows</span> <span class=\"ruby-operator\">...</span>\n</pre>\n"],["RubyBreaker::Context","","RubyBreaker/Context.html","","<p>This class represents a context which consists of one or more positions. A\nposition can refer to a physical …\n"],["RubyBreaker::Debug","","RubyBreaker/Debug.html","","<p>This module is for internal purpose only - to help ourselves find bugs and\nfix them with more informative …\n"],["RubyBreaker::Errors","","RubyBreaker/Errors.html","","<p>This module contains errors used by RubyBreaker.\n"],["RubyBreaker::Errors::InternalError","","RubyBreaker/Errors/InternalError.html","","<p>This class is a base class for any internal errors. It should be used to\ninform the faults within the …\n"],["RubyBreaker::Errors::InvalidSubtypeCheck","","RubyBreaker/Errors/InvalidSubtypeCheck.html","","<p>This error is thrown when a subtype check is not even appropriate for two\ngiven types. It should NOT …\n"],["RubyBreaker::Errors::InvalidTypeConstruction","","RubyBreaker/Errors/InvalidTypeConstruction.html","","<p>This error is thrown when a type is constructed with invalid elements.\n"],["RubyBreaker::Errors::SubtypeFailure","","RubyBreaker/Errors/SubtypeFailure.html","",""],["RubyBreaker::Errors::TypeError","","RubyBreaker/Errors/TypeError.html","",""],["RubyBreaker::Errors::UserError","","RubyBreaker/Errors/UserError.html","","<p>This class is a base class for any user errors. Unlike internal error, it\nshould use a Context to inform …\n"],["RubyBreaker::Kernel","","RubyBreaker/Kernel.html","","<p>mentalized.net/journal/2010/04/02/suppress_warnings_from_ruby/\n"],["RubyBreaker::Main","","RubyBreaker/Main.html","","<p>This module has a set of entry points to the program and misc. methods for\nrunning RubyBreaker.\n"],["RubyBreaker::ObjectPosition","","RubyBreaker/ObjectPosition.html","","<p>This class represents a position with respect to an object and the name of\na method being invoked.\n"],["RubyBreaker::Position","","RubyBreaker/Position.html","","<p>This class represents a position of the type acquired from either the type\nsignature or code during runtime. …\n"],["RubyBreaker::RubyTypeUtils","","RubyBreaker/RubyTypeUtils.html","",""],["RubyBreaker::Runtime","","RubyBreaker/Runtime.html","",""],["RubyBreaker::Runtime::Inspector","","RubyBreaker/Runtime/Inspector.html","","<p>This module inspects a Breakable module and retrieves type information if\nthere is any.\n"],["RubyBreaker::Runtime::MethodInfo","","RubyBreaker/Runtime/MethodInfo.html","","<p>This class has information (and data) of the method being called. Used by\nPluggable and Monitor\n"],["RubyBreaker::Runtime::Monitor","","RubyBreaker/Runtime/Monitor.html","","<p>This class monitors method calls before and after. It simply reroutes the\nresponsibility to the appropriate …\n"],["RubyBreaker::Runtime::MonitorInstaller","","RubyBreaker/Runtime/MonitorInstaller.html","","<p>This module installs a monitor in the object.\n"],["RubyBreaker::Runtime::MonitorSwitch","","RubyBreaker/Runtime/MonitorSwitch.html","","<p>This class is a switch to turn on and off the type monitoring system. It is\nimportant to turn off the …\n"],["RubyBreaker::Runtime::MonitorUtils","","RubyBreaker/Runtime/MonitorUtils.html","","<p>This module contains helper methods for monitoring objects and modules.\n"],["RubyBreaker::Runtime::ObjectWrapper","","RubyBreaker/Runtime/ObjectWrapper.html","","<p>This class represents the shell object that wraps around another object. \nNote that it is a subclass …\n"],["RubyBreaker::Runtime::Pluggable","","RubyBreaker/Runtime/Pluggable.html","","<p>Any Pluggable module can be “plugged” into the RubyBreaker monitoring\nsystem. For example, …\n"],["RubyBreaker::Runtime::TypePlaceholder","","RubyBreaker/Runtime/TypePlaceholder.html","","<p>This class is a placeholder for method types\n"],["RubyBreaker::Runtime::TypeSigParser","","RubyBreaker/Runtime/TypeSigParser.html","",""],["RubyBreaker::Runtime::TypeSystem","","RubyBreaker/Runtime/TypeSystem.html","","<p>This is the default type system for RubyBreaker. It can be overridden by a\nuser specified type system. …\n"],["RubyBreaker::TestCase","","RubyBreaker/TestCase.html","","<p>This module overrides the normal behavior of Ruby Stdlib’s TestCase class.\n"],["RubyBreaker::TypeComparer","","RubyBreaker/TypeComparer.html","","<p>This module compares two RubyBreaker-defined types for the syntactic\nequivalence.\n"],["RubyBreaker::TypeDefs","","RubyBreaker/TypeDefs.html","","<p>This module contains all RubyBreaker type definitions. This module has to\nbe included to the module if …\n"],["RubyBreaker::TypeDefs::AnyType","","RubyBreaker/TypeDefs/AnyType.html","","<p>This type can represent any object\n"],["RubyBreaker::TypeDefs::BlockType","","RubyBreaker/TypeDefs/BlockType.html","","<p>This class represents a block (in a method). It has zero or more argument \ntypes, nested block type (optional), …\n"],["RubyBreaker::TypeDefs::DuckType","","RubyBreaker/TypeDefs/DuckType.html","","<p>This class represents any object with certain methods Usage: [m1,m2,…]\nwhere m1…mn are method names …\n"],["RubyBreaker::TypeDefs::FusionType","","RubyBreaker/TypeDefs/FusionType.html","","<p>This class represents any object that has certain methods whose types are\nsame as the given nominal type’s …\n"],["RubyBreaker::TypeDefs::MethodListType","","RubyBreaker/TypeDefs/MethodListType.html","","<p>This class represents multiple method types.\n"],["RubyBreaker::TypeDefs::MethodType","","RubyBreaker/TypeDefs/MethodType.html","","<p>This class represents a method and is essentially same as block type \nexcept the method name.\n"],["RubyBreaker::TypeDefs::NilType","","RubyBreaker/TypeDefs/NilType.html","","<p>This type represents a nil\n"],["RubyBreaker::TypeDefs::NominalType","","RubyBreaker/TypeDefs/NominalType.html","","<p>This class represents a concrete object like a Numeric or String. It \nstores the actual module in the …\n"],["RubyBreaker::TypeDefs::OptionalType","","RubyBreaker/TypeDefs/OptionalType.html","","<p>This class respresents an optional argument type\n"],["RubyBreaker::TypeDefs::OrType","","RubyBreaker/TypeDefs/OrType.html","","<p>This class represents one of many types\n"],["RubyBreaker::TypeDefs::SelfType","","RubyBreaker/TypeDefs/SelfType.html","","<p>This type represents the self type. Note that this is a subclass of Nominal\nType. It works just like …\n"],["RubyBreaker::TypeDefs::Type","","RubyBreaker/TypeDefs/Type.html","","<p>This class is a catch-all. The constructor of this class must be called\nfrom children via super() in …\n"],["RubyBreaker::TypeDefs::VarLengthType","","RubyBreaker/TypeDefs/VarLengthType.html","","<p>This class represents a variable-length argument type\n"],["RubyBreaker::TypeUnparser","","RubyBreaker/TypeUnparser.html","","<p>This module prints the RubyBreaker types in a user-friendly way.\n"],["RubyBreaker::Typing","","RubyBreaker/Typing.html","","<p>This module contains subtyping logic used in RubyBreaker. See\n<em>rubytype.rb</em> for logic related to subclassing …\n"],["RubyBreaker::Utilities","","RubyBreaker/Utilities.html","",""],["__rubybreaker_obj","RubyBreaker::Runtime::ObjectWrapper","RubyBreaker/Runtime/ObjectWrapper.html#method-i-__rubybreaker_obj","()","<p>This method returns the original object.\n"],["__rubybreaker_type","RubyBreaker::Runtime::ObjectWrapper","RubyBreaker/Runtime/ObjectWrapper.html#method-i-__rubybreaker_type","()","<p>This method returns the type gathered so far for this object.\n"],["add_meth","RubyBreaker::TypeDefs::DuckType","RubyBreaker/TypeDefs/DuckType.html#method-i-add_meth","(meth_name)",""],["after_method","RubyBreaker::Runtime::TypeSystem","RubyBreaker/Runtime/TypeSystem.html#method-i-after_method","(obj, meth_info)","<p>This method occurs after every “monitored” method call. It updates the type\ninformation.\n"],["after_method_call","RubyBreaker::Runtime::Pluggable","RubyBreaker/Runtime/Pluggable.html#method-i-after_method_call","(obj, meth_info)","<p>This method will be invoked right after the actual method is invoked.\n<p>obj &mdash; the receiver of the method call …\n"],["before_method","RubyBreaker::Runtime::TypeSystem","RubyBreaker/Runtime/TypeSystem.html#method-i-before_method","(obj, meth_info)","<p>This method occurs before every “monitored” method call. It wraps each\nargument with the object …\n"],["before_method_call","RubyBreaker::Runtime::Pluggable","RubyBreaker/Runtime/Pluggable.html#method-i-before_method_call","(obj, meth_info)","<p>This method will be invoked right before the actual method is invoked.\n<p>obj &mdash; the receiver of the method …\n"],["camelize","RubyBreaker::Utilities","RubyBreaker/Utilities.html#method-c-camelize","(lower_case_and_underscored_word, first_letter_in_uppercase = true)","<p>File activesupport/lib/active_support/inflector/methods.rb\n"],["compare","RubyBreaker::TypeComparer","RubyBreaker/TypeComparer.html#method-c-compare","(lhs,rhs)","<p>This equal method determines whether two types are\n<strong>syntactically</strong> equivalent. Note that this is NOT a …\n"],["convert_caller_to_pos","RubyBreaker::Position","RubyBreaker/Position.html#method-c-convert_caller_to_pos","(caller_ary, idx=0)","<p>This class method is a utility function to convert a string in the caller()\narray.\n"],["debug_mode?","RubyBreaker::Debug","RubyBreaker/Debug.html#method-c-debug_mode-3F","()",""],["eql?","RubyBreaker::TypeDefs::Type","RubyBreaker/TypeDefs/Type.html#method-i-eql-3F","(other)","<p>This method compares this object to another object syntactically.\n"],["feed_line","RubyBreaker::Debug","RubyBreaker/Debug.html#method-c-feed_line","()",""],["format_with_msg","RubyBreaker::Context","RubyBreaker/Context.html#method-i-format_with_msg","(pp,msg=\"\")",""],["get","RubyBreaker::Position","RubyBreaker/Position.html#method-c-get","()","<p>This class method returns a new position object for the current parsing\nposition.\n"],["get_alt_meth_name","RubyBreaker::Runtime::MonitorUtils","RubyBreaker/Runtime/MonitorUtils.html#method-c-get_alt_meth_name","(meth_name)","<p>This method returns the alternative (renamed) method name\n"],["get_orig_meth_name","RubyBreaker::Runtime::MonitorUtils","RubyBreaker/Runtime/MonitorUtils.html#method-c-get_orig_meth_name","(meth_name)","<p>This method returns the original method name\n"],["get_self","RubyBreaker::TypeDefs::SelfType","RubyBreaker/TypeDefs/SelfType.html#method-c-get_self","(mod)","<p>This is a getter method for class variable mod.\n"],["included","RubyBreaker::Breakable","RubyBreaker/Breakable.html#method-c-included","(mod)","<p>Simply keep track of this module and its eigen class so they are monitored\nlater on.\n"],["included","RubyBreaker::Broken","RubyBreaker/Broken.html#method-c-included","(mod)","<p>This method is triggered when Broken module is included. This just extends\nBrokenEigen into the target …\n"],["included","RubyBreaker::TestCase","RubyBreaker/TestCase.html#method-c-included","(mod)",""],["input","RubyBreaker::Main","RubyBreaker/Main.html#method-c-input","()","<p>Reads the input file if specified or exists\n"],["inspect_all","RubyBreaker::Runtime::Inspector","RubyBreaker/Runtime/Inspector.html#method-c-inspect_all","(mod)","<p>This method inspects the module for all methods. It returns a Hash\ncontaining (method name, method type) …\n"],["inspect_class_meth","RubyBreaker::Runtime::Inspector","RubyBreaker/Runtime/Inspector.html#method-c-inspect_class_meth","(mod, mname)","<p>This method inspects the module for the specified class method name. This\nis a shorthand for calling …\n"],["inspect_meth","RubyBreaker::Runtime::Inspector","RubyBreaker/Runtime/Inspector.html#method-c-inspect_meth","(mod, mname)","<p>This method inspects the module for specified method name. It returns the\nmethod type or method list …\n"],["inspect_meths","RubyBreaker::Runtime::Inspector","RubyBreaker/Runtime/Inspector.html#method-c-inspect_meths","(mod, mnames)","<p>Similar to inspect_meth but returns a hash of (mname, mtype) pairs.\n"],["install_module_monitor","RubyBreaker::Runtime::MonitorInstaller","RubyBreaker/Runtime/MonitorInstaller.html#method-c-install_module_monitor","(mod)","<p>Installs an module (class) monitor to the object.\n"],["is_module?","RubyBreaker::Runtime::MonitorInstaller","RubyBreaker/Runtime/MonitorInstaller.html#method-c-is_module-3F","(recv)","<p>returns true if the receiver is a module or a class\n"],["is_object_wrapped?","RubyBreaker::Runtime::TypeSystem","RubyBreaker/Runtime/TypeSystem.html#method-i-is_object_wrapped-3F","(obj)","<p>Check if the object is wrapped by a monitor\n"],["lub","RubyBreaker::Runtime::TypeSystem","RubyBreaker/Runtime/TypeSystem.html#method-i-lub","(obj, meth_type_map, meth_name, retval, *args, &blk)","<p>This method computes the least upper bound of the existing method type and\nnewly observed argument/block/return …\n"],["lub_helper","RubyBreaker::Runtime::TypeSystem","RubyBreaker/Runtime/TypeSystem.html#method-i-lub_helper","(exist_meth_type, new_meth_type)","<p>This method is a helper for computing the least upper bound. It handles the\ncase where existing method …\n"],["method_missing","RubyBreaker::Runtime::ObjectWrapper","RubyBreaker/Runtime/ObjectWrapper.html#method-i-method_missing","(mname,*args,&blk)","<p>This method missing method redirects all other method calls.\n"],["mod","RubyBreaker::TypeDefs::FusionType","RubyBreaker/TypeDefs/FusionType.html#method-i-mod","()","<p>This method gets the actual module of the nominal type for this fusion\ntype. This is a shorthand for …\n"],["monitor","RubyBreaker","RubyBreaker.html#method-c-monitor","()","<p>Just redirecting\n"],["monitor_after_method","RubyBreaker::Runtime::Monitor","RubyBreaker/Runtime/Monitor.html#method-i-monitor_after_method","(obj, meth_info)","<p>This method is invoked after the actual method is invoked.\n"],["monitor_before_method","RubyBreaker::Runtime::Monitor","RubyBreaker/Runtime/Monitor.html#method-i-monitor_before_method","(obj, meth_info)","<p>Starts monitoring of a method; it wraps each argument so that they can\ngather type information in the …\n"],["msg","RubyBreaker::Debug","RubyBreaker/Debug.html#method-c-msg","(text,context=nil)",""],["new","RubyBreaker::Context","RubyBreaker/Context.html#method-c-new","(pos)",""],["new","RubyBreaker::Errors::InternalError","RubyBreaker/Errors/InternalError.html#method-c-new","(msg)",""],["new","RubyBreaker::Errors::InvalidSubtypeCheck","RubyBreaker/Errors/InvalidSubtypeCheck.html#method-c-new","(msg,pos=nil)",""],["new","RubyBreaker::Errors::UserError","RubyBreaker/Errors/UserError.html#method-c-new","(msg, ctx)",""],["new","RubyBreaker::ObjectPosition","RubyBreaker/ObjectPosition.html#method-c-new","(obj, meth_name)",""],["new","RubyBreaker::Position","RubyBreaker/Position.html#method-c-new","(file=\"\",line=-1,col=-1,meth=\"\")",""],["new","RubyBreaker::Runtime::MethodInfo","RubyBreaker/Runtime/MethodInfo.html#method-c-new","(meth_name, args, blk, ret)",""],["new","RubyBreaker::Runtime::Monitor","RubyBreaker/Runtime/Monitor.html#method-c-new","(mod, pluggable)",""],["new","RubyBreaker::Runtime::MonitorSwitch","RubyBreaker/Runtime/MonitorSwitch.html#method-c-new","()",""],["new","RubyBreaker::Runtime::ObjectWrapper","RubyBreaker/Runtime/ObjectWrapper.html#method-c-new","(obj)",""],["new","RubyBreaker::Runtime::TypePlaceholder","RubyBreaker/Runtime/TypePlaceholder.html#method-c-new","()",""],["new","RubyBreaker::TypeDefs::AnyType","RubyBreaker/TypeDefs/AnyType.html#method-c-new","(*args)",""],["new","RubyBreaker::TypeDefs::BlockType","RubyBreaker/TypeDefs/BlockType.html#method-c-new","(arg_types=[],blk_type=nil,ret_type=nil,*args)",""],["new","RubyBreaker::TypeDefs::DuckType","RubyBreaker/TypeDefs/DuckType.html#method-c-new","(meth_names=[],*args)",""],["new","RubyBreaker::TypeDefs::FusionType","RubyBreaker/TypeDefs/FusionType.html#method-c-new","(nom_type,meth_names=[],*args)",""],["new","RubyBreaker::TypeDefs::MethodListType","RubyBreaker/TypeDefs/MethodListType.html#method-c-new","(types=[],*args)",""],["new","RubyBreaker::TypeDefs::MethodType","RubyBreaker/TypeDefs/MethodType.html#method-c-new","(meth_name,arg_types=[],blk_type=nil,ret_type=nil,*args)",""],["new","RubyBreaker::TypeDefs::NilType","RubyBreaker/TypeDefs/NilType.html#method-c-new","(*args)",""],["new","RubyBreaker::TypeDefs::NominalType","RubyBreaker/TypeDefs/NominalType.html#method-c-new","(mod=nil,*args)",""],["new","RubyBreaker::TypeDefs::OptionalType","RubyBreaker/TypeDefs/OptionalType.html#method-c-new","(type,*args)",""],["new","RubyBreaker::TypeDefs::OrType","RubyBreaker/TypeDefs/OrType.html#method-c-new","(types=[],*args)",""],["new","RubyBreaker::TypeDefs::SelfType","RubyBreaker/TypeDefs/SelfType.html#method-c-new","(*args)",""],["new","RubyBreaker::TypeDefs::Type","RubyBreaker/TypeDefs/Type.html#method-c-new","(*args)",""],["new","RubyBreaker::TypeDefs::VarLengthType","RubyBreaker/TypeDefs/VarLengthType.html#method-c-new","(type,*args)",""],["output","RubyBreaker::Main","RubyBreaker/Main.html#method-c-output","()","<p>This method will generate the output\n"],["parse","RubyBreaker::Runtime::TypeSigParser","RubyBreaker/Runtime/TypeSigParser.html#method-c-parse","(str)","<p>This is a simple redirecting method for parsing type signature. The only\nspecial thing about this method …\n"],["pop","RubyBreaker::Context","RubyBreaker/Context.html#method-i-pop","()",""],["pp_methods","RubyBreaker::Main","RubyBreaker/Main.html#method-c-pp_methods","(pp, meth_type_map)","<p>Pretty prints type information for methods\n"],["pp_module","RubyBreaker::Main","RubyBreaker/Main.html#method-c-pp_module","(pp, mod)","<p>Pretty prints type information for the module/class\n"],["push","RubyBreaker::Context","RubyBreaker/Context.html#method-i-push","(pos)",""],["rename_meth","RubyBreaker::Runtime::MonitorInstaller","RubyBreaker/Runtime/MonitorInstaller.html#method-c-rename_meth","(recv, meth_name)","<p>renames the method in essence; this method also “installs” the module\nmonitor for the class …\n"],["report","RubyBreaker::Runtime::MonitorInstaller","RubyBreaker/Runtime/MonitorInstaller.html#method-c-report","(mod)",""],["respond_to?","RubyBreaker::Runtime::ObjectWrapper","RubyBreaker/Runtime/ObjectWrapper.html#method-i-respond_to-3F","(mname)","<p>Only behave differently if it’s looking for <code>WRAPPED_INDICATOR</code>\nmethod\n"],["route","RubyBreaker::Runtime::MonitorUtils","RubyBreaker/Runtime/MonitorUtils.html#method-c-route","(obj,meth_name,*args,&blk)","<p>This will do the actual routing work for a particular “monitored” method\ncall.\n<p>obj &mdash; is the object …\n"],["run","RubyBreaker::Main","RubyBreaker/Main.html#method-c-run","()","<p>This method will run the input file\n"],["set","RubyBreaker::Position","RubyBreaker/Position.html#method-c-set","(file,line,col)","<p>This class method is to set the current parsing position.\n"],["set_self","RubyBreaker::TypeDefs::SelfType","RubyBreaker/TypeDefs/SelfType.html#method-c-set_self","(mod)","<p>This is a setter method for class variable mod. NOTE: It is set every time\nBroken module is included. …\n"],["set_to","RubyBreaker::Runtime::MonitorSwitch","RubyBreaker/Runtime/MonitorSwitch.html#method-i-set_to","(mode)",""],["setup","RubyBreaker::Main","RubyBreaker/Main.html#method-c-setup","()","<p>This method is the trigger point to install a monitor in each module/class.\n"],["setup","RubyBreaker::TestCase","RubyBreaker/TestCase.html#method-c-setup","()",""],["short_msg","RubyBreaker::Debug","RubyBreaker/Debug.html#method-c-short_msg","(text)",""],["subclass_rel?","RubyBreaker::RubyTypeUtils","RubyBreaker/RubyTypeUtils.html#method-c-subclass_rel-3F","(lhs, rhs)","<p>Checks if lhs is a subclass of rhs\n"],["submodule_rel?","RubyBreaker::RubyTypeUtils","RubyBreaker/RubyTypeUtils.html#method-c-submodule_rel-3F","(lhs,rhs)","<p>Checks if lhs is a sub-module of rhs\n"],["subtype_of?","RubyBreaker::TypeDefs::Type","RubyBreaker/TypeDefs/Type.html#method-i-subtype_of-3F","(rhs)","<p>This is a shorthand for calling Typing.subtype_rel?\n"],["subtype_rel?","RubyBreaker::Typing","RubyBreaker/Typing.html#method-c-subtype_rel-3F","(lhs, rhs)","<p>This method determines if one type is a subtype of another. This check is\nfor RubyBreaker defined types. …\n"],["suppress_warning","RubyBreaker::Kernel","RubyBreaker/Kernel.html#method-i-suppress_warning","()",""],["teardown","RubyBreaker::TestCase","RubyBreaker/TestCase.html#method-c-teardown","()",""],["to_s","RubyBreaker::ObjectPosition","RubyBreaker/ObjectPosition.html#method-i-to_s","()",""],["to_s","RubyBreaker::Position","RubyBreaker/Position.html#method-i-to_s","()",""],["token","RubyBreaker::Debug","RubyBreaker/Debug.html#method-c-token","(msg)",""],["turn_off","RubyBreaker::Runtime::MonitorSwitch","RubyBreaker/Runtime/MonitorSwitch.html#method-i-turn_off","()",""],["turn_on","RubyBreaker::Runtime::MonitorSwitch","RubyBreaker/Runtime/MonitorSwitch.html#method-i-turn_on","()",""],["typesig","RubyBreaker::Broken::BrokenEigen","RubyBreaker/Broken/BrokenEigen.html#method-i-typesig","(str)","<p>This method can be used at the eigen level of the target module to specify\nthe type of a method.\n"],["underscore","RubyBreaker::Utilities","RubyBreaker/Utilities.html#method-c-underscore","(camel_cased_word)","<p>File activesupport/lib/active_support/inflector/methods.rb, line 48\n"],["unparse","RubyBreaker::TypeDefs::Type","RubyBreaker/TypeDefs/Type.html#method-i-unparse","()","<p>This method unparses the type using the pretty print method.\n"],["unparse","RubyBreaker::TypeUnparser","RubyBreaker/TypeUnparser.html#method-c-unparse","(t)","<p>This method is used to display any RubyBreaker type in a user-friendly way\nusing the pretty print method. …\n"]]}}
@@ -0,0 +1,228 @@
1
+ Searcher = function(data) {
2
+ this.data = data;
3
+ this.handlers = [];
4
+ }
5
+
6
+ Searcher.prototype = new function() {
7
+ // search is performed in chunks of 1000 for non-blocking user input
8
+ var CHUNK_SIZE = 1000;
9
+ // do not try to find more than 100 results
10
+ var MAX_RESULTS = 100;
11
+ var huid = 1;
12
+ var suid = 1;
13
+ var runs = 0;
14
+
15
+ this.find = function(query) {
16
+ var queries = splitQuery(query);
17
+ var regexps = buildRegexps(queries);
18
+ var highlighters = buildHilighters(queries);
19
+ var state = { from: 0, pass: 0, limit: MAX_RESULTS, n: suid++};
20
+ var _this = this;
21
+
22
+ this.currentSuid = state.n;
23
+
24
+ if (!query) return;
25
+
26
+ var run = function() {
27
+ // stop current search thread if new search started
28
+ if (state.n != _this.currentSuid) return;
29
+
30
+ var results =
31
+ performSearch(_this.data, regexps, queries, highlighters, state);
32
+ var hasMore = (state.limit > 0 && state.pass < 4);
33
+
34
+ triggerResults.call(_this, results, !hasMore);
35
+ if (hasMore) {
36
+ setTimeout(run, 2);
37
+ }
38
+ runs++;
39
+ };
40
+ runs = 0;
41
+
42
+ // start search thread
43
+ run();
44
+ }
45
+
46
+ /* ----- Events ------ */
47
+ this.ready = function(fn) {
48
+ fn.huid = huid;
49
+ this.handlers.push(fn);
50
+ }
51
+
52
+ /* ----- Utilities ------ */
53
+ function splitQuery(query) {
54
+ return jQuery.grep(query.split(/(\s+|::?|\(\)?)/), function(string) {
55
+ return string.match(/\S/)
56
+ });
57
+ }
58
+
59
+ function buildRegexps(queries) {
60
+ return jQuery.map(queries, function(query) {
61
+ return new RegExp(query.replace(/(.)/g, '([$1])([^$1]*?)'), 'i')
62
+ });
63
+ }
64
+
65
+ function buildHilighters(queries) {
66
+ return jQuery.map(queries, function(query) {
67
+ return jQuery.map(query.split(''), function(l, i) {
68
+ return '\u0001$' + (i*2+1) + '\u0002$' + (i*2+2);
69
+ }).join('');
70
+ });
71
+ }
72
+
73
+ // function longMatchRegexp(index, longIndex, regexps) {
74
+ // for (var i = regexps.length - 1; i >= 0; i--){
75
+ // if (!index.match(regexps[i]) && !longIndex.match(regexps[i])) return false;
76
+ // };
77
+ // return true;
78
+ // }
79
+
80
+
81
+ /* ----- Mathchers ------ */
82
+
83
+ /*
84
+ * This record matches if the index starts with queries[0] and the record
85
+ * matches all of the regexps
86
+ */
87
+ function matchPassBeginning(index, longIndex, queries, regexps) {
88
+ if (index.indexOf(queries[0]) != 0) return false;
89
+ for (var i=1, l = regexps.length; i < l; i++) {
90
+ if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
91
+ return false;
92
+ };
93
+ return true;
94
+ }
95
+
96
+ /*
97
+ * This record matches if the longIndex starts with queries[0] and the
98
+ * longIndex matches all of the regexps
99
+ */
100
+ function matchPassLongIndex(index, longIndex, queries, regexps) {
101
+ if (longIndex.indexOf(queries[0]) != 0) return false;
102
+ for (var i=1, l = regexps.length; i < l; i++) {
103
+ if (!longIndex.match(regexps[i]))
104
+ return false;
105
+ };
106
+ return true;
107
+ }
108
+
109
+ /*
110
+ * This record matches if the index contains queries[0] and the record
111
+ * matches all of the regexps
112
+ */
113
+ function matchPassContains(index, longIndex, queries, regexps) {
114
+ if (index.indexOf(queries[0]) == -1) return false;
115
+ for (var i=1, l = regexps.length; i < l; i++) {
116
+ if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
117
+ return false;
118
+ };
119
+ return true;
120
+ }
121
+
122
+ /*
123
+ * This record matches if regexps[0] matches the index and the record
124
+ * matches all of the regexps
125
+ */
126
+ function matchPassRegexp(index, longIndex, queries, regexps) {
127
+ if (!index.match(regexps[0])) return false;
128
+ for (var i=1, l = regexps.length; i < l; i++) {
129
+ if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
130
+ return false;
131
+ };
132
+ return true;
133
+ }
134
+
135
+
136
+ /* ----- Highlighters ------ */
137
+ function highlightRegexp(info, queries, regexps, highlighters) {
138
+ var result = createResult(info);
139
+ for (var i=0, l = regexps.length; i < l; i++) {
140
+ result.title = result.title.replace(regexps[i], highlighters[i]);
141
+ result.namespace = result.namespace.replace(regexps[i], highlighters[i]);
142
+ };
143
+ return result;
144
+ }
145
+
146
+ function hltSubstring(string, pos, length) {
147
+ return string.substring(0, pos) + '\u0001' + string.substring(pos, pos + length) + '\u0002' + string.substring(pos + length);
148
+ }
149
+
150
+ function highlightQuery(info, queries, regexps, highlighters) {
151
+ var result = createResult(info);
152
+ var pos = 0;
153
+ var lcTitle = result.title.toLowerCase();
154
+
155
+ pos = lcTitle.indexOf(queries[0]);
156
+ if (pos != -1) {
157
+ result.title = hltSubstring(result.title, pos, queries[0].length);
158
+ }
159
+
160
+ result.namespace = result.namespace.replace(regexps[0], highlighters[0]);
161
+ for (var i=1, l = regexps.length; i < l; i++) {
162
+ result.title = result.title.replace(regexps[i], highlighters[i]);
163
+ result.namespace = result.namespace.replace(regexps[i], highlighters[i]);
164
+ };
165
+ return result;
166
+ }
167
+
168
+ function createResult(info) {
169
+ var result = {};
170
+ result.title = info[0];
171
+ result.namespace = info[1];
172
+ result.path = info[2];
173
+ result.params = info[3];
174
+ result.snippet = info[4];
175
+ return result;
176
+ }
177
+
178
+ /* ----- Searching ------ */
179
+ function performSearch(data, regexps, queries, highlighters, state) {
180
+ var searchIndex = data.searchIndex;
181
+ var longSearchIndex = data.longSearchIndex;
182
+ var info = data.info;
183
+ var result = [];
184
+ var i = state.from;
185
+ var l = searchIndex.length;
186
+ var togo = CHUNK_SIZE;
187
+ var matchFunc, hltFunc;
188
+
189
+ while (state.pass < 4 && state.limit > 0 && togo > 0) {
190
+ if (state.pass == 0) {
191
+ matchFunc = matchPassBeginning;
192
+ hltFunc = highlightQuery;
193
+ } else if (state.pass == 1) {
194
+ matchFunc = matchPassLongIndex;
195
+ hltFunc = highlightQuery;
196
+ } else if (state.pass == 2) {
197
+ matchFunc = matchPassContains;
198
+ hltFunc = highlightQuery;
199
+ } else if (state.pass == 3) {
200
+ matchFunc = matchPassRegexp;
201
+ hltFunc = highlightRegexp;
202
+ }
203
+
204
+ for (; togo > 0 && i < l && state.limit > 0; i++, togo--) {
205
+ if (info[i].n == state.n) continue;
206
+ if (matchFunc(searchIndex[i], longSearchIndex[i], queries, regexps)) {
207
+ info[i].n = state.n;
208
+ result.push(hltFunc(info[i], queries, regexps, highlighters));
209
+ state.limit--;
210
+ }
211
+ };
212
+ if (searchIndex.length <= i) {
213
+ state.pass++;
214
+ i = state.from = 0;
215
+ } else {
216
+ state.from = i;
217
+ }
218
+ }
219
+ return result;
220
+ }
221
+
222
+ function triggerResults(results, isLast) {
223
+ jQuery.each(this.handlers, function(i, fn) {
224
+ fn.call(this, results, isLast)
225
+ })
226
+ }
227
+ }
228
+