websocket-eventmachine-base 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/websocket/eventmachine/base.rb +11 -17
- data/lib/websocket/eventmachine/base/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 137d883c29ef392a43f544871f5c46d19dff9008
|
4
|
+
data.tar.gz: 68c696c611d9986f9dea388acfba744f24af4615
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e76f19c4f71bcf8cd089562c670a2412d754b78d4b7231f039cac62319c2ff81f376684c7d5643239cb173e6478e72d3f935773eb91c7da46d32ea747e03beb0
|
7
|
+
data.tar.gz: cd9f0da603ce3477e08bfad4e0658dfe323ab47ced78033b490932ccb9d8b8fca739a35101f159cbf9f1a0cd893d10aafe88c775449f821a945180528dc17c59
|
data/CHANGELOG.md
CHANGED
@@ -132,11 +132,16 @@ module WebSocket
|
|
132
132
|
|
133
133
|
private
|
134
134
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
135
|
+
def trigger_onopen(handshake)
|
136
|
+
@onopen.call(handshake) if @onopen
|
137
|
+
end
|
138
|
+
|
139
|
+
def trigger_onmessage(data, type)
|
140
|
+
@onmessage.call(data, type) if @onmessage
|
141
|
+
end
|
142
|
+
|
143
|
+
def trigger_onclose(code, reason)
|
144
|
+
@onclose.call(code, reason) if @onclose
|
140
145
|
end
|
141
146
|
|
142
147
|
['onerror', 'onping', 'onpong'].each do |m|
|
@@ -146,17 +151,6 @@ module WebSocket
|
|
146
151
|
end
|
147
152
|
end
|
148
153
|
|
149
|
-
['onclose'].each do |m|
|
150
|
-
define_method "trigger_#{m}" do |code, reason|
|
151
|
-
callback = instance_variable_get("@#{m}")
|
152
|
-
callback.call(code, reason) if callback
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
|
-
def trigger_onmessage(data, type)
|
157
|
-
@onmessage.call(data, type) if @onmessage
|
158
|
-
end
|
159
|
-
|
160
154
|
def handle_connecting(data)
|
161
155
|
@handshake << data
|
162
156
|
return unless @handshake.finished?
|
@@ -164,7 +158,7 @@ module WebSocket
|
|
164
158
|
send(@handshake.to_s, :type => :plain) if @handshake.should_respond?
|
165
159
|
@frame = incoming_frame.new(:version => @handshake.version)
|
166
160
|
@state = :open
|
167
|
-
trigger_onopen
|
161
|
+
trigger_onopen(@handshake)
|
168
162
|
handle_open(@handshake.leftovers) if @handshake.leftovers
|
169
163
|
else
|
170
164
|
trigger_onerror(@handshake.error.to_s)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: websocket-eventmachine-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernard Potocki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: websocket
|
@@ -86,9 +86,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
88
|
rubyforge_project:
|
89
|
-
rubygems_version: 2.4.5
|
89
|
+
rubygems_version: 2.4.5.1
|
90
90
|
signing_key:
|
91
91
|
specification_version: 4
|
92
92
|
summary: WebSocket base for Ruby client and server
|
93
93
|
test_files: []
|
94
|
-
has_rdoc:
|