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.
- data/README.rdoc +38 -29
- data/bin/webtools +22 -1
- data/lib/web_tools/code_browser.rb +156 -0
- data/lib/web_tools/debugger.rb +96 -199
- data/lib/web_tools/info.rb +1 -3
- data/lib/web_tools/method_list.rb +67 -0
- data/lib/web_tools/middleware/debugger.rb +10 -16
- data/lib/web_tools/object_log.rb +24 -0
- data/lib/web_tools/session_list.rb +119 -0
- data/lib/web_tools/shared_page_cache.rb +30 -0
- data/lib/web_tools/stat_process.rb +24 -0
- data/lib/web_tools/statistics.rb +14 -0
- data/lib/web_tools/support/app_model.rb +66 -101
- data/lib/web_tools/support/code_browser.rb +88 -86
- data/lib/web_tools/support/debugger.rb +303 -0
- data/lib/web_tools/support/error_log.rb +33 -0
- data/lib/web_tools/support/ruby.rb +60 -121
- data/lib/web_tools/support/service_helper.rb +38 -10
- data/lib/web_tools/support/smalltalk_extensions.rb +12 -0
- data/lib/web_tools/tool.rb +48 -0
- data/lib/web_tools/ui.rb +14 -53
- data/lib/web_tools/version_report.rb +29 -0
- data/lib/web_tools/workspace.rb +77 -0
- data/lib/web_tools.rb +14 -4
- data/public/CodeBrowser.html +51 -0
- data/public/CodeMirror/LICENSE +19 -0
- data/public/CodeMirror/css/codemirror.css +67 -0
- data/public/CodeMirror/css/default.css +18 -0
- data/public/CodeMirror/js/codemirror.js +2131 -0
- data/public/CodeMirror/js/ruby.js +195 -0
- data/public/CodeMirror/js/smalltalk.js +139 -0
- data/public/Debugger.html +28 -0
- data/public/MethodList.html +20 -0
- data/public/ObjectLog.html +20 -0
- data/public/SessionList.html +31 -0
- data/public/SharedPageCache.html +78 -0
- data/public/Statistics.html +64 -0
- data/public/VersionReport.html +50 -0
- data/public/Workspace.html +39 -0
- data/public/css/CodeBrowser.css +24 -0
- data/public/css/Debugger.css +32 -0
- data/public/css/MethodList.css +8 -0
- data/public/css/ObjectLog.css +5 -0
- data/public/css/SessionList.css +9 -0
- data/public/css/Statistics.css +24 -0
- data/public/{stylesheets → css}/base/images/ui-anim_basic_16x16.gif +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-icons_222222_256x240.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-icons_2e83ff_256x240.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-icons_454545_256x240.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-icons_888888_256x240.png +0 -0
- data/public/{stylesheets → css}/base/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.accordion.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.all.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.autocomplete.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.base.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.button.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.core.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.datepicker.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.dialog.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.progressbar.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.resizable.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.selectable.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.slider.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.tabs.css +0 -0
- data/public/{stylesheets → css}/base/jquery.ui.theme.css +0 -0
- data/public/css/editor.css +25 -0
- data/public/css/jjmenu.css +33 -0
- data/public/css/menuitem.gif +0 -0
- data/public/css/more.gif +0 -0
- data/public/{stylesheets → css}/reset.css +1 -1
- data/public/css/smoothness/images/ui-anim_basic_16x16.gif +0 -0
- data/public/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/public/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/public/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/public/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/public/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/css/smoothness/jquery-ui.css +489 -0
- data/public/css/ui-lightness/images/ui-anim_basic_16x16.gif +0 -0
- data/public/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/public/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/public/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/public/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/public/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/public/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/public/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/public/css/ui-lightness/jquery-ui.css +489 -0
- data/public/css/webtools.css +65 -0
- data/public/favicon.ico +0 -0
- data/public/flot/API.txt +1201 -0
- data/public/flot/FAQ.txt +76 -0
- data/public/flot/LICENSE.txt +22 -0
- data/public/flot/Makefile +9 -0
- data/public/flot/NEWS.txt +508 -0
- data/public/flot/PLUGINS.txt +137 -0
- data/public/flot/README.txt +90 -0
- data/public/flot/examples/ajax.html +143 -0
- data/public/flot/examples/annotating.html +75 -0
- data/public/flot/examples/arrow-down.gif +0 -0
- data/public/flot/examples/arrow-left.gif +0 -0
- data/public/flot/examples/arrow-right.gif +0 -0
- data/public/flot/examples/arrow-up.gif +0 -0
- data/public/flot/examples/basic.html +38 -0
- data/public/flot/examples/data-eu-gdp-growth-1.json +4 -0
- data/public/flot/examples/data-eu-gdp-growth-2.json +4 -0
- data/public/flot/examples/data-eu-gdp-growth-3.json +4 -0
- data/public/flot/examples/data-eu-gdp-growth-4.json +4 -0
- data/public/flot/examples/data-eu-gdp-growth-5.json +4 -0
- data/public/flot/examples/data-eu-gdp-growth.json +4 -0
- data/public/flot/examples/data-japan-gdp-growth.json +4 -0
- data/public/flot/examples/data-usa-gdp-growth.json +4 -0
- data/public/flot/examples/graph-types.html +75 -0
- data/public/flot/examples/hs-2004-27-a-large_web.jpg +0 -0
- data/public/flot/examples/image.html +45 -0
- data/public/flot/examples/index.html +44 -0
- data/public/flot/examples/interacting-axes.html +97 -0
- data/public/flot/examples/interacting.html +93 -0
- data/public/flot/examples/layout.css +6 -0
- data/public/flot/examples/multiple-axes.html +60 -0
- data/public/flot/examples/navigate.html +118 -0
- data/public/flot/examples/percentiles.html +57 -0
- data/public/flot/examples/pie.html +756 -0
- data/public/flot/examples/realtime.html +83 -0
- data/public/flot/examples/resize.html +61 -0
- data/public/flot/examples/selection.html +114 -0
- data/public/flot/examples/setting-options.html +61 -0
- data/public/flot/examples/stacking.html +77 -0
- data/public/flot/examples/symbols.html +49 -0
- data/public/flot/examples/thresholding.html +54 -0
- data/public/flot/examples/time.html +71 -0
- data/public/flot/examples/tracking.html +95 -0
- data/public/flot/examples/turning-series.html +98 -0
- data/public/flot/examples/visitors.html +90 -0
- data/public/flot/examples/zooming.html +98 -0
- data/public/flot/excanvas.js +1427 -0
- data/public/flot/excanvas.min.js +1 -0
- data/public/flot/jquery.colorhelpers.js +179 -0
- data/public/flot/jquery.colorhelpers.min.js +1 -0
- data/public/flot/jquery.flot.crosshair.js +167 -0
- data/public/flot/jquery.flot.crosshair.min.js +1 -0
- data/public/flot/jquery.flot.fillbetween.js +183 -0
- data/public/flot/jquery.flot.fillbetween.min.js +1 -0
- data/public/flot/jquery.flot.image.js +238 -0
- data/public/flot/jquery.flot.image.min.js +1 -0
- data/public/flot/jquery.flot.js +2599 -0
- data/public/flot/jquery.flot.min.js +6 -0
- data/public/flot/jquery.flot.navigate.js +336 -0
- data/public/flot/jquery.flot.navigate.min.js +1 -0
- data/public/flot/jquery.flot.pie.js +750 -0
- data/public/flot/jquery.flot.pie.min.js +1 -0
- data/public/flot/jquery.flot.resize.js +60 -0
- data/public/flot/jquery.flot.resize.min.js +1 -0
- data/public/flot/jquery.flot.selection.js +344 -0
- data/public/flot/jquery.flot.selection.min.js +1 -0
- data/public/flot/jquery.flot.stack.js +184 -0
- data/public/flot/jquery.flot.stack.min.js +1 -0
- data/public/flot/jquery.flot.symbol.js +70 -0
- data/public/flot/jquery.flot.symbol.min.js +1 -0
- data/public/flot/jquery.flot.threshold.js +103 -0
- data/public/flot/jquery.flot.threshold.min.js +1 -0
- data/public/flot/jquery.js +8316 -0
- data/public/flot/jquery.min.js +23 -0
- data/public/genPacking.pl +30 -0
- data/public/index.html +28 -0
- data/public/install.tpz +66 -0
- data/public/installAndRun.tpz +5 -0
- data/public/jsTree/jquery.jstree.js +3510 -0
- data/public/jsTree/themes/default/d.gif +0 -0
- data/public/jsTree/themes/default/d.png +0 -0
- data/public/jsTree/themes/default/style.css +73 -0
- data/public/jsTree/themes/default/throbber.gif +0 -0
- data/public/readMe.txt +9 -0
- data/public/scripts/CodeBrowser.js +645 -0
- data/public/scripts/Debugger.js +134 -0
- data/public/scripts/MethodList.js +72 -0
- data/public/scripts/ObjectLog.js +59 -0
- data/public/scripts/SessionList.js +164 -0
- data/public/scripts/Statistics.js +266 -0
- data/public/scripts/editor.js +430 -0
- data/public/scripts/jjmenu.js +375 -0
- data/public/scripts/jquery-ui.js +1012 -0
- data/public/scripts/jquery.js +154 -0
- data/public/scripts/webtools.js +374 -0
- data/public/src/CodeBrowser.gs +416 -0
- data/public/src/Debugger.gs +132 -0
- data/public/src/MethodList.gs +130 -0
- data/public/src/ObjectLog.gs +73 -0
- data/public/src/Server.gs +544 -0
- data/public/src/SessionList.gs +172 -0
- data/public/src/SharedPageCache.gs +66 -0
- data/public/src/StatProcess.gs +280 -0
- data/public/src/StatProcessType.gs +242 -0
- data/public/src/StatStatistic.gs +381 -0
- data/public/src/Statistics.gs +222 -0
- data/public/src/Statmonitor.gs +490 -0
- data/public/src/Tool.gs +86 -0
- data/public/src/VersionReport.gs +52 -0
- data/public/src/Workspace.gs +163 -0
- data/views/debugger.rhtml +6 -9
- metadata +344 -243
- data/lib/web_tools/#debugger.rb# +0 -212
- data/lib/web_tools/browser.rb +0 -45
- data/public/images/favicon.ico +0 -0
- data/public/javascript/CodeMirror/LICENSE +0 -23
- data/public/javascript/CodeMirror/css/Smalltalk.css +0 -34
- data/public/javascript/CodeMirror/js/codemirror.js +0 -582
- data/public/javascript/CodeMirror/js/editor.js +0 -1671
- data/public/javascript/CodeMirror/js/highlight.js +0 -68
- data/public/javascript/CodeMirror/js/parseSmalltalk.js +0 -126
- data/public/javascript/CodeMirror/js/parsedummy.js +0 -32
- data/public/javascript/CodeMirror/js/select.js +0 -699
- data/public/javascript/CodeMirror/js/stringstream.js +0 -159
- data/public/javascript/CodeMirror/js/tokenize.js +0 -57
- data/public/javascript/CodeMirror/js/undo.js +0 -413
- data/public/javascript/CodeMirror/js/util.js +0 -133
- data/public/javascript/CodeMirror/testSmalltalkParser.html +0 -116
- data/public/javascript/ace/ace-uncompressed.js +0 -17299
- data/public/javascript/ace/ace.js +0 -1
- data/public/javascript/ace/keybinding-emacs.js +0 -1
- data/public/javascript/ace/keybinding-vim.js +0 -1
- data/public/javascript/ace/mode-c_cpp.js +0 -1
- data/public/javascript/ace/mode-clojure.js +0 -1
- data/public/javascript/ace/mode-coffee.js +0 -1
- data/public/javascript/ace/mode-csharp.js +0 -1
- data/public/javascript/ace/mode-css.js +0 -1
- data/public/javascript/ace/mode-groovy.js +0 -1
- data/public/javascript/ace/mode-html.js +0 -1
- data/public/javascript/ace/mode-java.js +0 -1
- data/public/javascript/ace/mode-javascript.js +0 -1
- data/public/javascript/ace/mode-json.js +0 -1
- data/public/javascript/ace/mode-lua.js +0 -1
- data/public/javascript/ace/mode-markdown.js +0 -1
- data/public/javascript/ace/mode-ocaml.js +0 -1
- data/public/javascript/ace/mode-perl.js +0 -1
- data/public/javascript/ace/mode-php.js +0 -1
- data/public/javascript/ace/mode-python.js +0 -1
- data/public/javascript/ace/mode-ruby.js +0 -1
- data/public/javascript/ace/mode-scad.js +0 -1
- data/public/javascript/ace/mode-scala.js +0 -1
- data/public/javascript/ace/mode-scss.js +0 -1
- data/public/javascript/ace/mode-svg.js +0 -1
- data/public/javascript/ace/mode-textile.js +0 -1
- data/public/javascript/ace/mode-xml.js +0 -1
- data/public/javascript/ace/theme-clouds.js +0 -1
- data/public/javascript/ace/theme-clouds_midnight.js +0 -1
- data/public/javascript/ace/theme-cobalt.js +0 -1
- data/public/javascript/ace/theme-crimson_editor.js +0 -1
- data/public/javascript/ace/theme-dawn.js +0 -1
- data/public/javascript/ace/theme-eclipse.js +0 -1
- data/public/javascript/ace/theme-idle_fingers.js +0 -1
- data/public/javascript/ace/theme-kr_theme.js +0 -1
- data/public/javascript/ace/theme-merbivore.js +0 -1
- data/public/javascript/ace/theme-merbivore_soft.js +0 -1
- data/public/javascript/ace/theme-mono_industrial.js +0 -1
- data/public/javascript/ace/theme-monokai.js +0 -1
- data/public/javascript/ace/theme-pastel_on_dark.js +0 -1
- data/public/javascript/ace/theme-solarized_dark.js +0 -1
- data/public/javascript/ace/theme-solarized_light.js +0 -1
- data/public/javascript/ace/theme-textmate.js +0 -1
- data/public/javascript/ace/theme-twilight.js +0 -1
- data/public/javascript/ace/theme-vibrant_ink.js +0 -1
- data/public/javascript/ace/worker-coffee.js +0 -1
- data/public/javascript/ace/worker-css.js +0 -1
- data/public/javascript/ace/worker-javascript.js +0 -1
- data/public/javascript/webtools/browser.js +0 -260
- data/public/javascript/webtools/debugger.coffee +0 -286
- data/public/javascript/webtools/debugger.js +0 -366
- data/public/javascript/webtools/sessions.coffee +0 -17
- data/public/javascript/webtools/sessions.js +0 -27
- data/public/javascript/webtools/version.coffee +0 -14
- data/public/javascript/webtools/version.js +0 -20
- data/public/stylesheets/jquery.contextMenu.css +0 -62
- data/public/stylesheets/webtools.css +0 -53
- data/public/test.html +0 -47
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# A singleton to hold on to the debuggable processes
|
|
2
|
+
|
|
3
|
+
module WebTools
|
|
4
|
+
module Support
|
|
5
|
+
module ErrorLog
|
|
6
|
+
extend self
|
|
7
|
+
extend Enumerable
|
|
8
|
+
|
|
9
|
+
Entry = Struct.new :exception, :thread
|
|
10
|
+
|
|
11
|
+
def add(hash)
|
|
12
|
+
list << Entry.new(hash[:exception], hash[:thread])
|
|
13
|
+
list.last
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def delete(entry)
|
|
17
|
+
list.delete entry
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def list
|
|
21
|
+
defined?(@@list) ? @@list : @@list = []
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def to_a
|
|
25
|
+
list
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def each(&block)
|
|
29
|
+
list.each(&block)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -1,132 +1,71 @@
|
|
|
1
|
-
require 'maglev/method_source'
|
|
2
1
|
module WebTools
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
# Skips autoloads (i.e., does not trigger them and does not yield them to
|
|
8
|
-
# the block).
|
|
9
|
-
#
|
|
10
|
-
# @param [Module] klass The Class or Module object to start traversal.
|
|
11
|
-
# Default is Object.
|
|
12
|
-
#
|
|
13
|
-
# @param [IdentitySet] rg The recursion guard used to prevent infinite
|
|
14
|
-
# loops; also used as return value.
|
|
15
|
-
#
|
|
16
|
-
# @return [IdentitySet] An IdentitySet of all the Classes and Modules
|
|
17
|
-
# registered in the Ruby namespace
|
|
18
|
-
#
|
|
19
|
-
def each_module(klass=Object, rg=IdentitySet.new, &block)
|
|
20
|
-
raise 'Must be class or module' unless Module === klass
|
|
21
|
-
unless rg.include?(klass)
|
|
22
|
-
rg.add klass
|
|
23
|
-
yield klass
|
|
24
|
-
klass.constants.each do |c|
|
|
25
|
-
unless klass.autoload?(c)
|
|
26
|
-
obj = klass.const_get c
|
|
27
|
-
each_module(obj, rg, &block) if Module === obj
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
rg
|
|
32
|
-
end
|
|
33
|
-
module_function :each_module
|
|
34
|
-
|
|
35
|
-
# Returns a sorted list of class and module names in the Ruby Namespace
|
|
36
|
-
#
|
|
37
|
-
# @return [Array] sorted list of class and module names found in the Ruby
|
|
38
|
-
# namespace hierarchy.
|
|
39
|
-
def class_and_module_names
|
|
40
|
-
names = []
|
|
41
|
-
each_module { |klass| names << klass.name }
|
|
42
|
-
names.sort
|
|
43
|
-
end
|
|
44
|
-
module_function :class_and_module_names
|
|
45
|
-
|
|
46
|
-
# A simple message from Ruby Land.
|
|
47
|
-
def say_something
|
|
48
|
-
"Hello from MagLev, My name is '#{self.name}'"
|
|
49
|
-
end
|
|
50
|
-
module_function :say_something
|
|
2
|
+
module Support
|
|
3
|
+
# Provide information about the Ruby environment
|
|
4
|
+
module Ruby
|
|
5
|
+
MODULE_MOD_FNS = Module.instance_methods(false)
|
|
51
6
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
# @return [Object] the named object.
|
|
58
|
-
#
|
|
59
|
-
# @raise [NameError] if the name can't be found
|
|
60
|
-
def find_in_namespace(name)
|
|
61
|
-
name.split('::').inject(Object) do |parent, name|
|
|
62
|
-
obj = parent.const_get name
|
|
7
|
+
def module_info_for(name)
|
|
8
|
+
mod = find_in_namespace name
|
|
9
|
+
{ :constants => mod.constants.sort,
|
|
10
|
+
:class_methods => module_fns_for(mod),
|
|
11
|
+
:instance_methods => mod.instance_methods(false).sort }
|
|
63
12
|
end
|
|
64
|
-
|
|
65
|
-
module_function :find_in_namespace
|
|
13
|
+
module_function :module_info_for
|
|
66
14
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
15
|
+
def module_fns_for(mod)
|
|
16
|
+
res = []
|
|
17
|
+
begin
|
|
18
|
+
sclass = mod.__singleton_class
|
|
19
|
+
res = sclass.instance_methods(false) - MODULE_MOD_FNS
|
|
20
|
+
rescue => e
|
|
21
|
+
# nothing
|
|
22
|
+
end
|
|
23
|
+
res
|
|
24
|
+
end
|
|
25
|
+
module_function :module_fns_for
|
|
76
26
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
27
|
+
# Get the source code for the named class and method
|
|
28
|
+
#
|
|
29
|
+
# The success of this method depends on being called from a Ruby stack,
|
|
30
|
+
# not a Smalltalk stack.
|
|
31
|
+
#
|
|
32
|
+
# @param [String] The name of the class
|
|
33
|
+
# @param [String] The method name
|
|
34
|
+
# @param [Boolean] if true, then look for a class method, otherwise look
|
|
35
|
+
# for an instance method.
|
|
36
|
+
def source_for(class_name, method_name, instance_method=true)
|
|
37
|
+
klass = find_in_namespace(class_name)
|
|
38
|
+
gsnmeth = klass.gs_method_for(method_name, instance_method)
|
|
39
|
+
src = gsnmeth.__source_string
|
|
40
|
+
file,line = gsnmeth.__source_location
|
|
41
|
+
file.nil? ? "#{src}\n# No file information available." : "#{src}\n##{file}:#{line}"
|
|
84
42
|
end
|
|
85
|
-
|
|
86
|
-
end
|
|
87
|
-
module_function :module_fns_for
|
|
43
|
+
module_function :source_for
|
|
88
44
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
module_function :source_for
|
|
45
|
+
# Return a display string suitable for rendering a constant.
|
|
46
|
+
# Currently, it just returns the results of #inspect on the object.
|
|
47
|
+
#
|
|
48
|
+
# TODO
|
|
49
|
+
# 1. If the const value is a proc, then return "Proc: " + the source code.
|
|
50
|
+
#
|
|
51
|
+
# @param [String,Symbol] class_name The name of the class to query.
|
|
52
|
+
# @param [String,Symbol] const_name The name of the constant.
|
|
53
|
+
# @return [String] A description of the constant.
|
|
54
|
+
#
|
|
55
|
+
def const_info_for(class_name, const_name)
|
|
56
|
+
klass = find_in_namespace class_name
|
|
57
|
+
const = klass.const_get const_name
|
|
58
|
+
const.inspect
|
|
59
|
+
end
|
|
60
|
+
module_function :const_info_for
|
|
106
61
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
# @param [String,Symbol] const_name The name of the constant.
|
|
115
|
-
# @return [String] A description of the constant.
|
|
116
|
-
#
|
|
117
|
-
def const_info_for(class_name, const_name)
|
|
118
|
-
klass = find_in_namespace class_name
|
|
119
|
-
const = klass.const_get const_name
|
|
120
|
-
const.inspect
|
|
62
|
+
# def logit(msg)
|
|
63
|
+
# File.open("/tmp/log", "a+") do |f|
|
|
64
|
+
# f.puts msg
|
|
65
|
+
# f.flush
|
|
66
|
+
# end
|
|
67
|
+
# end
|
|
68
|
+
# module_function :logit
|
|
121
69
|
end
|
|
122
|
-
module_function :const_info_for
|
|
123
|
-
|
|
124
|
-
# def logit(msg)
|
|
125
|
-
# File.open("/tmp/log", "a+") do |f|
|
|
126
|
-
# f.puts msg
|
|
127
|
-
# f.flush
|
|
128
|
-
# end
|
|
129
|
-
# end
|
|
130
|
-
# module_function :logit
|
|
131
70
|
end
|
|
132
71
|
end
|
|
@@ -1,22 +1,50 @@
|
|
|
1
1
|
require 'json/pure' unless defined? JSON
|
|
2
|
+
require 'rack/contrib/jsonp'
|
|
2
3
|
|
|
3
4
|
module WebTools::Support::ServiceHelper
|
|
4
5
|
def self.included(base)
|
|
5
|
-
base.set :show_exceptions,
|
|
6
|
+
base.set :show_exceptions, false
|
|
6
7
|
base.set :raise_errors, false
|
|
8
|
+
base.set :method_override, true
|
|
9
|
+
base.set :logging, true
|
|
10
|
+
base.use Rack::JSONP
|
|
7
11
|
|
|
8
12
|
base.error do
|
|
9
13
|
excep = request.env['sinatra.error']
|
|
10
|
-
|
|
14
|
+
puts
|
|
15
|
+
p excep.message
|
|
16
|
+
puts excep.backtrace
|
|
17
|
+
json('_stack' => excep.backtrace.join("<br>"),
|
|
18
|
+
'_error' => excep.message)
|
|
11
19
|
end
|
|
12
|
-
end
|
|
13
20
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
base.before do
|
|
22
|
+
@ts = Time.now
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
base.helpers do
|
|
26
|
+
def non_meta_name(str)
|
|
27
|
+
if str =~ /^#<Class:.*>$/
|
|
28
|
+
str["#<Class:".length..-2]
|
|
29
|
+
else
|
|
30
|
+
str
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def json(obj)
|
|
35
|
+
content_type :json
|
|
36
|
+
obj.to_hash.tap do |o|
|
|
37
|
+
o["_time"] = ((Time.now - @ts) * 1000).to_i
|
|
38
|
+
end.to_json
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def reflect(obj)
|
|
42
|
+
system.reflect(obj)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def system
|
|
46
|
+
@reflection ||= MirrorAPI::Reflection.new
|
|
47
|
+
end
|
|
48
|
+
end
|
|
21
49
|
end
|
|
22
50
|
end
|
|
@@ -8,6 +8,8 @@ class Maglev::System
|
|
|
8
8
|
#
|
|
9
9
|
class_primitive_nobridge 'current_session_ids', 'currentSessions'
|
|
10
10
|
|
|
11
|
+
class_primitive_nobridge 'max_session_id', 'maxSessionId'
|
|
12
|
+
|
|
11
13
|
# Return the cache process slot number (a SmallInteger) for the given
|
|
12
14
|
# session ID. The session must be connected to the same shared page
|
|
13
15
|
# cache as the session invoking this method.
|
|
@@ -52,6 +54,16 @@ class Maglev::System
|
|
|
52
54
|
# must have the SessionAccess privilege.
|
|
53
55
|
#
|
|
54
56
|
class_primitive_nobridge 'description_of_session', 'descriptionOfSession:'
|
|
57
|
+
|
|
58
|
+
class_primitive_nobridge 'cache_statistics', 'cacheStatisticsAt:'
|
|
59
|
+
class_primitive_nobridge 'cache_statistics_description_for_type', 'cacheStatisticsDescriptionForType:'
|
|
60
|
+
|
|
61
|
+
begin
|
|
62
|
+
StatStatistic = __resolve_smalltalk_global(:StatStatistic)
|
|
63
|
+
class StatStatistic
|
|
64
|
+
class_primitive_nobridge 'cache_stat_descriptions', 'cacheStatDescriptions'
|
|
65
|
+
end
|
|
66
|
+
rescue Exception; end
|
|
55
67
|
end
|
|
56
68
|
|
|
57
69
|
# The stoneVersionReport returns a StringKeyValueDictionary.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
require 'web_tools'
|
|
2
|
+
require 'sinatra/base'
|
|
3
|
+
require 'web_tools/support/service_helper'
|
|
4
|
+
require 'web_tools/support/error_log'
|
|
5
|
+
|
|
6
|
+
module WebTools
|
|
7
|
+
class Tool < Sinatra::Base
|
|
8
|
+
include WebTools::Support::ServiceHelper
|
|
9
|
+
|
|
10
|
+
before do
|
|
11
|
+
params.each do |k,v|
|
|
12
|
+
params[k] = Rack::Utils.unescape(v)
|
|
13
|
+
params[k] = false if v == "false"
|
|
14
|
+
params[k] = nil if v == "null"
|
|
15
|
+
params.delete(k) if v == "null" || v.empty?
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class << self
|
|
20
|
+
def inherited(subclass)
|
|
21
|
+
super
|
|
22
|
+
self.subclasses << subclass
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def dont_show!
|
|
26
|
+
@dont_show = true
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def dont_show?
|
|
30
|
+
!!@dont_show
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def subclasses
|
|
34
|
+
@subclasses ||= []
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def display_name
|
|
38
|
+
name.split("::").last
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def file_name
|
|
42
|
+
display_name + ".html"
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
alias description name
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
data/lib/web_tools/ui.rb
CHANGED
|
@@ -1,67 +1,28 @@
|
|
|
1
1
|
require 'sinatra/base'
|
|
2
2
|
require 'web_tools'
|
|
3
|
+
require 'web_tools/support/service_helper'
|
|
3
4
|
|
|
4
5
|
class WebTools::UI < Sinatra::Base
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
use WebTools::Info
|
|
6
|
+
PUBLIC_FOLDER = File.expand_path("../../../public", __FILE__)
|
|
7
|
+
include WebTools::Support::ServiceHelper
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@javascripts = %w[
|
|
12
|
-
https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
|
|
13
|
-
https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js
|
|
14
|
-
]
|
|
15
|
-
@stylesheets = %w[reset.css webtools.css]
|
|
9
|
+
helpers do
|
|
10
|
+
def static(file) File.read("#{PUBLIC_FOLDER}/#{file}.html") end
|
|
16
11
|
end
|
|
17
12
|
|
|
18
13
|
get '/' do
|
|
19
|
-
|
|
14
|
+
static :index
|
|
20
15
|
end
|
|
21
16
|
|
|
22
|
-
get '/
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
get '/tools' do
|
|
18
|
+
json "tools" => (WebTools::Tool.subclasses.reject(&:dont_show?).sort_by(&:name).map do |cls|
|
|
19
|
+
{ "file" => cls.file_name,
|
|
20
|
+
"name" => cls.display_name,
|
|
21
|
+
"description" => cls.description }
|
|
22
|
+
end)
|
|
25
23
|
end
|
|
26
24
|
|
|
27
|
-
get '
|
|
28
|
-
|
|
29
|
-
ace/ace.js
|
|
30
|
-
ace/mode-ruby.js
|
|
31
|
-
webtools/debugger.js]
|
|
32
|
-
erb :debugger
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
get '/info/version' do
|
|
36
|
-
@javascripts += %w[webtools/version.js]
|
|
37
|
-
@stylesheets = []
|
|
38
|
-
erb :version
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
get '/info/sessions' do
|
|
42
|
-
@javascripts += %w[webtools/sessions.js]
|
|
43
|
-
@stylesheets = []
|
|
44
|
-
erb :sessions
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
private
|
|
48
|
-
|
|
49
|
-
def erb(*args, &block)
|
|
50
|
-
@stylesheets = @stylesheets.map do |path|
|
|
51
|
-
unless path =~ /^((http)|\/)/
|
|
52
|
-
"#{@location}/stylesheets/#{path}"
|
|
53
|
-
else
|
|
54
|
-
path
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
@javascripts = @javascripts.map do |path|
|
|
59
|
-
unless path =~ /^((http)|\/)/
|
|
60
|
-
"#{@location}/javascript/#{path}"
|
|
61
|
-
else
|
|
62
|
-
path
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
super
|
|
25
|
+
get '/*' do
|
|
26
|
+
"#{params[:splat]} not implemented"
|
|
66
27
|
end
|
|
67
28
|
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require 'sinatra/base'
|
|
2
|
+
require 'web_tools'
|
|
3
|
+
require 'web_tools/support/service_helper'
|
|
4
|
+
|
|
5
|
+
class WebTools::VersionReport < WebTools::Tool
|
|
6
|
+
|
|
7
|
+
def self.description
|
|
8
|
+
'Information about the Stone and Gem processes and their host(s)'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
get '/' do
|
|
12
|
+
json("stone" => stone_version_report,
|
|
13
|
+
"gem" => gem_version_report)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def stone_version_report
|
|
17
|
+
results = { }
|
|
18
|
+
rpt = Maglev::System.stone_version_report
|
|
19
|
+
rpt.keys.each { |k| results[k] = rpt.at(k) }
|
|
20
|
+
results
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def gem_version_report
|
|
24
|
+
results = { }
|
|
25
|
+
rpt = Maglev::System.gem_version_report
|
|
26
|
+
rpt.keys.each { |k| results[k] = rpt.at(k) }
|
|
27
|
+
results
|
|
28
|
+
end
|
|
29
|
+
end
|