sinatra-websocketio 0.2.9 → 0.3.0

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: f1416c915c6dafcf271982799675187ac2fc5b4f
4
- data.tar.gz: 513c07b5cb3e00046410096232b1b8b0467e7d8a
3
+ metadata.gz: b83dc719bf8ed37455c090ba2287913f329aced2
4
+ data.tar.gz: 47d6068f5cc0d471615b4f722592e47e9a977d4b
5
5
  SHA512:
6
- metadata.gz: abffe18f4453b454193320a29682713457194289175852267d7f3981daebfe575ecd0abf250bd01f8f592c3dfc9cf048e4603e760c737d384bfafd04ded130da
7
- data.tar.gz: 0d904cad61245d1879ef440a058784201421d437bf809b0f463538946fb7d75cd7b1f3229a016f50c06590e12420b473d2747fafa880391f40e706b25653c553
6
+ metadata.gz: 49abc41bf2af0cbb67b8e324c36c2f70fb1adc7fb9a4f56db05537ae124a03643936488c66197af4514a4b99274875184dc64fe178b0726b5a8b5d983d1e8563
7
+ data.tar.gz: 1af7b11d20f46cd4acb4c1aca348d6184c15df88095dad24e811802b40c0e903310413d424c957330bae95dce32571e7aeeabdf6117b007e632da1d18602c7f3
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.3.0 2013-05-24
2
+
3
+ * bugfix Ruby Client
4
+
1
5
  === 0.2.9 2013-05-15
2
6
 
3
7
  * push "__heartbeat" in Ruby Client for detecting disconnect event
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module WebSocketIO
3
- VERSION = "0.2.9"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
@@ -31,7 +31,7 @@ module Sinatra
31
31
  @thread_heartbeat = Thread.new do
32
32
  while @connecting
33
33
  push :__heartbeat, {:time => Time.now.to_i}
34
- sleep 10
34
+ sleep 5
35
35
  end
36
36
  end
37
37
  end
@@ -44,10 +44,13 @@ module Sinatra
44
44
  url = @session ? "#{@url}/session=#{@session}" : @url
45
45
  @websocket = nil
46
46
  begin
47
- @websocket = WebSocket::Client::Simple::Client.new url
47
+ Timeout::timeout @timeout do
48
+ @websocket = WebSocket::Client::Simple::Client.new url
49
+ end
48
50
  rescue StandardError, Timeout::Error => e
51
+ this.emit :error, e
49
52
  Thread.new do
50
- sleep 5
53
+ sleep 5
51
54
  connect
52
55
  end
53
56
  end
@@ -68,10 +71,8 @@ module Sinatra
68
71
  this.emit :disconnect, e
69
72
  end
70
73
  if this.running
71
- Thread.new do
72
- sleep 5
73
- this.connect
74
- end
74
+ sleep 1
75
+ this.connect
75
76
  end
76
77
  end
77
78
 
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.2.9
4
+ version: 0.3.0
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-14 00:00:00.000000000 Z
11
+ date: 2013-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -245,3 +245,4 @@ test_files:
245
245
  - test/app/main.rb
246
246
  - test/test_helper.rb
247
247
  - test/test_websocketio.rb
248
+ has_rdoc: