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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2fa540eb66cc926e8a9cd4311d3efec37fd986e3
4
- data.tar.gz: 251e986c12d0f05af5fb4ec5a9639b534190039c
3
+ metadata.gz: 2a654ec2bcb1ba0ee5e198306a2b4615ea172e90
4
+ data.tar.gz: 6af500371fd8cc6f766e73a0a02da89822b5a4b4
5
5
  SHA512:
6
- metadata.gz: 5f44d916b86b331e811ead4d28cef616a669e7ad6863b8df0a9e03b32703d5072a9c9ae0d64fe54924d91b7a84bdd96fbeb7d0955b9dbcac8ca09b7986c125e1
7
- data.tar.gz: 90b5f162b7f974f57122a4c998528b5918734a40698d47cf84df3fc878bd2eaf7de240403da206be560715c340d7f76fe3c14e5535a07c733f7700850d4c9567
6
+ metadata.gz: b4a1d0d472453f84155e6949b5e39dc6ffaf356925eb8c4e20a2d8c1b7019f871bf6312f8223d6b4cb845277be0a0dc08cba1d629cfc28502fa3e87e5f6b34c6
7
+ data.tar.gz: fe742255866c88822115c6f9b6725334891fc3041f89962c2c638c091b2803b441b26bca74a06d81a8f4fe8a7019efe44255cc1ed87defd41a4985b060f5c9cd
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.3.2 2013-06-05
2
+
3
+ * bugfix error catching in JS lib
4
+
1
5
  === 0.3.1 2013-05-27
2
6
 
3
7
  * add constructor args in JS lib
@@ -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
- var data_ = JSON.parse(e.data);
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){
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module WebSocketIO
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
5
5
  end
data/sample/config.ru CHANGED
@@ -9,6 +9,8 @@ if development?
9
9
  $:.unshift File.expand_path '../lib', File.dirname(__FILE__)
10
10
  end
11
11
  require 'sinatra/websocketio'
12
+ require 'sass'
13
+ require 'haml'
12
14
  require File.dirname(__FILE__)+'/main'
13
15
 
14
16
  set :haml, :escape_html => true
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.1
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-05-26 00:00:00.000000000 Z
11
+ date: 2013-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest