async-debug 0.1.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/debug/application.rb +21 -0
- data/lib/async/debug/reactor_view.rb +7 -24
- data/lib/async/debug/version.rb +3 -20
- data/lib/async/debug.rb +15 -71
- data/license.md +21 -0
- data/readme.md +27 -0
- data.tar.gz.sig +0 -0
- metadata +45 -182
- metadata.gz.sig +0 -0
- data/pages/_heading.xnode +0 -2
- data/pages/_page.xnode +0 -42
- data/pages/controller.rb +0 -19
- data/pages/errors/exception.xnode +0 -5
- data/pages/errors/file-not-found.xnode +0 -5
- data/pages/index.xnode +0 -3
- data/pages/links.yaml +0 -4
- data/public/_components/@socketry/live/live.js +0 -157
- data/public/_components/@socketry/live/live.min.js +0 -1
- data/public/_components/jquery/jquery.js +0 -10872
- data/public/_components/jquery/jquery.min.js +0 -2
- data/public/_components/jquery/jquery.min.map +0 -1
- data/public/_components/jquery/jquery.slim.js +0 -8777
- data/public/_components/jquery/jquery.slim.min.js +0 -2
- data/public/_components/jquery/jquery.slim.min.map +0 -1
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.apache.css +0 -12
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.applescript.css +0 -5
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.assembly.css +0 -8
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.bash-script.css +0 -4
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.bash.css +0 -2
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.clang.css +0 -6
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.css.css +0 -14
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.diff.css +0 -16
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.html.css +0 -5
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.ocaml.css +0 -3
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.protobuf.css +0 -2
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.python.css +0 -6
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.ruby.css +0 -2
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.xml.css +0 -35
- data/public/_components/jquery-syntax/base/jquery.syntax.core.css +0 -58
- data/public/_components/jquery-syntax/base/jquery.syntax.editor.css +0 -6
- data/public/_components/jquery-syntax/base/theme.js +0 -1
- data/public/_components/jquery-syntax/bright/jquery.syntax.core.css +0 -27
- data/public/_components/jquery-syntax/bright/theme.js +0 -1
- data/public/_components/jquery-syntax/jquery.syntax.brush.apache.js +0 -3
- data/public/_components/jquery-syntax/jquery.syntax.brush.applescript.js +0 -5
- data/public/_components/jquery-syntax/jquery.syntax.brush.assembly.js +0 -3
- data/public/_components/jquery-syntax/jquery.syntax.brush.bash-script.js +0 -4
- data/public/_components/jquery-syntax/jquery.syntax.brush.bash.js +0 -2
- data/public/_components/jquery-syntax/jquery.syntax.brush.basic.js +0 -5
- data/public/_components/jquery-syntax/jquery.syntax.brush.clang.js +0 -5
- data/public/_components/jquery-syntax/jquery.syntax.brush.csharp.js +0 -4
- data/public/_components/jquery-syntax/jquery.syntax.brush.css.js +0 -5
- data/public/_components/jquery-syntax/jquery.syntax.brush.diff.js +0 -2
- data/public/_components/jquery-syntax/jquery.syntax.brush.go.js +0 -3
- data/public/_components/jquery-syntax/jquery.syntax.brush.haskell.js +0 -3
- data/public/_components/jquery-syntax/jquery.syntax.brush.html.js +0 -4
- data/public/_components/jquery-syntax/jquery.syntax.brush.io.js +0 -3
- data/public/_components/jquery-syntax/jquery.syntax.brush.java.js +0 -4
- data/public/_components/jquery-syntax/jquery.syntax.brush.javascript.js +0 -3
- data/public/_components/jquery-syntax/jquery.syntax.brush.kai.js +0 -2
- data/public/_components/jquery-syntax/jquery.syntax.brush.lisp.js +0 -2
- data/public/_components/jquery-syntax/jquery.syntax.brush.lua.js +0 -3
- data/public/_components/jquery-syntax/jquery.syntax.brush.nginx.js +0 -2
- data/public/_components/jquery-syntax/jquery.syntax.brush.ocaml.js +0 -4
- data/public/_components/jquery-syntax/jquery.syntax.brush.ooc.js +0 -4
- data/public/_components/jquery-syntax/jquery.syntax.brush.pascal.js +0 -4
- data/public/_components/jquery-syntax/jquery.syntax.brush.perl5.js +0 -3
- data/public/_components/jquery-syntax/jquery.syntax.brush.php-script.js +0 -4
- data/public/_components/jquery-syntax/jquery.syntax.brush.php.js +0 -2
- data/public/_components/jquery-syntax/jquery.syntax.brush.plain.js +0 -2
- data/public/_components/jquery-syntax/jquery.syntax.brush.protobuf.js +0 -3
- data/public/_components/jquery-syntax/jquery.syntax.brush.python.js +0 -5
- data/public/_components/jquery-syntax/jquery.syntax.brush.ruby.js +0 -5
- data/public/_components/jquery-syntax/jquery.syntax.brush.scala.js +0 -4
- data/public/_components/jquery-syntax/jquery.syntax.brush.smalltalk.js +0 -2
- data/public/_components/jquery-syntax/jquery.syntax.brush.sql.js +0 -4
- data/public/_components/jquery-syntax/jquery.syntax.brush.super-collider.js +0 -3
- data/public/_components/jquery-syntax/jquery.syntax.brush.swift.js +0 -3
- data/public/_components/jquery-syntax/jquery.syntax.brush.trenni.js +0 -2
- data/public/_components/jquery-syntax/jquery.syntax.brush.xml.js +0 -4
- data/public/_components/jquery-syntax/jquery.syntax.brush.yaml.js +0 -2
- data/public/_components/jquery-syntax/jquery.syntax.cache.js +0 -7
- data/public/_components/jquery-syntax/jquery.syntax.core.js +0 -34
- data/public/_components/jquery-syntax/jquery.syntax.editor.js +0 -11
- data/public/_components/jquery-syntax/jquery.syntax.js +0 -8
- data/public/_components/jquery-syntax/jquery.syntax.min.js +0 -13
- data/public/_components/jquery-syntax/paper/jquery.syntax.core.css +0 -31
- data/public/_components/jquery-syntax/paper/theme.js +0 -1
- data/public/_components/morphdom/morphdom-esm.js +0 -755
- data/public/_components/morphdom/morphdom-factory.js +0 -691
- data/public/_components/morphdom/morphdom-umd.js +0 -763
- data/public/_components/morphdom/morphdom-umd.min.js +0 -1
- data/public/_components/morphdom/morphdom.js +0 -757
- data/public/_static/icon.png +0 -0
- data/public/_static/links.js +0 -21
- /data/public/_static/{site.css → index.css} +0 -0
@@ -1,157 +0,0 @@
|
|
1
|
-
var live = (function () {
|
2
|
-
'use strict';
|
3
|
-
|
4
|
-
class Live {
|
5
|
-
constructor(document, url) {
|
6
|
-
this.document = document;
|
7
|
-
|
8
|
-
this.url = url;
|
9
|
-
this.events = [];
|
10
|
-
|
11
|
-
this.failures = 0;
|
12
|
-
|
13
|
-
// Track visibility state and connect if required:
|
14
|
-
this.document.addEventListener("visibilitychange", () => this.handleVisibilityChange());
|
15
|
-
this.handleVisibilityChange();
|
16
|
-
}
|
17
|
-
|
18
|
-
connect() {
|
19
|
-
if (this.server) return;
|
20
|
-
|
21
|
-
let server = this.server = new WebSocket(this.url.href);
|
22
|
-
|
23
|
-
server.onopen = () => {
|
24
|
-
this.failures = 0;
|
25
|
-
this.attach();
|
26
|
-
};
|
27
|
-
|
28
|
-
server.onmessage = (message) => {
|
29
|
-
const [name, _arguments] = JSON.parse(message.data);
|
30
|
-
|
31
|
-
this[name](..._arguments);
|
32
|
-
};
|
33
|
-
|
34
|
-
server.onerror = () => {
|
35
|
-
this.failures += 1;
|
36
|
-
};
|
37
|
-
|
38
|
-
// The remote end has disconnected:
|
39
|
-
server.onclose = () => {
|
40
|
-
this.server = null;
|
41
|
-
|
42
|
-
// We need a minimum delay otherwise this can end up immediately invoking the callback:
|
43
|
-
let delay = 100 * (this.failures + 1) ** 2;
|
44
|
-
setTimeout(() => this.connect(), delay > 60000 ? 60000 : delay);
|
45
|
-
};
|
46
|
-
}
|
47
|
-
|
48
|
-
disconnect() {
|
49
|
-
if (this.server) {
|
50
|
-
this.server.close();
|
51
|
-
this.server = null;
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
createDocumentFragment(html) {
|
56
|
-
return this.document.createRange().createContextualFragment(html);
|
57
|
-
}
|
58
|
-
|
59
|
-
// These methods are designed for RPC.
|
60
|
-
replace(id, html) {
|
61
|
-
let element = document.getElementById(id);
|
62
|
-
|
63
|
-
morphdom(element, html);
|
64
|
-
}
|
65
|
-
|
66
|
-
prepend(id, html) {
|
67
|
-
let element = document.getElementById(id);
|
68
|
-
let fragment = this.createDocumentFragment(html);
|
69
|
-
|
70
|
-
element.prepend(fragment);
|
71
|
-
}
|
72
|
-
|
73
|
-
append(id, html) {
|
74
|
-
let element = document.getElementById(id);
|
75
|
-
let fragment = this.createDocumentFragment(html);
|
76
|
-
|
77
|
-
element.append(fragment);
|
78
|
-
}
|
79
|
-
|
80
|
-
dispatch(id, type, details) {
|
81
|
-
let element = document.getElementById(id);
|
82
|
-
|
83
|
-
element.dispatchEvent(
|
84
|
-
new CustomEvent(type, details)
|
85
|
-
);
|
86
|
-
}
|
87
|
-
|
88
|
-
trigger(id, event) {
|
89
|
-
this.connect();
|
90
|
-
|
91
|
-
this.send(
|
92
|
-
JSON.stringify({id: id, event: event})
|
93
|
-
);
|
94
|
-
}
|
95
|
-
|
96
|
-
forward(id, event, details) {
|
97
|
-
this.trigger(id, {type: event.type, details: details});
|
98
|
-
}
|
99
|
-
|
100
|
-
send(message) {
|
101
|
-
try {
|
102
|
-
this.server.send(message);
|
103
|
-
} catch (error) {
|
104
|
-
this.events.push(message);
|
105
|
-
}
|
106
|
-
}
|
107
|
-
|
108
|
-
flush() {
|
109
|
-
if (this.events.length === 0) return;
|
110
|
-
|
111
|
-
let events = this.events;
|
112
|
-
this.events = [];
|
113
|
-
|
114
|
-
for (var event of events) {
|
115
|
-
this.send(event);
|
116
|
-
}
|
117
|
-
}
|
118
|
-
|
119
|
-
bind(elements) {
|
120
|
-
for (var element of elements) {
|
121
|
-
this.send(JSON.stringify({bind: element.id, data: element.dataset}));
|
122
|
-
}
|
123
|
-
}
|
124
|
-
|
125
|
-
bindElementsByClassName(selector = 'live') {
|
126
|
-
this.bind(
|
127
|
-
this.document.getElementsByClassName(selector)
|
128
|
-
);
|
129
|
-
|
130
|
-
this.flush();
|
131
|
-
}
|
132
|
-
|
133
|
-
handleVisibilityChange() {
|
134
|
-
if (document.hidden) {
|
135
|
-
this.disconnect();
|
136
|
-
} else {
|
137
|
-
this.connect();
|
138
|
-
}
|
139
|
-
}
|
140
|
-
|
141
|
-
attach() {
|
142
|
-
if (this.document.readyState === 'loading') {
|
143
|
-
this.document.addEventListener('DOMContentLoaded', () => this.bindElementsByClassName());
|
144
|
-
} else {
|
145
|
-
this.bindElementsByClassName();
|
146
|
-
}
|
147
|
-
}
|
148
|
-
}
|
149
|
-
|
150
|
-
let url = new URL('live', location.href);
|
151
|
-
url.protocol = url.protocol.replace('http', 'ws');
|
152
|
-
|
153
|
-
let live = new Live(document, url);
|
154
|
-
|
155
|
-
return live;
|
156
|
-
|
157
|
-
}());
|
@@ -1 +0,0 @@
|
|
1
|
-
var live=function(){"use strict";class Live{constructor(document,url){this.document=document;this.url=url;this.events=[];this.failures=0;this.document.addEventListener("visibilitychange",()=>this.handleVisibilityChange());this.handleVisibilityChange()}connect(){if(this.server)return;let server=this.server=new WebSocket(this.url.href);server.onopen=()=>{this.failures=0;this.attach()};server.onmessage=message=>{const[name,_arguments]=JSON.parse(message.data);this[name](..._arguments)};server.onerror=()=>{this.failures+=1};server.onclose=()=>{this.server=null;let delay=100*(this.failures+1)**2;setTimeout(()=>this.connect(),delay>6e4?6e4:delay)}}disconnect(){if(this.server){this.server.close();this.server=null}}createDocumentFragment(html){return this.document.createRange().createContextualFragment(html)}replace(id,html){let element=document.getElementById(id);morphdom(element,html)}prepend(id,html){let element=document.getElementById(id);let fragment=this.createDocumentFragment(html);element.prepend(fragment)}append(id,html){let element=document.getElementById(id);let fragment=this.createDocumentFragment(html);element.append(fragment)}dispatch(id,type,details){let element=document.getElementById(id);element.dispatchEvent(new CustomEvent(type,details))}trigger(id,event){this.connect();this.send(JSON.stringify({id:id,event:event}))}forward(id,event,details){this.trigger(id,{type:event.type,details:details})}send(message){try{this.server.send(message)}catch(error){this.events.push(message)}}flush(){if(this.events.length===0)return;let events=this.events;this.events=[];for(var event of events){this.send(event)}}bind(elements){for(var element of elements){this.send(JSON.stringify({bind:element.id,data:element.dataset}))}}bindElementsByClassName(selector="live"){this.bind(this.document.getElementsByClassName(selector));this.flush()}handleVisibilityChange(){if(document.hidden){this.disconnect()}else{this.connect()}}attach(){if(this.document.readyState==="loading"){this.document.addEventListener("DOMContentLoaded",()=>this.bindElementsByClassName())}else{this.bindElementsByClassName()}}}let url=new URL("live",location.href);url.protocol=url.protocol.replace("http","ws");let live=new Live(document,url);return live}();
|