celluloid-websocket 0.0.5 → 0.0.6

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: f1892cf289483df4b78bc3aa50a02ce6612399b9
4
- data.tar.gz: d11a52f0e4d465944ef1c047123972da7397e40a
3
+ metadata.gz: 973933734b0a34b492bc5affd799c4b875cd98f5
4
+ data.tar.gz: 2470866509815040e3042a19e481d30070a314b2
5
5
  SHA512:
6
- metadata.gz: 9bb5557cfe00ef72f20942ba27d07e416b6b96e4a223c905ee804b1a6191cb657d2f7e1b25f3adb07282a088c36cb05ec427ba1aa94578085cef8083da8836f9
7
- data.tar.gz: 49decca22ce3d7eb0495c564b7ef788046b0dbd10f176caf125c7a6645a8a5c1d6f69d1791e646c39490fec4e0734d2cf218e0e9efb4d02b991afeccf2df7ace
6
+ metadata.gz: c24abdd5f17a406c4256894e40343ba56e96d42cadd750953882b49dbc47af3b88d09d59ada447425612880a8a6674bcaa3c2f1d8533b8ec32b494354fdfc751
7
+ data.tar.gz: 98ceb533660de7b25e2e363d065c7cd10448a08d6896c78bcbb1cf07cdcd1a2dcbc2644b634fb5e57875b1d66f622063cb7088ad23b9f835b08f216ec1e0f21e
@@ -1,6 +1,8 @@
1
1
  require 'celluloid/websocket/rack'
2
2
 
3
3
  class WebSocketEcho < Celluloid::WebSocket
4
+ include Celluloid::Logger
5
+
4
6
  def on_open
5
7
  @counter = 0
6
8
  while(true)
@@ -9,6 +11,9 @@ class WebSocketEcho < Celluloid::WebSocket
9
11
  @counter += 1
10
12
  write("#{@counter}: #{message}")
11
13
  end
14
+ rescue => e
15
+ info "Exiting because: #{e.message}"
16
+ close
12
17
  end
13
18
 
14
19
  def on_error(*args)
@@ -55,7 +55,7 @@ module Celluloid
55
55
  alias_method :<<, :write
56
56
 
57
57
  def close
58
- @driver.close unless @driver.nil? || @driver.closed?
58
+ @driver.close unless @driver.nil?
59
59
  @socket.close unless @socket.nil? || @socket.closed?
60
60
  end
61
61
 
@@ -105,4 +105,4 @@ module Celluloid
105
105
  end
106
106
  end
107
107
  end
108
- end
108
+ end
@@ -1,5 +1,5 @@
1
1
  module Celluloid
2
2
  class WebSocket
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: celluloid-websocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tinco Andringa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-17 00:00:00.000000000 Z
11
+ date: 2015-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -151,3 +151,4 @@ signing_key:
151
151
  specification_version: 4
152
152
  summary: This is basically a small wrapper around Tony Arcieri's Reel::Websocket class.
153
153
  test_files: []
154
+ has_rdoc: