ruined 0.0.7 → 0.0.8
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/ChangeLog +45 -36
- data/lib/ruined/css/ruin.css +25 -1
- data/lib/ruined/html/main.html +244 -231
- data/lib/ruined/ruinmain.rb +28 -5
- metadata +4 -4
data/ChangeLog
CHANGED
@@ -1,36 +1,45 @@
|
|
1
|
-
|
2
|
-
* ruined/ruinmain.rb
|
3
|
-
version 0.0.5 => 0.0.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
*
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
*
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
Mon Oct 11
|
36
|
-
|
1
|
+
Sun Oct 17 19:09:00 2010 arton
|
2
|
+
* ruined/ruinmain.rb
|
3
|
+
version 0.0.5 => 0.0.8
|
4
|
+
retuens thread-list
|
5
|
+
* ruined/css/ruin.css
|
6
|
+
move style from main.html to here
|
7
|
+
* ruined/html/main.html
|
8
|
+
add thread list pane.
|
9
|
+
adjust some styles.
|
10
|
+
Thu Oct 14 20:14:00 2010 arton
|
11
|
+
* ruined/ruinmain.rb
|
12
|
+
version 0.0.5 => 0.0.7
|
13
|
+
fix caller check
|
14
|
+
Wed Oct 13 22:39:00 2010 arton
|
15
|
+
* ruined/ruinmain.rb
|
16
|
+
version 0.0.5 => 0.0.6
|
17
|
+
support multi-thread app (but very limited)
|
18
|
+
Wed Oct 13 21:01:00 2010 arton
|
19
|
+
* Rakefile
|
20
|
+
add BSDL into gem
|
21
|
+
* ruined/html/main.html
|
22
|
+
escape modified value
|
23
|
+
* ruined/ruinmain.rb
|
24
|
+
version 0.0.4 => 0.0.5
|
25
|
+
escape stdout
|
26
|
+
unescape modified value
|
27
|
+
Tue Oct 12 00:17:00 2010 arton
|
28
|
+
* BSDL
|
29
|
+
* readme.txt
|
30
|
+
license changed to dual (BSDL or (GPLv3 or later))
|
31
|
+
* ruined/html/main.html
|
32
|
+
support variable modification
|
33
|
+
* ruined/ruinmain.rb
|
34
|
+
support variable modification
|
35
|
+
Mon Oct 11 21:25:00 2010 arton
|
36
|
+
* lib/ruined/ruinmain.rb
|
37
|
+
fix local vairable confliction with 'v'
|
38
|
+
change version => 0.0.3 for new gem
|
39
|
+
Mon Oct 11 18:38:00 2010 arton
|
40
|
+
* lib/ruined/ruinmain.rb
|
41
|
+
change version => 0.0.2 for new gem
|
42
|
+
Mon Oct 11 15:51:00 2010 arton
|
43
|
+
start brwoser (suggested by knu and n0kada, thanks)
|
44
|
+
Mon Oct 11 01:37:00 2010 arton
|
45
|
+
initial release
|
data/lib/ruined/css/ruin.css
CHANGED
@@ -9,6 +9,10 @@ pre {
|
|
9
9
|
margin-top: 0.5em;
|
10
10
|
}
|
11
11
|
|
12
|
+
td.numtd {
|
13
|
+
text-align: right;
|
14
|
+
}
|
15
|
+
|
12
16
|
table {
|
13
17
|
border-spacing: 0;
|
14
18
|
}
|
@@ -25,9 +29,11 @@ table.vars td {
|
|
25
29
|
div.list-pane {
|
26
30
|
float: left;
|
27
31
|
width: 60%;
|
32
|
+
height: 60%;
|
28
33
|
}
|
29
34
|
|
30
|
-
div.vars-
|
35
|
+
div.vars-pane {
|
36
|
+
height: 60%;
|
31
37
|
}
|
32
38
|
|
33
39
|
div#button-panel {
|
@@ -52,7 +58,25 @@ div#vars {
|
|
52
58
|
height: 520px;
|
53
59
|
}
|
54
60
|
|
61
|
+
div.proc-pane {
|
62
|
+
clear: both;
|
63
|
+
height: 30%;
|
64
|
+
}
|
65
|
+
|
55
66
|
div#output {
|
56
67
|
overflow: scroll;
|
57
68
|
height: 120px;
|
69
|
+
float: left;
|
70
|
+
width: 60%;
|
71
|
+
}
|
72
|
+
|
73
|
+
div#threads {
|
74
|
+
overflow: scroll;
|
75
|
+
height: 120px;
|
76
|
+
}
|
77
|
+
|
78
|
+
div.footer {
|
79
|
+
clear: both;
|
80
|
+
margin-bottom: 0;
|
81
|
+
height: 5%;
|
58
82
|
}
|
data/lib/ruined/html/main.html
CHANGED
@@ -1,231 +1,244 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
-
<html> <head>
|
3
|
-
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
4
|
-
<meta http-equiv="content-style-type" content="text/css"/>
|
5
|
-
<title></title>
|
6
|
-
<link rel="stylesheet" href="../css/smoothness/jquery-ui-1.8.5.custom.css"></link>
|
7
|
-
<link rel="stylesheet" href="../css/ruin.css"></link>
|
8
|
-
<script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
|
9
|
-
<script type="text/javascript" src="../js/jquery-ui-1.8.5.custom.min.js"></script>
|
10
|
-
<script type="text/javascript">
|
11
|
-
var files = new Object();
|
12
|
-
var priorLine = { line: null, index: null };
|
13
|
-
var interval = 1000;
|
14
|
-
var contTimer = null;
|
15
|
-
function addFile(name, line, command) {
|
16
|
-
var a = name.split('/');
|
17
|
-
$('#lists').tabs('add' , '/debug/file/' + name , a[a.length - 1]);
|
18
|
-
var index = $('#lists').tabs('length') - 1;
|
19
|
-
$('#lists').tabs('select', index);
|
20
|
-
$('td').bind('click', function(ev) {
|
21
|
-
var sub = 'false';
|
22
|
-
if (ev.currentTarget.style.backgroundColor == '') {
|
23
|
-
sub = 'true';
|
24
|
-
}
|
25
|
-
var index = $('#lists').tabs('option', 'selected');
|
26
|
-
var key, file;
|
27
|
-
for (key in files) {
|
28
|
-
if (files[key] == index) {
|
29
|
-
file = key;
|
30
|
-
break;
|
31
|
-
}
|
32
|
-
}
|
33
|
-
if (file != null) {
|
34
|
-
var line = 0;
|
35
|
-
var list = $('#ui-tabs-' + (index * 2 + 2) + ' > table > tbody > tr > td');
|
36
|
-
for (var i = 0; i < list.length; i++) {
|
37
|
-
if (list[i] == ev.currentTarget) {
|
38
|
-
line = i + 1;
|
39
|
-
break;
|
40
|
-
}
|
41
|
-
}
|
42
|
-
$.get('/debug/break/' + sub + '/' + file + '/' + line, function() {
|
43
|
-
var bgclr = '';
|
44
|
-
var clr = '';
|
45
|
-
if (sub == 'true') {
|
46
|
-
bgclr = 'saddlebrown';
|
47
|
-
clr = 'white';
|
48
|
-
}
|
49
|
-
ev.currentTarget.style.backgroundColor = bgclr;
|
50
|
-
ev.currentTarget.style.color = clr;
|
51
|
-
});
|
52
|
-
}
|
53
|
-
});
|
54
|
-
return index;
|
55
|
-
}
|
56
|
-
function changeTab(index) {
|
57
|
-
$('#lists').tabs('select', index);
|
58
|
-
}
|
59
|
-
function lineColor(command, brk) {
|
60
|
-
if (command == 'cont' && !brk) {
|
61
|
-
return 'aquamarine';
|
62
|
-
}
|
63
|
-
return 'yellow';
|
64
|
-
}
|
65
|
-
function stopRun() {
|
66
|
-
clearTimeout(contTimer);
|
67
|
-
contTimer = null;
|
68
|
-
$('#run').button('option', 'label', 'run');
|
69
|
-
}
|
70
|
-
function setLine(index, line, command, brk) {
|
71
|
-
if (line > 0) {
|
72
|
-
--line;
|
73
|
-
}
|
74
|
-
if (priorLine.index != null) {
|
75
|
-
var style = $('#ui-tabs-' + (priorLine.index * 2 + 2) + ' > table > tbody > tr > td')[priorLine.line].style;
|
76
|
-
style.backgroundColor = priorLine.backgroundColor;
|
77
|
-
style.color = priorLine.color;
|
78
|
-
}
|
79
|
-
var style = $('#ui-tabs-' + (index * 2 + 2) + ' > table > tbody > tr > td')[line].style;
|
80
|
-
priorLine.index = index;
|
81
|
-
priorLine.line = line;
|
82
|
-
priorLine.color = style.color;
|
83
|
-
priorLine.backgroundColor = style.backgroundColor;
|
84
|
-
style.backgroundColor = lineColor(command, brk);
|
85
|
-
style.color = '';
|
86
|
-
$('#ui-tabs-' + (index * 2 + 2) + ' > table > tbody > tr > td')[line].scrollIntoView(true);
|
87
|
-
}
|
88
|
-
function stepProc(command) {
|
89
|
-
$.getJSON('/debug/' + command, function(data) {
|
90
|
-
if (data == null || data.file == null) {
|
91
|
-
if (contTimer != null) stopRun();
|
92
|
-
$('button').button('disable');
|
93
|
-
return;
|
94
|
-
}
|
95
|
-
if (data['break'] || data['event'] == 'exit') {
|
96
|
-
stopRun();
|
97
|
-
if (data['event'] == 'exit') {
|
98
|
-
$('button').button('disable');
|
99
|
-
$('#vars').tabs({
|
100
|
-
show: function(envet, ui) {
|
101
|
-
alert('program terminated');
|
102
|
-
}
|
103
|
-
});
|
104
|
-
alert('program exit');
|
105
|
-
}
|
106
|
-
}
|
107
|
-
if (files[data.file] == null) {
|
108
|
-
files[data.file] = addFile(data.file, data.line, command);
|
109
|
-
} else {
|
110
|
-
changeTab(files[data.file]);
|
111
|
-
}
|
112
|
-
setLine(files[data.file], data.line, command, data['break']);
|
113
|
-
$('#vars').tabs('load', $('#vars').tabs('option', 'selected'));
|
114
|
-
var
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
}
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
}
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
})
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
$('
|
173
|
-
$('#
|
174
|
-
|
175
|
-
|
176
|
-
$('#
|
177
|
-
}
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
$('
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
</div>
|
210
|
-
<div
|
211
|
-
|
212
|
-
<
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
<
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
</div>
|
231
|
-
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html> <head>
|
3
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
4
|
+
<meta http-equiv="content-style-type" content="text/css"/>
|
5
|
+
<title></title>
|
6
|
+
<link rel="stylesheet" href="../css/smoothness/jquery-ui-1.8.5.custom.css"></link>
|
7
|
+
<link rel="stylesheet" href="../css/ruin.css"></link>
|
8
|
+
<script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
|
9
|
+
<script type="text/javascript" src="../js/jquery-ui-1.8.5.custom.min.js"></script>
|
10
|
+
<script type="text/javascript">
|
11
|
+
var files = new Object();
|
12
|
+
var priorLine = { line: null, index: null };
|
13
|
+
var interval = 1000;
|
14
|
+
var contTimer = null;
|
15
|
+
function addFile(name, line, command) {
|
16
|
+
var a = name.split('/');
|
17
|
+
$('#lists').tabs('add' , '/debug/file/' + name , a[a.length - 1]);
|
18
|
+
var index = $('#lists').tabs('length') - 1;
|
19
|
+
$('#lists').tabs('select', index);
|
20
|
+
$('td').bind('click', function(ev) {
|
21
|
+
var sub = 'false';
|
22
|
+
if (ev.currentTarget.style.backgroundColor == '') {
|
23
|
+
sub = 'true';
|
24
|
+
}
|
25
|
+
var index = $('#lists').tabs('option', 'selected');
|
26
|
+
var key, file;
|
27
|
+
for (key in files) {
|
28
|
+
if (files[key] == index) {
|
29
|
+
file = key;
|
30
|
+
break;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
if (file != null) {
|
34
|
+
var line = 0;
|
35
|
+
var list = $('#ui-tabs-' + (index * 2 + 2) + ' > table > tbody > tr > td');
|
36
|
+
for (var i = 0; i < list.length; i++) {
|
37
|
+
if (list[i] == ev.currentTarget) {
|
38
|
+
line = i + 1;
|
39
|
+
break;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
$.get('/debug/break/' + sub + '/' + file + '/' + line, function() {
|
43
|
+
var bgclr = '';
|
44
|
+
var clr = '';
|
45
|
+
if (sub == 'true') {
|
46
|
+
bgclr = 'saddlebrown';
|
47
|
+
clr = 'white';
|
48
|
+
}
|
49
|
+
ev.currentTarget.style.backgroundColor = bgclr;
|
50
|
+
ev.currentTarget.style.color = clr;
|
51
|
+
});
|
52
|
+
}
|
53
|
+
});
|
54
|
+
return index;
|
55
|
+
}
|
56
|
+
function changeTab(index) {
|
57
|
+
$('#lists').tabs('select', index);
|
58
|
+
}
|
59
|
+
function lineColor(command, brk) {
|
60
|
+
if (command == 'cont' && !brk) {
|
61
|
+
return 'aquamarine';
|
62
|
+
}
|
63
|
+
return 'yellow';
|
64
|
+
}
|
65
|
+
function stopRun() {
|
66
|
+
clearTimeout(contTimer);
|
67
|
+
contTimer = null;
|
68
|
+
$('#run').button('option', 'label', 'run');
|
69
|
+
}
|
70
|
+
function setLine(index, line, command, brk) {
|
71
|
+
if (line > 0) {
|
72
|
+
--line;
|
73
|
+
}
|
74
|
+
if (priorLine.index != null) {
|
75
|
+
var style = $('#ui-tabs-' + (priorLine.index * 2 + 2) + ' > table > tbody > tr > td')[priorLine.line].style;
|
76
|
+
style.backgroundColor = priorLine.backgroundColor;
|
77
|
+
style.color = priorLine.color;
|
78
|
+
}
|
79
|
+
var style = $('#ui-tabs-' + (index * 2 + 2) + ' > table > tbody > tr > td')[line].style;
|
80
|
+
priorLine.index = index;
|
81
|
+
priorLine.line = line;
|
82
|
+
priorLine.color = style.color;
|
83
|
+
priorLine.backgroundColor = style.backgroundColor;
|
84
|
+
style.backgroundColor = lineColor(command, brk);
|
85
|
+
style.color = '';
|
86
|
+
$('#ui-tabs-' + (index * 2 + 2) + ' > table > tbody > tr > td')[line].scrollIntoView(true);
|
87
|
+
}
|
88
|
+
function stepProc(command) {
|
89
|
+
$.getJSON('/debug/' + command, function(data) {
|
90
|
+
if (data == null || data.file == null) {
|
91
|
+
if (contTimer != null) stopRun();
|
92
|
+
$('button').button('disable');
|
93
|
+
return;
|
94
|
+
}
|
95
|
+
if (data['break'] || data['event'] == 'exit') {
|
96
|
+
stopRun();
|
97
|
+
if (data['event'] == 'exit') {
|
98
|
+
$('button').button('disable');
|
99
|
+
$('#vars').tabs({
|
100
|
+
show: function(envet, ui) {
|
101
|
+
alert('program terminated');
|
102
|
+
}
|
103
|
+
});
|
104
|
+
alert('program exit');
|
105
|
+
}
|
106
|
+
}
|
107
|
+
if (files[data.file] == null) {
|
108
|
+
files[data.file] = addFile(data.file, data.line, command);
|
109
|
+
} else {
|
110
|
+
changeTab(files[data.file]);
|
111
|
+
}
|
112
|
+
setLine(files[data.file], data.line, command, data['break']);
|
113
|
+
$('#vars').tabs('load', $('#vars').tabs('option', 'selected'));
|
114
|
+
var s = '<table class="vars"><tr><th>br</th><th>File</th><th>Line</th><th>Status</th></tr>';
|
115
|
+
for (var i = 0; i < data.threads.length; i++) {
|
116
|
+
if (data.threads.length > 1) {
|
117
|
+
}
|
118
|
+
var t = data.threads[i][0];
|
119
|
+
s += '<tr><td>' + (t.self ? '*' : '') + '</td><td>' + t.file + '</td><td class="numtd">' + t.line
|
120
|
+
+ '</td><td>' + t.status + '</td></tr>';
|
121
|
+
}
|
122
|
+
$('#tlist')[0].innerHTML = s + '</table>';
|
123
|
+
var span = document.createElement('span');
|
124
|
+
span.innerHTML = data.stdout;
|
125
|
+
$('#stdout')[0].appendChild(span);
|
126
|
+
span = document.createElement('span');
|
127
|
+
$('#stdout')[0].appendChild(span);
|
128
|
+
span.scrollIntoView(true);
|
129
|
+
});
|
130
|
+
}
|
131
|
+
function contProc(command) {
|
132
|
+
stepProc(command);
|
133
|
+
contTimer = setTimeout('contProc("' + command + '");', interval);
|
134
|
+
}
|
135
|
+
function initTabs(elm) {
|
136
|
+
elm.tabs();
|
137
|
+
elm.tabs({ajaxOptions: {async: false}});
|
138
|
+
elm.tabs('option', 'cache', true);
|
139
|
+
}
|
140
|
+
$(document).ready(function() {
|
141
|
+
initTabs($('#lists'));
|
142
|
+
initTabs($('#vars'));
|
143
|
+
$('#vars').tabs({
|
144
|
+
show: function(envet, ui) {
|
145
|
+
$('#vars').tabs('load', $('#vars').tabs('option', 'selected'));
|
146
|
+
},
|
147
|
+
load: function(event, ui) {
|
148
|
+
$('.var-value').dblclick(function(e) {
|
149
|
+
var v = e.currentTarget.innerHTML;
|
150
|
+
e.currentTarget.innerHTML = '<input type="text" value="' + v + '"/>';
|
151
|
+
setTimeout(function() {
|
152
|
+
e.currentTarget.childNodes.item(0).focus();
|
153
|
+
$(e.currentTarget.childNodes.item(0)).focusout(function(ev) {
|
154
|
+
var loc = 'locals/';
|
155
|
+
if ($('#vars').tabs('option', 'selected') == 1) {
|
156
|
+
loc = 'self/';
|
157
|
+
} else if ($('#vars').tabs('option', 'selected') == 2) {
|
158
|
+
loc = 'globals/';
|
159
|
+
}
|
160
|
+
var url = '/debug/' + loc
|
161
|
+
+ encodeURIComponent(e.currentTarget.previousSibling.innerHTML)
|
162
|
+
+ '/' + encodeURIComponent(ev.currentTarget.value);
|
163
|
+
e.currentTarget.innerHTML = ev.currentTarget.value;
|
164
|
+
$.get(url, function() {
|
165
|
+
$('#vars').tabs('load', $('#vars').tabs('option', 'selected'));
|
166
|
+
});
|
167
|
+
});
|
168
|
+
}, 0);
|
169
|
+
});
|
170
|
+
}
|
171
|
+
});
|
172
|
+
$('#intval').slider();
|
173
|
+
$('#intval').slider('option', 'value', 10);
|
174
|
+
$('#intval').slider({
|
175
|
+
change: function(e, ui) {
|
176
|
+
interval = $('#intval').slider('option', 'value') * 100;
|
177
|
+
}
|
178
|
+
});
|
179
|
+
$.ajaxSetup({cache: false});
|
180
|
+
|
181
|
+
$('button').button();
|
182
|
+
$('#run').click(function() {
|
183
|
+
if (contTimer == null) {
|
184
|
+
contProc('cont');
|
185
|
+
$('#run').button('option', 'label', 'stop');
|
186
|
+
} else {
|
187
|
+
stopRun();
|
188
|
+
}
|
189
|
+
});
|
190
|
+
$('#step').click(function() {
|
191
|
+
stepProc('step');
|
192
|
+
});
|
193
|
+
$('#waiting').ajaxError(function() {
|
194
|
+
if (contTimer != null) {
|
195
|
+
stopRun();
|
196
|
+
}
|
197
|
+
});
|
198
|
+
stepProc('stepping');
|
199
|
+
});
|
200
|
+
</script>
|
201
|
+
</head>
|
202
|
+
<body>
|
203
|
+
<div class="list-pane">
|
204
|
+
<div id="button-panel">
|
205
|
+
<div class="console">
|
206
|
+
<button id="step">Step</button>
|
207
|
+
<button id="run">Run</button>
|
208
|
+
</div>
|
209
|
+
</div>
|
210
|
+
<div id="speed-panel">
|
211
|
+
<div id="intval"></div>
|
212
|
+
<div style="float: left; width: 50%">fast <----</div>
|
213
|
+
<div style="float: right">----> slow</div>
|
214
|
+
</div>
|
215
|
+
<div id="lists" style="clear: both">
|
216
|
+
<ul></ul>
|
217
|
+
</div>
|
218
|
+
</div>
|
219
|
+
<div class="vars-pane">
|
220
|
+
<div id="vars">
|
221
|
+
<ul>
|
222
|
+
<li><a href="/debug/locals" title="Local Vars"><span>Local Vars</span></a></li>
|
223
|
+
<li><a href="/debug/self" title="Self Vars"><span>Self Vars</span></a></li>
|
224
|
+
<li><a href="/debug/globals" title="Global Vars"><span>Global Vars</span></a></li>
|
225
|
+
</ul>
|
226
|
+
<div id="Local_Vars"></div>
|
227
|
+
<div id="Self_Vars"></div>
|
228
|
+
<div id="Global_Vars"></div>
|
229
|
+
</div>
|
230
|
+
</div>
|
231
|
+
<div class="proc-pane">
|
232
|
+
<div id="output">
|
233
|
+
<span id="stdout"></span>
|
234
|
+
</div>
|
235
|
+
<div id="threads">
|
236
|
+
<span id="tlist"></span>
|
237
|
+
</div>
|
238
|
+
<div class="footer">
|
239
|
+
<hr>
|
240
|
+
<div id="waiting"></div>
|
241
|
+
<address id="ruby-platform"></address>
|
242
|
+
<!-- hhmts start --> Last modified: Sun Oct 17 19:05:48 +0900 2010 <!-- hhmts end -->
|
243
|
+
</div>
|
244
|
+
</body> </html>
|
data/lib/ruined/ruinmain.rb
CHANGED
@@ -9,14 +9,15 @@ require 'monitor'
|
|
9
9
|
require 'stringio'
|
10
10
|
|
11
11
|
module Ruined
|
12
|
-
RUINED_VERSION = '0.0.
|
12
|
+
RUINED_VERSION = '0.0.8'
|
13
13
|
|
14
14
|
@queue = [Queue.new, Queue.new]
|
15
15
|
@breakpoints = []
|
16
16
|
@monitor = Monitor.new
|
17
17
|
IGNORES = [:$&, :$', :$+, :$_, :$`, :$~, :$KCODE, :$= ]
|
18
18
|
@unbreakable_threads = []
|
19
|
-
|
19
|
+
@user_threads = { }
|
20
|
+
|
20
21
|
class <<Thread
|
21
22
|
alias :_original_start :start
|
22
23
|
def start(&proc)
|
@@ -48,7 +49,7 @@ module Ruined
|
|
48
49
|
end
|
49
50
|
def to_hash
|
50
51
|
{ :event => @event, :file => @file, :line => @line, :id => @iid, :break => @break,
|
51
|
-
:stdout => @stdout }
|
52
|
+
:stdout => @stdout, :threads => Ruined.user_threads(self) }
|
52
53
|
end
|
53
54
|
attr_reader :tlses, :file, :line, :iid, :binding, :break
|
54
55
|
attr_accessor :event, :stdout
|
@@ -183,7 +184,7 @@ module Ruined
|
|
183
184
|
end
|
184
185
|
|
185
186
|
def self.current_context
|
186
|
-
|
187
|
+
raise RuntimeException.new('bug: no context !!') unless @current
|
187
188
|
@current.to_hash
|
188
189
|
end
|
189
190
|
|
@@ -290,6 +291,28 @@ EOD
|
|
290
291
|
def self.local_call?(addr)
|
291
292
|
['127.0.0.1', '::1'].include?(addr[3])
|
292
293
|
end
|
294
|
+
|
295
|
+
def self.user_threads(current)
|
296
|
+
r = []
|
297
|
+
@monitor.synchronize {
|
298
|
+
@user_threads.each do |t, c|
|
299
|
+
r << [:file => File.basename(c.file), :line => c.line,
|
300
|
+
:self => (c == current),
|
301
|
+
:status => status_to_s(t.status)]
|
302
|
+
end
|
303
|
+
r
|
304
|
+
}
|
305
|
+
end
|
306
|
+
|
307
|
+
def self.status_to_s(s)
|
308
|
+
if s.nil?
|
309
|
+
'dead'
|
310
|
+
elsif s == false
|
311
|
+
'aborted'
|
312
|
+
else
|
313
|
+
s
|
314
|
+
end
|
315
|
+
end
|
293
316
|
|
294
317
|
svr.mount('/debug', DebugServlet)
|
295
318
|
svr.mount_proc('/quit') do |req, res|
|
@@ -328,7 +351,7 @@ EOD
|
|
328
351
|
end
|
329
352
|
b = breakpoints.include? [file, line]
|
330
353
|
ctxt = @monitor.synchronize {
|
331
|
-
Context.new(event, file, line, id, binding, b, output)
|
354
|
+
@user_threads[Thread.current] = Context.new(event, file, line, id, binding, b, output)
|
332
355
|
}
|
333
356
|
svr.logger.debug(ctxt.inspect)
|
334
357
|
release 1, ctxt
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruined
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 8
|
10
|
+
version: 0.0.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- arton
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-17 00:00:00 +09:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|