maglev-webtools 0.2.1 → 1.0

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 (296) hide show
  1. data/README.rdoc +38 -29
  2. data/bin/webtools +22 -1
  3. data/lib/web_tools/code_browser.rb +156 -0
  4. data/lib/web_tools/debugger.rb +96 -199
  5. data/lib/web_tools/info.rb +1 -3
  6. data/lib/web_tools/method_list.rb +67 -0
  7. data/lib/web_tools/middleware/debugger.rb +10 -16
  8. data/lib/web_tools/object_log.rb +24 -0
  9. data/lib/web_tools/session_list.rb +119 -0
  10. data/lib/web_tools/shared_page_cache.rb +30 -0
  11. data/lib/web_tools/stat_process.rb +24 -0
  12. data/lib/web_tools/statistics.rb +14 -0
  13. data/lib/web_tools/support/app_model.rb +66 -101
  14. data/lib/web_tools/support/code_browser.rb +88 -86
  15. data/lib/web_tools/support/debugger.rb +303 -0
  16. data/lib/web_tools/support/error_log.rb +33 -0
  17. data/lib/web_tools/support/ruby.rb +60 -121
  18. data/lib/web_tools/support/service_helper.rb +38 -10
  19. data/lib/web_tools/support/smalltalk_extensions.rb +12 -0
  20. data/lib/web_tools/tool.rb +48 -0
  21. data/lib/web_tools/ui.rb +14 -53
  22. data/lib/web_tools/version_report.rb +29 -0
  23. data/lib/web_tools/workspace.rb +77 -0
  24. data/lib/web_tools.rb +14 -4
  25. data/public/CodeBrowser.html +51 -0
  26. data/public/CodeMirror/LICENSE +19 -0
  27. data/public/CodeMirror/css/codemirror.css +67 -0
  28. data/public/CodeMirror/css/default.css +18 -0
  29. data/public/CodeMirror/js/codemirror.js +2131 -0
  30. data/public/CodeMirror/js/ruby.js +195 -0
  31. data/public/CodeMirror/js/smalltalk.js +139 -0
  32. data/public/Debugger.html +28 -0
  33. data/public/MethodList.html +20 -0
  34. data/public/ObjectLog.html +20 -0
  35. data/public/SessionList.html +31 -0
  36. data/public/SharedPageCache.html +78 -0
  37. data/public/Statistics.html +64 -0
  38. data/public/VersionReport.html +50 -0
  39. data/public/Workspace.html +39 -0
  40. data/public/css/CodeBrowser.css +24 -0
  41. data/public/css/Debugger.css +32 -0
  42. data/public/css/MethodList.css +8 -0
  43. data/public/css/ObjectLog.css +5 -0
  44. data/public/css/SessionList.css +9 -0
  45. data/public/css/Statistics.css +24 -0
  46. data/public/{stylesheets → css}/base/images/ui-anim_basic_16x16.gif +0 -0
  47. data/public/{stylesheets → css}/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  48. data/public/{stylesheets → css}/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  49. data/public/{stylesheets → css}/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  50. data/public/{stylesheets → css}/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  51. data/public/{stylesheets → css}/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  52. data/public/{stylesheets → css}/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  53. data/public/{stylesheets → css}/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  54. data/public/{stylesheets → css}/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  55. data/public/{stylesheets → css}/base/images/ui-icons_222222_256x240.png +0 -0
  56. data/public/{stylesheets → css}/base/images/ui-icons_2e83ff_256x240.png +0 -0
  57. data/public/{stylesheets → css}/base/images/ui-icons_454545_256x240.png +0 -0
  58. data/public/{stylesheets → css}/base/images/ui-icons_888888_256x240.png +0 -0
  59. data/public/{stylesheets → css}/base/images/ui-icons_cd0a0a_256x240.png +0 -0
  60. data/public/{stylesheets → css}/base/jquery.ui.accordion.css +0 -0
  61. data/public/{stylesheets → css}/base/jquery.ui.all.css +0 -0
  62. data/public/{stylesheets → css}/base/jquery.ui.autocomplete.css +0 -0
  63. data/public/{stylesheets → css}/base/jquery.ui.base.css +0 -0
  64. data/public/{stylesheets → css}/base/jquery.ui.button.css +0 -0
  65. data/public/{stylesheets → css}/base/jquery.ui.core.css +0 -0
  66. data/public/{stylesheets → css}/base/jquery.ui.datepicker.css +0 -0
  67. data/public/{stylesheets → css}/base/jquery.ui.dialog.css +0 -0
  68. data/public/{stylesheets → css}/base/jquery.ui.progressbar.css +0 -0
  69. data/public/{stylesheets → css}/base/jquery.ui.resizable.css +0 -0
  70. data/public/{stylesheets → css}/base/jquery.ui.selectable.css +0 -0
  71. data/public/{stylesheets → css}/base/jquery.ui.slider.css +0 -0
  72. data/public/{stylesheets → css}/base/jquery.ui.tabs.css +0 -0
  73. data/public/{stylesheets → css}/base/jquery.ui.theme.css +0 -0
  74. data/public/css/editor.css +25 -0
  75. data/public/css/jjmenu.css +33 -0
  76. data/public/css/menuitem.gif +0 -0
  77. data/public/css/more.gif +0 -0
  78. data/public/{stylesheets → css}/reset.css +1 -1
  79. data/public/css/smoothness/images/ui-anim_basic_16x16.gif +0 -0
  80. data/public/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  81. data/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  82. data/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  83. data/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  84. data/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  85. data/public/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  86. data/public/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  87. data/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  88. data/public/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
  89. data/public/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  90. data/public/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
  91. data/public/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
  92. data/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  93. data/public/css/smoothness/jquery-ui.css +489 -0
  94. data/public/css/ui-lightness/images/ui-anim_basic_16x16.gif +0 -0
  95. data/public/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  96. data/public/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  97. data/public/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  98. data/public/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  99. data/public/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  100. data/public/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  101. data/public/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  102. data/public/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  103. data/public/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  104. data/public/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  105. data/public/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  106. data/public/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  107. data/public/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  108. data/public/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  109. data/public/css/ui-lightness/jquery-ui.css +489 -0
  110. data/public/css/webtools.css +65 -0
  111. data/public/favicon.ico +0 -0
  112. data/public/flot/API.txt +1201 -0
  113. data/public/flot/FAQ.txt +76 -0
  114. data/public/flot/LICENSE.txt +22 -0
  115. data/public/flot/Makefile +9 -0
  116. data/public/flot/NEWS.txt +508 -0
  117. data/public/flot/PLUGINS.txt +137 -0
  118. data/public/flot/README.txt +90 -0
  119. data/public/flot/examples/ajax.html +143 -0
  120. data/public/flot/examples/annotating.html +75 -0
  121. data/public/flot/examples/arrow-down.gif +0 -0
  122. data/public/flot/examples/arrow-left.gif +0 -0
  123. data/public/flot/examples/arrow-right.gif +0 -0
  124. data/public/flot/examples/arrow-up.gif +0 -0
  125. data/public/flot/examples/basic.html +38 -0
  126. data/public/flot/examples/data-eu-gdp-growth-1.json +4 -0
  127. data/public/flot/examples/data-eu-gdp-growth-2.json +4 -0
  128. data/public/flot/examples/data-eu-gdp-growth-3.json +4 -0
  129. data/public/flot/examples/data-eu-gdp-growth-4.json +4 -0
  130. data/public/flot/examples/data-eu-gdp-growth-5.json +4 -0
  131. data/public/flot/examples/data-eu-gdp-growth.json +4 -0
  132. data/public/flot/examples/data-japan-gdp-growth.json +4 -0
  133. data/public/flot/examples/data-usa-gdp-growth.json +4 -0
  134. data/public/flot/examples/graph-types.html +75 -0
  135. data/public/flot/examples/hs-2004-27-a-large_web.jpg +0 -0
  136. data/public/flot/examples/image.html +45 -0
  137. data/public/flot/examples/index.html +44 -0
  138. data/public/flot/examples/interacting-axes.html +97 -0
  139. data/public/flot/examples/interacting.html +93 -0
  140. data/public/flot/examples/layout.css +6 -0
  141. data/public/flot/examples/multiple-axes.html +60 -0
  142. data/public/flot/examples/navigate.html +118 -0
  143. data/public/flot/examples/percentiles.html +57 -0
  144. data/public/flot/examples/pie.html +756 -0
  145. data/public/flot/examples/realtime.html +83 -0
  146. data/public/flot/examples/resize.html +61 -0
  147. data/public/flot/examples/selection.html +114 -0
  148. data/public/flot/examples/setting-options.html +61 -0
  149. data/public/flot/examples/stacking.html +77 -0
  150. data/public/flot/examples/symbols.html +49 -0
  151. data/public/flot/examples/thresholding.html +54 -0
  152. data/public/flot/examples/time.html +71 -0
  153. data/public/flot/examples/tracking.html +95 -0
  154. data/public/flot/examples/turning-series.html +98 -0
  155. data/public/flot/examples/visitors.html +90 -0
  156. data/public/flot/examples/zooming.html +98 -0
  157. data/public/flot/excanvas.js +1427 -0
  158. data/public/flot/excanvas.min.js +1 -0
  159. data/public/flot/jquery.colorhelpers.js +179 -0
  160. data/public/flot/jquery.colorhelpers.min.js +1 -0
  161. data/public/flot/jquery.flot.crosshair.js +167 -0
  162. data/public/flot/jquery.flot.crosshair.min.js +1 -0
  163. data/public/flot/jquery.flot.fillbetween.js +183 -0
  164. data/public/flot/jquery.flot.fillbetween.min.js +1 -0
  165. data/public/flot/jquery.flot.image.js +238 -0
  166. data/public/flot/jquery.flot.image.min.js +1 -0
  167. data/public/flot/jquery.flot.js +2599 -0
  168. data/public/flot/jquery.flot.min.js +6 -0
  169. data/public/flot/jquery.flot.navigate.js +336 -0
  170. data/public/flot/jquery.flot.navigate.min.js +1 -0
  171. data/public/flot/jquery.flot.pie.js +750 -0
  172. data/public/flot/jquery.flot.pie.min.js +1 -0
  173. data/public/flot/jquery.flot.resize.js +60 -0
  174. data/public/flot/jquery.flot.resize.min.js +1 -0
  175. data/public/flot/jquery.flot.selection.js +344 -0
  176. data/public/flot/jquery.flot.selection.min.js +1 -0
  177. data/public/flot/jquery.flot.stack.js +184 -0
  178. data/public/flot/jquery.flot.stack.min.js +1 -0
  179. data/public/flot/jquery.flot.symbol.js +70 -0
  180. data/public/flot/jquery.flot.symbol.min.js +1 -0
  181. data/public/flot/jquery.flot.threshold.js +103 -0
  182. data/public/flot/jquery.flot.threshold.min.js +1 -0
  183. data/public/flot/jquery.js +8316 -0
  184. data/public/flot/jquery.min.js +23 -0
  185. data/public/genPacking.pl +30 -0
  186. data/public/index.html +28 -0
  187. data/public/install.tpz +66 -0
  188. data/public/installAndRun.tpz +5 -0
  189. data/public/jsTree/jquery.jstree.js +3510 -0
  190. data/public/jsTree/themes/default/d.gif +0 -0
  191. data/public/jsTree/themes/default/d.png +0 -0
  192. data/public/jsTree/themes/default/style.css +73 -0
  193. data/public/jsTree/themes/default/throbber.gif +0 -0
  194. data/public/readMe.txt +9 -0
  195. data/public/scripts/CodeBrowser.js +645 -0
  196. data/public/scripts/Debugger.js +134 -0
  197. data/public/scripts/MethodList.js +72 -0
  198. data/public/scripts/ObjectLog.js +59 -0
  199. data/public/scripts/SessionList.js +164 -0
  200. data/public/scripts/Statistics.js +266 -0
  201. data/public/scripts/editor.js +430 -0
  202. data/public/scripts/jjmenu.js +375 -0
  203. data/public/scripts/jquery-ui.js +1012 -0
  204. data/public/scripts/jquery.js +154 -0
  205. data/public/scripts/webtools.js +374 -0
  206. data/public/src/CodeBrowser.gs +416 -0
  207. data/public/src/Debugger.gs +132 -0
  208. data/public/src/MethodList.gs +130 -0
  209. data/public/src/ObjectLog.gs +73 -0
  210. data/public/src/Server.gs +544 -0
  211. data/public/src/SessionList.gs +172 -0
  212. data/public/src/SharedPageCache.gs +66 -0
  213. data/public/src/StatProcess.gs +280 -0
  214. data/public/src/StatProcessType.gs +242 -0
  215. data/public/src/StatStatistic.gs +381 -0
  216. data/public/src/Statistics.gs +222 -0
  217. data/public/src/Statmonitor.gs +490 -0
  218. data/public/src/Tool.gs +86 -0
  219. data/public/src/VersionReport.gs +52 -0
  220. data/public/src/Workspace.gs +163 -0
  221. data/views/debugger.rhtml +6 -9
  222. metadata +344 -243
  223. data/lib/web_tools/#debugger.rb# +0 -212
  224. data/lib/web_tools/browser.rb +0 -45
  225. data/public/images/favicon.ico +0 -0
  226. data/public/javascript/CodeMirror/LICENSE +0 -23
  227. data/public/javascript/CodeMirror/css/Smalltalk.css +0 -34
  228. data/public/javascript/CodeMirror/js/codemirror.js +0 -582
  229. data/public/javascript/CodeMirror/js/editor.js +0 -1671
  230. data/public/javascript/CodeMirror/js/highlight.js +0 -68
  231. data/public/javascript/CodeMirror/js/parseSmalltalk.js +0 -126
  232. data/public/javascript/CodeMirror/js/parsedummy.js +0 -32
  233. data/public/javascript/CodeMirror/js/select.js +0 -699
  234. data/public/javascript/CodeMirror/js/stringstream.js +0 -159
  235. data/public/javascript/CodeMirror/js/tokenize.js +0 -57
  236. data/public/javascript/CodeMirror/js/undo.js +0 -413
  237. data/public/javascript/CodeMirror/js/util.js +0 -133
  238. data/public/javascript/CodeMirror/testSmalltalkParser.html +0 -116
  239. data/public/javascript/ace/ace-uncompressed.js +0 -17299
  240. data/public/javascript/ace/ace.js +0 -1
  241. data/public/javascript/ace/keybinding-emacs.js +0 -1
  242. data/public/javascript/ace/keybinding-vim.js +0 -1
  243. data/public/javascript/ace/mode-c_cpp.js +0 -1
  244. data/public/javascript/ace/mode-clojure.js +0 -1
  245. data/public/javascript/ace/mode-coffee.js +0 -1
  246. data/public/javascript/ace/mode-csharp.js +0 -1
  247. data/public/javascript/ace/mode-css.js +0 -1
  248. data/public/javascript/ace/mode-groovy.js +0 -1
  249. data/public/javascript/ace/mode-html.js +0 -1
  250. data/public/javascript/ace/mode-java.js +0 -1
  251. data/public/javascript/ace/mode-javascript.js +0 -1
  252. data/public/javascript/ace/mode-json.js +0 -1
  253. data/public/javascript/ace/mode-lua.js +0 -1
  254. data/public/javascript/ace/mode-markdown.js +0 -1
  255. data/public/javascript/ace/mode-ocaml.js +0 -1
  256. data/public/javascript/ace/mode-perl.js +0 -1
  257. data/public/javascript/ace/mode-php.js +0 -1
  258. data/public/javascript/ace/mode-python.js +0 -1
  259. data/public/javascript/ace/mode-ruby.js +0 -1
  260. data/public/javascript/ace/mode-scad.js +0 -1
  261. data/public/javascript/ace/mode-scala.js +0 -1
  262. data/public/javascript/ace/mode-scss.js +0 -1
  263. data/public/javascript/ace/mode-svg.js +0 -1
  264. data/public/javascript/ace/mode-textile.js +0 -1
  265. data/public/javascript/ace/mode-xml.js +0 -1
  266. data/public/javascript/ace/theme-clouds.js +0 -1
  267. data/public/javascript/ace/theme-clouds_midnight.js +0 -1
  268. data/public/javascript/ace/theme-cobalt.js +0 -1
  269. data/public/javascript/ace/theme-crimson_editor.js +0 -1
  270. data/public/javascript/ace/theme-dawn.js +0 -1
  271. data/public/javascript/ace/theme-eclipse.js +0 -1
  272. data/public/javascript/ace/theme-idle_fingers.js +0 -1
  273. data/public/javascript/ace/theme-kr_theme.js +0 -1
  274. data/public/javascript/ace/theme-merbivore.js +0 -1
  275. data/public/javascript/ace/theme-merbivore_soft.js +0 -1
  276. data/public/javascript/ace/theme-mono_industrial.js +0 -1
  277. data/public/javascript/ace/theme-monokai.js +0 -1
  278. data/public/javascript/ace/theme-pastel_on_dark.js +0 -1
  279. data/public/javascript/ace/theme-solarized_dark.js +0 -1
  280. data/public/javascript/ace/theme-solarized_light.js +0 -1
  281. data/public/javascript/ace/theme-textmate.js +0 -1
  282. data/public/javascript/ace/theme-twilight.js +0 -1
  283. data/public/javascript/ace/theme-vibrant_ink.js +0 -1
  284. data/public/javascript/ace/worker-coffee.js +0 -1
  285. data/public/javascript/ace/worker-css.js +0 -1
  286. data/public/javascript/ace/worker-javascript.js +0 -1
  287. data/public/javascript/webtools/browser.js +0 -260
  288. data/public/javascript/webtools/debugger.coffee +0 -286
  289. data/public/javascript/webtools/debugger.js +0 -366
  290. data/public/javascript/webtools/sessions.coffee +0 -17
  291. data/public/javascript/webtools/sessions.js +0 -27
  292. data/public/javascript/webtools/version.coffee +0 -14
  293. data/public/javascript/webtools/version.js +0 -20
  294. data/public/stylesheets/jquery.contextMenu.css +0 -62
  295. data/public/stylesheets/webtools.css +0 -53
  296. data/public/test.html +0 -47
@@ -0,0 +1,416 @@
1
+ doit
2
+ Tool subclass: 'CodeBrowser'
3
+ instVarNames: #( dictionary package classCategory
4
+ klass superList superClass methodFilter
5
+ selector implementor)
6
+ classVars: #()
7
+ classInstVars: #()
8
+ poolDictionaries: #()
9
+ inDictionary: WebTools
10
+ options: #()
11
+
12
+ %
13
+
14
+ ! Remove existing behavior from CodeBrowser
15
+ doit
16
+ CodeBrowser removeAllMethods.
17
+ CodeBrowser class removeAllMethods.
18
+ %
19
+ ! ------------------- Class methods for CodeBrowser
20
+ category: 'other'
21
+ set compile_env: 0
22
+ classmethod: CodeBrowser
23
+ description
24
+
25
+ ^'Browse SymbolDictionaries, Classes, and Methods'.
26
+ %
27
+ category: 'other'
28
+ set compile_env: 0
29
+ classmethod: CodeBrowser
30
+ displayName
31
+
32
+ ^'Code Browser'.
33
+ %
34
+ category: 'other'
35
+ set compile_env: 0
36
+ classmethod: CodeBrowser
37
+ sortOrder
38
+
39
+ ^3.
40
+ %
41
+ ! ------------------- Instance methods for CodeBrowser
42
+ category: 'Public'
43
+ set compile_env: 0
44
+ method: CodeBrowser
45
+ json
46
+
47
+ ^Dictionary new
48
+ at: 'response' put: self _response;
49
+ at: 'dictList' put: self _dictList;
50
+ at: 'packageList' put: self _packageList;
51
+ at: 'classCatList' put: self _classCategoryList;
52
+ at: 'classList' put: self _classList;
53
+ at: 'classDef' put: self _classDefinition;
54
+ at: 'superList' put: self _superList;
55
+ at: 'methodFilterList' put: self _methodFilterList;
56
+ at: 'methodList' put: self _methodList;
57
+ at: 'implList' put: self _implementorList;
58
+ at: 'method' put: self _method;
59
+ yourself.
60
+ %
61
+ category: 'Public'
62
+ set compile_env: 0
63
+ method: CodeBrowser
64
+ removeClass
65
+
66
+ | dict name |
67
+ dict := (arguments at: 'dict') asSymbol.
68
+ name := (arguments at: 'klass') asSymbol.
69
+ dict := System myUserProfile symbolList
70
+ detect: [:each | each name == dict]
71
+ ifNone: [^Dictionary new
72
+ at: 'error' put: 'Dictionary not found!';
73
+ yourself].
74
+ dict
75
+ removeKey: name
76
+ ifAbsent: [^Dictionary new
77
+ at: 'error' put: 'Class not found!';
78
+ yourself].
79
+ ^Dictionary new.
80
+ %
81
+ category: 'Public'
82
+ set compile_env: 0
83
+ method: CodeBrowser
84
+ removeMethod
85
+
86
+ dictionary := (arguments at: 'dict') asSymbol.
87
+ dictionary := System myUserProfile symbolList detect: [:each | each name == dictionary].
88
+ klass := (arguments at: 'klass') asSymbol.
89
+ klass := dictionary at: klass.
90
+ (arguments at: 'isMeta') ifTrue: [klass := klass class].
91
+ klass removeSelector: (arguments at: 'name') asSymbol.
92
+ ^Dictionary new.
93
+ %
94
+ category: 'Private'
95
+ set compile_env: 0
96
+ method: CodeBrowser
97
+ _classCategoryList
98
+
99
+ | selected set |
100
+ classCategory := nil.
101
+ dictionary isNil ifTrue: [^#()].
102
+ selected := arguments at: 'classCat' ifAbsent: [nil].
103
+ set := Set new.
104
+ dictionary do: [:each |
105
+ each isClass ifTrue: [
106
+ | category |
107
+ category := each category.
108
+ set add: category.
109
+ (category notNil and: [
110
+ category = selected or: [
111
+ selected size <= category size and: [
112
+ selected = (category copyFrom: 1 to: selected size)]]]) ifTrue: [
113
+ classCategory := selected.
114
+ ].
115
+ ].
116
+ ].
117
+ ^set asSortedCollection.
118
+ %
119
+ category: 'Private'
120
+ set compile_env: 0
121
+ method: CodeBrowser
122
+ _classDefinition
123
+
124
+ ^klass notNil
125
+ ifTrue: [klass thisClass definition]
126
+ ifFalse: [
127
+ ^'Object subclass: ''MyNewClass''
128
+ instVarNames: #( instVar1 instVar2 )
129
+ classVars: #()
130
+ classInstVars: #()
131
+ poolDictionaries: #()
132
+ inDictionary: ' , (dictionary isNil ifTrue: ['UserGlobals'] ifFalse: [dictionary name]) , '
133
+ options: #()'].
134
+ %
135
+ category: 'Private'
136
+ set compile_env: 0
137
+ method: CodeBrowser
138
+ _classList
139
+
140
+ | selected list |
141
+ klass := nil.
142
+ dictionary isNil ifTrue: [^#()].
143
+ selected := arguments at: 'klass' ifAbsent: [nil].
144
+ selected notNil ifTrue: [selected := selected asSymbol].
145
+ list := dictionary select: [:each |
146
+ each isClass and: [
147
+ | category |
148
+ each name = selected ifTrue: [klass := each].
149
+ category := each category.
150
+ classCategory isNil or: [category = classCategory or: [
151
+ (category isKindOf: String) and: [(classCategory isKindOf: String) and: [
152
+ classCategory size <= category size and: [
153
+ classCategory = (category copyFrom: 1 to: classCategory size)]]]]]]
154
+ ].
155
+ (arguments at: 'isMeta' ifAbsent: [false]) ifTrue: [klass := klass class].
156
+ ^(list collect: [:each | each name]) asSortedCollection.
157
+ %
158
+ category: 'Private'
159
+ set compile_env: 0
160
+ method: CodeBrowser
161
+ _dictList
162
+
163
+ | selected list |
164
+ dictionary := nil.
165
+ (arguments at: 'isDictsTab') ifFalse: [^#()].
166
+ selected := arguments at: 'dict' ifAbsent: [nil].
167
+ list := System myUserProfile symbolList.
168
+ dictionary := list
169
+ detect: [:each | each name asString = selected]
170
+ ifNone: [nil].
171
+ ^list collect: [:each | each name].
172
+ %
173
+ category: 'Private'
174
+ set compile_env: 0
175
+ method: CodeBrowser
176
+ _implementorList
177
+
178
+ | selected list |
179
+ selected := arguments at: 'implementor' ifAbsent: [nil].
180
+ implementor := nil.
181
+ superList isEmpty ifTrue: [^#()].
182
+ list := superList select: [:each | each selectors includes: selector].
183
+ implementor := list
184
+ detect: [:each | each name asString = selected]
185
+ ifNone: [superList last].
186
+ ^list collect: [:each | each name].
187
+ %
188
+ category: 'Private'
189
+ set compile_env: 0
190
+ method: CodeBrowser
191
+ _instanceVariableList
192
+
193
+ | selected list |
194
+ selected := arguments at: 'methodFilter' ifAbsent: [nil].
195
+ selected notNil ifTrue: [selected := selected asSymbol].
196
+ methodFilter := nil.
197
+ superList isEmpty ifTrue: [^#()].
198
+ list := klass allInstVarNames.
199
+ (list includes: selected) ifTrue: [methodFilter := selected].
200
+ ^list.
201
+ %
202
+ category: 'Private'
203
+ set compile_env: 0
204
+ method: CodeBrowser
205
+ _method
206
+
207
+ | method |
208
+ implementor isNil ifTrue: [^nil].
209
+ selector isNil ifTrue: [^nil].
210
+ method := implementor compiledMethodAt: selector.
211
+ ^Dictionary new
212
+ at: 'dictionaryName' put: dictionary name;
213
+ at: 'className' put: klass thisClass name;
214
+ at: 'isMeta' put: klass isMeta;
215
+ at: 'category' put: (klass categoryOfSelector: selector);
216
+ at: 'source' put: method sourceString;
217
+ at: 'stepPoints' put: method _sourceOffsets;
218
+ at: 'sends' put: method _sourceOffsetsOfSends;
219
+ yourself.
220
+ %
221
+ category: 'Private'
222
+ set compile_env: 0
223
+ method: CodeBrowser
224
+ _methodCategoryList
225
+
226
+ | selected list |
227
+ selected := arguments at: 'methodFilter' ifAbsent: [nil].
228
+ selected notNil ifTrue: [selected := selected asSymbol].
229
+ methodFilter := nil.
230
+ superList isEmpty ifTrue: [^#()].
231
+ list := Set new.
232
+ (superList indexOf: superClass)
233
+ to: superList size
234
+ do: [:i | list addAll: (superList at: i) categoryNames].
235
+ list := list asSortedCollection.
236
+ (list includes: selected) ifTrue: [methodFilter := selected].
237
+ ^list.
238
+ %
239
+ category: 'Private'
240
+ set compile_env: 0
241
+ method: CodeBrowser
242
+ _methodFilterList
243
+
244
+ | filterBy |
245
+ filterBy := arguments at: 'methodFilterBy'.
246
+ filterBy = 'category' ifTrue: [^self _methodCategoryList].
247
+ filterBy = 'variable' ifTrue: [^self _instanceVariableList].
248
+ ^#().
249
+ %
250
+ category: 'Private'
251
+ set compile_env: 0
252
+ method: CodeBrowser
253
+ _methodList
254
+
255
+ | selected set |
256
+ selected := arguments at: 'selector' ifAbsent: [nil].
257
+ selected notNil ifTrue: [selected := selected asSymbol].
258
+ selector := nil.
259
+ superList isEmpty ifTrue: [^#()].
260
+ set := Set new.
261
+ (superList indexOf: superClass)
262
+ to: superList size
263
+ do: [:i |
264
+ | behavior selectors |
265
+ behavior := superList at: i.
266
+ selectors := methodFilter isNil
267
+ ifTrue: [behavior selectors]
268
+ ifFalse: [self _methodListFor: behavior].
269
+ set addAll: selectors.
270
+ ].
271
+ (set includes: selected) ifTrue: [selector := selected].
272
+ ^set asSortedCollection.
273
+ %
274
+ category: 'Private'
275
+ set compile_env: 0
276
+ method: CodeBrowser
277
+ _methodListByCategoryFor: aBehavior
278
+
279
+ ^(aBehavior categoryNames includes: methodFilter)
280
+ ifTrue: [aBehavior selectorsIn: methodFilter]
281
+ ifFalse: [#()].
282
+ %
283
+ category: 'Private'
284
+ set compile_env: 0
285
+ method: CodeBrowser
286
+ _methodListByVariableFor: aBehavior
287
+
288
+ | symbol |
289
+ symbol := methodFilter asSymbol.
290
+ ^aBehavior selectors asSortedCollection asArray select: [:each |
291
+ (aBehavior compiledMethodAt: each) instVarsAccessed includes: symbol.
292
+ ].
293
+ %
294
+ category: 'Private'
295
+ set compile_env: 0
296
+ method: CodeBrowser
297
+ _methodListFor: aBehavior
298
+
299
+ | filterBy |
300
+ filterBy := arguments at: 'methodFilterBy'.
301
+ filterBy = 'category' ifTrue: [^self _methodListByCategoryFor: aBehavior].
302
+ filterBy = 'variable' ifTrue: [^self _methodListByVariableFor: aBehavior].
303
+ ^#().
304
+ %
305
+ category: 'Private'
306
+ set compile_env: 0
307
+ method: CodeBrowser
308
+ _packageList
309
+
310
+ | mcWorkingCopyClass selected list workingCopy |
311
+ package := nil.
312
+ (arguments at: 'isDictsTab') ifTrue: [^#()].
313
+ mcWorkingCopyClass := GsSession currentSession objectNamed: #'MCWorkingCopy'.
314
+ mcWorkingCopyClass isNil ifTrue: [^#()].
315
+ selected := arguments at: 'mcPackage' ifAbsent: [nil].
316
+ list := mcWorkingCopyClass allManagers.
317
+ list := list collect: [:each |
318
+ | name |
319
+ name := each packageName.
320
+ name = selected ifTrue: [package := each].
321
+ name.
322
+ ].
323
+ workingCopy := mcWorkingCopyClass allManagers
324
+ detect: [:each | each package name = selected]
325
+ ifNone: [nil].
326
+ dictionary := nil.
327
+ workingCopy notNil ifTrue: [
328
+ dictionary := SymbolDictionary new.
329
+ dictionary at: #'UserGlobals' put: dictionary.
330
+ workingCopy package packageInfo classes do: [:each | dictionary at: each name put: each].
331
+ ].
332
+ ^list asSortedCollection.
333
+ %
334
+ category: 'Private'
335
+ set compile_env: 0
336
+ method: CodeBrowser
337
+ _response
338
+
339
+ ^(arguments at: 'selector' ifAbsent: [nil]) notNil ifTrue: [
340
+ nil.
341
+ ] ifFalse: [
342
+ self _responseForClass.
343
+ ].
344
+ %
345
+ category: 'Private'
346
+ set compile_env: 0
347
+ method: CodeBrowser
348
+ _responseForClass
349
+
350
+ | request result symbolList dict response |
351
+ (request := arguments at: 'request' ifAbsent: [^nil]) isNil ifTrue: [^nil].
352
+ result := [
353
+ request evaluate.
354
+ ] on: Error do: [:ex |
355
+ | error |
356
+ error := Array new
357
+ add: ex class name;
358
+ add: ex description;
359
+ yourself.
360
+ (ex isKindOf: CompileError) ifTrue: [
361
+ error add: ex gsArguments.
362
+ ].
363
+ ^Dictionary new
364
+ at: 'action' put: 'klass';
365
+ at: 'error' put: error;
366
+ yourself.
367
+ ].
368
+ (result isKindOf: Class) ifTrue: [
369
+ symbolList := GsSession currentSession symbolList.
370
+ dict := symbolList
371
+ detect: [:each | each includes: result]
372
+ ifNone: [^nil].
373
+ response := Dictionary new
374
+ at: 'dict' put: dict name asString;
375
+ at: 'classCat' put: nil;
376
+ at: 'klass' put: result name asString;
377
+ at: 'isMeta' put: false;
378
+ at: 'superClass' put: result name asString;
379
+ at: 'methodCat' put: nil;
380
+ at: 'selector' put: nil;
381
+ at: 'implementor' put: nil;
382
+ yourself.
383
+ response keysAndValuesDo: [:key :value |
384
+ arguments at: key put: value.
385
+ ].
386
+ ^response
387
+ at: 'action' put: 'klass';
388
+ yourself.
389
+ ].
390
+ ^nil.
391
+ %
392
+ category: 'Private'
393
+ set compile_env: 0
394
+ method: CodeBrowser
395
+ _superList
396
+
397
+ | selected nextClass |
398
+ superList := Array new.
399
+ superClass := nil.
400
+ klass isNil ifTrue: [^#()].
401
+ selected := arguments at: 'superClass' ifAbsent: [klass name].
402
+ nextClass := klass.
403
+ [
404
+ nextClass notNil.
405
+ ] whileTrue: [
406
+ superList add: nextClass.
407
+ nextClass name asString = selected ifTrue: [superClass := nextClass].
408
+ nextClass := nextClass superclass.
409
+ ].
410
+ superList := superList reverse.
411
+ superClass isNil ifTrue: [superClass := superList last].
412
+ ^superList collect: [:each | each name].
413
+ %
414
+ doit
415
+ CodeBrowser category: 'WebTools'
416
+ %
@@ -0,0 +1,132 @@
1
+ doit
2
+ Tool subclass: 'Debugger'
3
+ instVarNames: #()
4
+ classVars: #()
5
+ classInstVars: #()
6
+ poolDictionaries: #()
7
+ inDictionary: WebTools
8
+ options: #()
9
+
10
+ %
11
+
12
+ ! Remove existing behavior from Debugger
13
+ doit
14
+ Debugger removeAllMethods.
15
+ Debugger class removeAllMethods.
16
+ %
17
+ ! ------------------- Class methods for Debugger
18
+ ! ------------------- Instance methods for Debugger
19
+ category: 'Public'
20
+ set compile_env: 0
21
+ method: Debugger
22
+ frame
23
+
24
+ | result entry process frameData |
25
+ result := Dictionary new.
26
+ (entry := self _objectLogEntry) isNil ifTrue: [^result].
27
+ (process := entry continuation) isNil ifTrue: [^result].
28
+ (frameData := process _localFrameContentsAt: (arguments at: 'frame') asNumber) isNil ifTrue: [^result].
29
+ ^result
30
+ at: 'method' put: (self _methodFromFrameData: frameData);
31
+ at: 'variables' put: (self _variablesFromFrameData: frameData);
32
+ yourself.
33
+ %
34
+ category: 'Public'
35
+ set compile_env: 0
36
+ method: Debugger
37
+ json
38
+
39
+ | entry process stack |
40
+ (entry := self _objectLogEntry) isNil ifTrue: [^Dictionary new].
41
+ (process := entry continuation) isNil ifTrue: [^Dictionary new].
42
+ stack := process _reportOfSize: process stackDepth.
43
+ ^Dictionary new
44
+ at: 'label' put: entry label;
45
+ at: 'stack' put: stack;
46
+ yourself.
47
+ %
48
+ category: 'Public'
49
+ set compile_env: 0
50
+ method: Debugger
51
+ step
52
+
53
+ ^Dictionary new
54
+ at: 'foo' put: 'bar';
55
+ yourself.
56
+ %
57
+ category: 'Public'
58
+ set compile_env: 0
59
+ method: Debugger
60
+ _methodFromFrameData: anArray
61
+
62
+ | result method inClass |
63
+ result := Dictionary new.
64
+ (method := anArray at: 1) isNil ifTrue: [^result].
65
+ result
66
+ at: 'source' put: method sourceString;
67
+ at: 'stepPoints' put: method _sourceOffsets;
68
+ at: 'sends' put: method _sourceOffsetsOfSends;
69
+ at: 'nowAt' put: (method homeMethod _stepPointForMeth: method ip: (anArray at: 2));
70
+ yourself.
71
+ (inClass := method inClass) notNil ifTrue: [
72
+ | dictionary |
73
+ dictionary := System myUserProfile symbolList
74
+ detect: [:each | each includes: inClass thisClass]
75
+ ifNone: [nil].
76
+ dictionary notNil ifTrue: [dictionary := dictionary name].
77
+ result
78
+ at: 'dictionaryName' put: dictionary;
79
+ at: 'className' put: inClass thisClass name;
80
+ at: 'isMeta' put: inClass isMeta;
81
+ yourself.
82
+ ].
83
+ ^result.
84
+ %
85
+ category: 'Public'
86
+ set compile_env: 0
87
+ method: Debugger
88
+ _objectLogEntry
89
+
90
+ | objectLogEntryClass oop |
91
+ objectLogEntryClass := System myUserProfile symbolList objectNamed: #'ObjectLogEntry'.
92
+ objectLogEntryClass isNil ifTrue: [^nil].
93
+ oop := (arguments at: 'oop') asNumber.
94
+ ^objectLogEntryClass objectLog
95
+ detect: [:each | each asOop = oop]
96
+ ifNone: [nil].
97
+ %
98
+ category: 'Public'
99
+ set compile_env: 0
100
+ method: Debugger
101
+ _variablesFromFrameData: anArray
102
+
103
+ | list names |
104
+ list := Array new.
105
+ list add: (Dictionary new
106
+ at: 'name' put: 'self';
107
+ at: 'string' put: (anArray at: 8) printString;
108
+ at: 'oop' put: (anArray at: 8) asOop;
109
+ yourself).
110
+ ((anArray at: 8) ~~ (anArray at: 10)) ifTrue: [
111
+ list add: (Dictionary new
112
+ at: 'name' put: 'receiver';
113
+ at: 'string' put: (anArray at: 10) printString;
114
+ at: 'oop' put: (anArray at: 10) asOop;
115
+ yourself).
116
+ ].
117
+ names := anArray at: 9.
118
+ 1 to: names size do: [:i |
119
+ | name |
120
+ (name := names at: i) first ~= $. ifTrue: [
121
+ list add: (Dictionary new
122
+ at: 'name' put: name;
123
+ at: 'string' put: (anArray at: 10 + i) printString;
124
+ at: 'oop' put: (anArray at: 10 + i) asOop;
125
+ yourself).
126
+ ].
127
+ ].
128
+ ^list.
129
+ %
130
+ doit
131
+ Debugger category: 'WebTools'
132
+ %