sinatra-websocketio 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/lib/js/websocketio.js +3 -2
- data/lib/sinatra-websocketio/version.rb +1 -1
- data/sample/config.ru +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a654ec2bcb1ba0ee5e198306a2b4615ea172e90
|
4
|
+
data.tar.gz: 6af500371fd8cc6f766e73a0a02da89822b5a4b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4a1d0d472453f84155e6949b5e39dc6ffaf356925eb8c4e20a2d8c1b7019f871bf6312f8223d6b4cb845277be0a0dc08cba1d629cfc28502fa3e87e5f6b34c6
|
7
|
+
data.tar.gz: fe742255866c88822115c6f9b6725334891fc3041f89962c2c638c091b2803b441b26bca74a06d81a8f4fe8a7019efe44255cc1ed87defd41a4985b060f5c9cd
|
data/History.txt
CHANGED
data/lib/js/websocketio.js
CHANGED
@@ -23,13 +23,14 @@ var WebSocketIO = function(url, opts){
|
|
23
23
|
var url = self.session ? self.url+"/session="+self.session : self.url;
|
24
24
|
self.websocket = new WebSocket(url);
|
25
25
|
self.websocket.onmessage = function(e){
|
26
|
+
var data_ = null
|
26
27
|
try{
|
27
|
-
|
28
|
-
self.emit(data_.type, data_.data);
|
28
|
+
data_ = JSON.parse(e.data);
|
29
29
|
}
|
30
30
|
catch(e){
|
31
31
|
self.emit("error", "WebSocketIO data parse error");
|
32
32
|
}
|
33
|
+
if(!!data_) self.emit(data_.type, data_.data);
|
33
34
|
};
|
34
35
|
self.websocket.onclose = function(){
|
35
36
|
if(self.connecting){
|
data/sample/config.ru
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-websocketio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Hashimoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|