celluloid-websocket 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/celluloid/websocket.rb +4 -8
- data/lib/celluloid/websocket/version.rb +1 -1
- 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: d733c0d77a7b8675ae67ca19cd02d13ad663604c
|
4
|
+
data.tar.gz: 2c99aa7d39b6ccb6f72e059d29ce29d0951fb5cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 043592123bc8623b6f52da908b31f80e9a2198cb7a78d30db0dee45e02b50be1a6362a62a8762ba56e66239ced5da513f076904e9bd673c7885eeb16bfe178d1
|
7
|
+
data.tar.gz: 260e59ee216cde92225a1b05511cca21a0a1e72724e928d5acd94246dc5ff05accfc1231fdf3aed68f1d12ceae4958924b62712883aca06147b6efb6a6899bb8
|
data/lib/celluloid/websocket.rb
CHANGED
@@ -11,9 +11,9 @@ module Celluloid
|
|
11
11
|
|
12
12
|
def initialize(env, socket)
|
13
13
|
@env = env
|
14
|
-
|
14
|
+
@socket = socket
|
15
15
|
|
16
|
-
|
16
|
+
driver_env = DriverEnvironment.new(env, socket)
|
17
17
|
|
18
18
|
@driver = ::WebSocket::Driver.rack(driver_env)
|
19
19
|
|
@@ -45,11 +45,7 @@ module Celluloid
|
|
45
45
|
raise "Can only send byte array or string over driver."
|
46
46
|
end
|
47
47
|
rescue IOError, Errno::ECONNRESET, Errno::EPIPE
|
48
|
-
cancel_timer!
|
49
48
|
raise SocketError, "error writing to socket"
|
50
|
-
rescue
|
51
|
-
cancel_timer!
|
52
|
-
raise
|
53
49
|
end
|
54
50
|
alias_method :<<, :write
|
55
51
|
|
@@ -71,8 +67,8 @@ module Celluloid
|
|
71
67
|
@env = env
|
72
68
|
|
73
69
|
secure = ::Rack::Request.new(env).ssl?
|
74
|
-
|
75
|
-
|
70
|
+
scheme = secure ? 'wss:' : 'ws:'
|
71
|
+
@url = scheme + '//' + env['HTTP_HOST'] + env['REQUEST_URI']
|
76
72
|
|
77
73
|
@socket = socket
|
78
74
|
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.
|
4
|
+
version: 0.0.2
|
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-
|
11
|
+
date: 2015-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|