maglev-database-explorer 0.0.2 → 0.0.3

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 (87) hide show
  1. data/app/controllers/maglev_database_explorer/object_controller.rb +2 -3
  2. data/app/views/maglev_database_explorer/object_explorer/_workspace.html.erb +1 -1
  3. data/app/views/maglev_database_explorer/object_explorer/index.html.erb +2 -3
  4. data/lib/maglev-database-explorer.rb +1 -0
  5. data/lib/maglev-database-explorer/code_evaluation.rb +11 -1
  6. data/lib/maglev-database-explorer/database_views/gsnmethod.rb +2 -1
  7. data/lib/maglev-database-explorer/database_views/object.rb +5 -1
  8. data/lib/maglev-database-explorer/database_views/system.rb +13 -0
  9. data/lib/maglev-database-explorer/debug_storage.rb +10 -0
  10. data/lib/maglev-database-explorer/ruby_workspace.rb +1 -2
  11. data/lib/maglev-database-explorer/version.rb +1 -1
  12. data/public/amber/js/Maglev-Core.deploy.js +35 -1
  13. data/public/amber/js/Maglev-Core.js +50 -1
  14. data/public/amber/js/Maglev-Database-Explorer.deploy.js +60 -10
  15. data/public/amber/js/Maglev-Database-Explorer.js +92 -22
  16. data/public/amber/st/Maglev-Core.st +31 -1
  17. data/public/amber/st/Maglev-Database-Explorer.st +86 -23
  18. data/public/css/bootstrap.css +4 -4
  19. data/public/css/images/animated-overlay.gif +0 -0
  20. data/public/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  21. data/public/css/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  22. data/public/css/images/ui-bg_flat_10_000000_40x100.png +0 -0
  23. data/public/css/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  24. data/public/css/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  25. data/public/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  26. data/public/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  27. data/public/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  28. data/public/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  29. data/public/css/images/ui-icons_222222_256x240.png +0 -0
  30. data/public/css/images/ui-icons_228ef1_256x240.png +0 -0
  31. data/public/css/images/ui-icons_ef8c08_256x240.png +0 -0
  32. data/public/css/images/ui-icons_ffd27a_256x240.png +0 -0
  33. data/public/css/images/ui-icons_ffffff_256x240.png +0 -0
  34. data/public/images/bg_tile.png +0 -0
  35. data/public/images/mchammer.gif +0 -0
  36. data/public/libs/codemirror/lib/codemirror.css +1 -1
  37. data/public/themes/geo-bootstrap/README.md +25 -0
  38. data/public/themes/geo-bootstrap/img/flames.gif +0 -0
  39. data/public/themes/geo-bootstrap/img/glyphicons-halflings-white.png +0 -0
  40. data/public/themes/geo-bootstrap/img/glyphicons-halflings.png +0 -0
  41. data/public/themes/geo-bootstrap/img/microfab.gif +0 -0
  42. data/public/themes/geo-bootstrap/img/progress.gif +0 -0
  43. data/public/themes/geo-bootstrap/img/rainbow.gif +0 -0
  44. data/public/themes/geo-bootstrap/img/stars.gif +0 -0
  45. data/public/themes/geo-bootstrap/img/test/7upspot.gif +0 -0
  46. data/public/themes/geo-bootstrap/img/test/americanflag.gif +0 -0
  47. data/public/themes/geo-bootstrap/img/test/community.gif +0 -0
  48. data/public/themes/geo-bootstrap/img/test/computer-01.gif +0 -0
  49. data/public/themes/geo-bootstrap/img/test/computer.gif +0 -0
  50. data/public/themes/geo-bootstrap/img/test/construction.gif +0 -0
  51. data/public/themes/geo-bootstrap/img/test/counter.gif +0 -0
  52. data/public/themes/geo-bootstrap/img/test/counter2.gif +0 -0
  53. data/public/themes/geo-bootstrap/img/test/divider.gif +0 -0
  54. data/public/themes/geo-bootstrap/img/test/divider1.gif +0 -0
  55. data/public/themes/geo-bootstrap/img/test/divider2.gif +0 -0
  56. data/public/themes/geo-bootstrap/img/test/divider3.gif +0 -0
  57. data/public/themes/geo-bootstrap/img/test/divider4.gif +0 -0
  58. data/public/themes/geo-bootstrap/img/test/drudgesiren.gif +0 -0
  59. data/public/themes/geo-bootstrap/img/test/emailme.gif +0 -0
  60. data/public/themes/geo-bootstrap/img/test/funky.gif +0 -0
  61. data/public/themes/geo-bootstrap/img/test/geocities.jpg +0 -0
  62. data/public/themes/geo-bootstrap/img/test/hacker.gif +0 -0
  63. data/public/themes/geo-bootstrap/img/test/heart.gif +0 -0
  64. data/public/themes/geo-bootstrap/img/test/hot.gif +0 -0
  65. data/public/themes/geo-bootstrap/img/test/ie_logo.gif +0 -0
  66. data/public/themes/geo-bootstrap/img/test/mailkitten.gif +0 -0
  67. data/public/themes/geo-bootstrap/img/test/mchammer.gif +0 -0
  68. data/public/themes/geo-bootstrap/img/test/new.gif +0 -0
  69. data/public/themes/geo-bootstrap/img/test/new2.gif +0 -0
  70. data/public/themes/geo-bootstrap/img/test/noframes.gif +0 -0
  71. data/public/themes/geo-bootstrap/img/test/notepad.gif +0 -0
  72. data/public/themes/geo-bootstrap/img/test/ns_logo.gif +0 -0
  73. data/public/themes/geo-bootstrap/img/test/sign-in.gif +0 -0
  74. data/public/themes/geo-bootstrap/img/test/spinningearth.gif +0 -0
  75. data/public/themes/geo-bootstrap/img/test/underconstruction.gif +0 -0
  76. data/public/themes/geo-bootstrap/img/test/wabwalk.gif +0 -0
  77. data/public/themes/geo-bootstrap/img/test/webtrips.gif +0 -0
  78. data/public/themes/geo-bootstrap/img/test/yahooweek.gif +0 -0
  79. data/public/themes/geo-bootstrap/package.json +21 -0
  80. data/public/themes/geo-bootstrap/swatch/bootstrap-responsive.css +1109 -0
  81. data/public/themes/geo-bootstrap/swatch/bootstrap-responsive.min.css +9 -0
  82. data/public/themes/geo-bootstrap/swatch/bootstrap.css +6462 -0
  83. data/public/themes/geo-bootstrap/swatch/bootstrap.min.css +9 -0
  84. metadata +66 -7
  85. data/test/dummy/tmp/cache/assets/D26/980/sprockets%2Fe04a37a0fa7f26c1183a1a4436e2a9c1 +0 -0
  86. data/test/dummy/tmp/cache/assets/D32/4F0/sprockets%2Fbd5441f3593e4ea157222202f3fddad6 +0 -0
  87. data/test/dummy/tmp/pids/server.pid +0 -1
@@ -112,7 +112,7 @@ showReloadObjectWindow: oop
112
112
  ^ window
113
113
  ! !
114
114
 
115
- Maglev class instanceVariableNames: 'instance defaultWorkspaceId persistentRootId maglevSystemId evalObjectId'!
115
+ Maglev class instanceVariableNames: 'instance defaultWorkspaceId persistentRootId maglevSystemId evalObjectId swatchDesign'!
116
116
 
117
117
  !Maglev class methodsFor: 'accessing'!
118
118
 
@@ -167,6 +167,20 @@ ready
167
167
  MaglevWebBrowserWindow showNew.
168
168
  ! !
169
169
 
170
+ !Maglev class methodsFor: 'rendering'!
171
+
172
+ swatchDesign
173
+ swatchDesign
174
+ ifNil: [ |html|
175
+ html := HTMLCanvas onJQuery: 'head' asJQuery.
176
+ swatchDesign := html link
177
+ href: 'themes/geo-bootstrap/swatch/bootstrap.css';
178
+ rel: 'stylesheet']
179
+ ifNotNil: [
180
+ swatchDesign asJQuery remove.
181
+ swatchDesign := nil].
182
+ ! !
183
+
170
184
  !Maglev class methodsFor: 'singleton'!
171
185
 
172
186
  instance
@@ -1120,6 +1134,22 @@ allSelectorsWithCallback: aBlock
1120
1134
  withCallback: aBlock.
1121
1135
  !
1122
1136
 
1137
+ compileRubySourceCode: sourceCode withCallback: aBlock
1138
+ self
1139
+ evaluateWithoutUpdate: sourceCode
1140
+ language: 'rubyClass'
1141
+ with: Dictionary new
1142
+ withCallback: aBlock.
1143
+ !
1144
+
1145
+ compileSmalltalkSourceCode: sourceCode withCallback: aBlock
1146
+ self
1147
+ evaluateWithoutUpdate: 'self compile: ''', sourceCode escapedString, '''.'
1148
+ language: 'smalltalk'
1149
+ with: Dictionary new
1150
+ withCallback: aBlock.
1151
+ !
1152
+
1123
1153
  ensureSuperListLoadedWithCallback: aBlock
1124
1154
  superList
1125
1155
  ifNil: [MaglevAjax
@@ -42,11 +42,19 @@ with: anObject
42
42
  ! !
43
43
 
44
44
  Widget subclass: #MaglevGsNMethodEditor
45
- instanceVariableNames: 'object editorContainer errorBox rubyIcon stIcon envIdContainer sourceLocationContainer editor editorHeight editorWidth'
45
+ instanceVariableNames: 'object editorContainer errorBox rubyIcon stIcon envIdContainer sourceLocationContainer editor editorHeight editorWidth classObject'
46
46
  package: 'Maglev-Database-Explorer'!
47
47
 
48
48
  !MaglevGsNMethodEditor methodsFor: 'accessing'!
49
49
 
50
+ classObject
51
+ ^ MaglevObject newObjectWithoutUpdate: (self methodObject at: 5)
52
+ !
53
+
54
+ classObject: anObject
55
+ classObject := anObject.
56
+ !
57
+
50
58
  envId
51
59
  ^ self methodObject at: 2
52
60
  !
@@ -121,19 +129,19 @@ commandSave
121
129
  |selectedCategory|
122
130
  errorBox hide.
123
131
  errorBox asJQuery empty.
124
- object environmentId = 1
125
- ifTrue: [object
126
- compileRubySourceCode: editor getValue
132
+ self envId = 1
133
+ ifTrue: [self classObject
134
+ compileRubySourceCode: (editor getValue replace: '⚡' with: '')
127
135
  withCallback: [:success :obj |
128
- obj isException
129
- ifTrue: [self signalFailure: obj]
130
- ifFalse: [self signalSuccess]]]
131
- ifFalse: [object
132
- compileSmalltalkSourceCode: editor getValue
136
+ success
137
+ ifTrue: [self signalSuccess]
138
+ ifFalse: [self signalFailure: obj]]]
139
+ ifFalse: [self classObject
140
+ compileSmalltalkSourceCode: (editor getValue replace: '⚡' with: '')
133
141
  withCallback: [:success :obj |
134
- obj isException
135
- ifTrue: [self signalFailure: obj]
136
- ifFalse: [self signalSuccess]]].
142
+ success
143
+ ifTrue: [self signalSuccess]
144
+ ifFalse: [self signalFailure: obj]]].
137
145
  !
138
146
 
139
147
  signalFailure: aDescription
@@ -873,12 +881,18 @@ language
873
881
  !MaglevObjectDropdown methodsFor: 'initializing'!
874
882
 
875
883
  initializeEditor
876
- |params|
884
+ |params extraKeys|
885
+ extraKeys := Object new
886
+ basicAt: 'Ctrl-D' put: [self evalPrintIt];
887
+ basicAt: 'Ctrl-P' put: [self evalPrintIt];
888
+ basicAt: 'Ctrl-S' put: [self evalPrintIt];
889
+ yourself.
877
890
  params := Object new
878
891
  basicAt: 'mode' put: 'text/x-ruby';
879
892
  basicAt: 'styleActiveLine' put: true;
880
893
  basicAt: 'lineNumbers' put: true;
881
894
  basicAt: 'matchBrackets' put: true;
895
+ basicAt: 'extraKeys' put: extraKeys;
882
896
  yourself.
883
897
  editor := CodeMirror value: (editorElement asJQuery at: 0) value: params.
884
898
  editor setValue: ''.
@@ -948,21 +962,22 @@ languageChanged
948
962
  !MaglevObjectDropdown methodsFor: 'rendering'!
949
963
 
950
964
  renderButtonsOn: html
951
- html button
965
+ "html button
952
966
  class: 'btn btn-primary';
953
967
  type: 'button';
954
968
  with: 'Do it';
955
- onClick: [self evalDoIt].
969
+ onClick: [self evalDoIt]."
956
970
  html button
957
971
  class: 'btn btn-primary';
958
972
  type: 'button';
973
+ style: 'margin-right: 10px;';
959
974
  with: 'Print it';
960
975
  onClick: [self evalPrintIt].
961
- html button
976
+ "html button
962
977
  class: 'btn btn-primary';
963
978
  type: 'button';
964
979
  with: 'Inspect it';
965
- onClick: [self evalInspectIt].
980
+ onClick: [self evalInspectIt]."
966
981
  html div
967
982
  class: 'btn-group';
968
983
  style: 'float: right;';
@@ -2460,7 +2475,10 @@ renderListsOn: html
2460
2475
  !
2461
2476
 
2462
2477
  renderMethodObject: obj
2463
- methodContainer with: (MaglevGsNMethodEditor for: obj).
2478
+ |methodEditor|
2479
+ methodEditor := MaglevGsNMethodEditor for: obj.
2480
+ methodEditor classObject: object.
2481
+ methodContainer with: methodEditor.
2464
2482
  waitingScreen hide.
2465
2483
  !
2466
2484
 
@@ -2537,7 +2555,7 @@ renderWindowTitleContentOn: html
2537
2555
  ! !
2538
2556
 
2539
2557
  MaglevClassWindow subclass: #MaglevSystemClassWindow
2540
- instanceVariableNames: 'transactionResultBox'
2558
+ instanceVariableNames: 'transactionResultBox persistenceModeButton'
2541
2559
  package: 'Maglev-Database-Explorer'!
2542
2560
 
2543
2561
  !MaglevSystemClassWindow methodsFor: 'interactions'!
@@ -2586,6 +2604,44 @@ continueTransaction
2586
2604
 
2587
2605
  defaultTab
2588
2606
  ^ 'Control Panel'
2607
+ !
2608
+
2609
+ togglePersistentMode
2610
+ self showTransactionWaitingBox.
2611
+ object
2612
+ evaluate: 'self.__DBETogglePersistenceMode'
2613
+ language: 'ruby'
2614
+ withCallback: [:success :resultObj |
2615
+ transactionResultBox asJQuery empty.
2616
+ transactionResultBox removeClass: 'alert-info'.
2617
+ success
2618
+ ifTrue: [
2619
+ transactionResultBox addClass: 'alert-success'.
2620
+ resultObj value = true
2621
+ ifTrue: [persistenceModeButton asJQuery addClass: 'active']
2622
+ ifFalse: [persistenceModeButton asJQuery removeClass: 'active'].
2623
+ transactionResultBox hide]
2624
+ ifFalse: [transactionResultBox addClass: 'alert-error'].
2625
+ transactionResultBox with: resultObj inlineViewComponent].
2626
+ !
2627
+
2628
+ updatePersistentMode
2629
+ self showTransactionWaitingBox.
2630
+ object
2631
+ evaluate: 'self.__DBEPersistenceMode'
2632
+ language: 'ruby'
2633
+ withCallback: [:success :resultObj |
2634
+ transactionResultBox asJQuery empty.
2635
+ transactionResultBox removeClass: 'alert-info'.
2636
+ success
2637
+ ifTrue: [
2638
+ transactionResultBox addClass: 'alert-success'.
2639
+ resultObj value = true
2640
+ ifTrue: [persistenceModeButton asJQuery addClass: 'active']
2641
+ ifFalse: [persistenceModeButton asJQuery removeClass: 'active'].
2642
+ transactionResultBox hide]
2643
+ ifFalse: [transactionResultBox addClass: 'alert-error'].
2644
+ transactionResultBox with: resultObj inlineViewComponent].
2589
2645
  ! !
2590
2646
 
2591
2647
  !MaglevSystemClassWindow methodsFor: 'rendering'!
@@ -2608,24 +2664,31 @@ renderControlPanelOn: html
2608
2664
  type: 'button';
2609
2665
  class: 'btn btn-warning';
2610
2666
  value: 'Abort Transaction';
2611
- style: 'width: 32%; margin-right: 1%;';
2667
+ style: 'width: 25%; margin-right: 1%;';
2612
2668
  onClick: [self abortTransaction].
2613
2669
  html input
2614
2670
  type: 'button';
2615
2671
  class: 'btn btn-warning';
2616
2672
  value: 'Commit Transaction';
2617
- style: 'width: 32%; margin-right: 1%;';
2673
+ style: 'width: 25%; margin-right: 1%;';
2618
2674
  onClick: [self commitTransaction].
2619
2675
  html input
2620
2676
  type: 'button';
2621
2677
  class: 'btn btn-warning';
2622
2678
  value: 'Continue Transaction';
2623
- style: 'width: 33%;';
2679
+ style: 'width: 25%; margin-right: 1%;';
2624
2680
  onClick: [self continueTransaction].
2681
+ persistenceModeButton := html input
2682
+ type: 'button';
2683
+ class: 'btn';
2684
+ value: 'Persistent Mode';
2685
+ style: 'width: 22%;';
2686
+ onClick: [self togglePersistentMode].
2625
2687
  transactionResultBox := html div
2626
2688
  style: 'margin-top: 10px; margin-bottom: 0px;';
2627
2689
  class: 'alert';
2628
2690
  hide]].
2691
+ self updatePersistentMode.
2629
2692
  !
2630
2693
 
2631
2694
  renderGemVersionReportOn: html
@@ -2788,7 +2851,7 @@ reloadStackWithCallback: aBlock
2788
2851
 
2789
2852
  selectStackFrame: anInteger
2790
2853
  < self['@methodSelect']._asJQuery()[0].selectedIndex = anInteger - 1; >.
2791
- self renderFrame.
2854
+ self renderFrame: anInteger.
2792
2855
  !
2793
2856
 
2794
2857
  stepInto
@@ -4164,9 +4164,9 @@ input[type="submit"].btn.btn-mini {
4164
4164
  }
4165
4165
 
4166
4166
  .nav .dropdown-toggle .caret {
4167
- margin-top: 6px;
4168
- border-top-color: #007fff;
4169
- border-bottom-color: #007fff;
4167
+ margin-top: 8px;
4168
+ /*border-top-color: #007fff;
4169
+ border-bottom-color: #007fff;*/
4170
4170
  }
4171
4171
 
4172
4172
  .nav .dropdown-toggle:hover .caret,
@@ -6329,7 +6329,7 @@ div.subnav-fixed {
6329
6329
 
6330
6330
  .nav .open .dropdown-toggle,
6331
6331
  .nav > li.dropdown.open.active > a:hover {
6332
- color: #007fff;
6332
+ /*color: #007fff;*/
6333
6333
  }
6334
6334
 
6335
6335
  .nav-tabs > li > a {
Binary file
@@ -106,7 +106,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
106
106
  line-height: 1;
107
107
  position: relative;
108
108
  overflow: hidden;
109
- background: white;
109
+ /*background: white;*/
110
110
  color: black;
111
111
  }
112
112
 
@@ -0,0 +1,25 @@
1
+ # Geo
2
+
3
+ **Geo** is a timeless [Twitter Bootstrap](http://twitter.github.com/bootstrap) theme built for the modern web.
4
+
5
+ ## Usage
6
+
7
+ Download `bootstrap.css` or `bootstrap.min.css` from `/swatch`. Replace the default Bootstrap stylesheet with one of these files.
8
+
9
+ To use the image backgrounds download the graphics inside `/img`. Graphics used on our test page can be found inside `/img/test`.
10
+
11
+ ## Customization
12
+
13
+ Geo was built with [Bootswatch Swatchmaker](https://github.com/thomaspark/bootswatch/tree/gh-pages/swatchmaker).
14
+
15
+ To customize Geo edit `/swatch/variables.less` and `/swatch/bootswatch.less`. Refer to the Swatchmaker [README](https://github.com/thomaspark/bootswatch/tree/gh-pages/swatchmaker) for instructions to regenerate the Bootstrap stylesheet.
16
+
17
+ ## License
18
+
19
+ Copyright (c) 2013 Divshot
20
+
21
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
22
+
23
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "geo-bootstrap",
3
+ "description": "Geo is the coolest theme for Twitter Bootstrap.",
4
+ "version": "1.0.0",
5
+ "author": "Divshot",
6
+ "homepage": "http://divshot.com/",
7
+ "license": "Apache License, Version 2.0, http://www.apache.org/licenses/LICENSE-2.0",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git://github.com:divshot/geo-bootstrap.git"
11
+ },
12
+ "engines": {
13
+ "node": ">= 0.8.11"
14
+ },
15
+ "devDependencies": {
16
+ "grunt": "~0.4.0",
17
+ "grunt-recess": "~0.3.1",
18
+ "grunt-contrib-concat": "~0.1.3",
19
+ "grunt-contrib-clean": "~0.4.0"
20
+ }
21
+ }