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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ced0b3713328dcec331091ac24bad63cbaadfc3
4
- data.tar.gz: 7c44109ae2734698567a56d0400da618dbf21ef0
3
+ metadata.gz: 137d883c29ef392a43f544871f5c46d19dff9008
4
+ data.tar.gz: 68c696c611d9986f9dea388acfba744f24af4615
5
5
  SHA512:
6
- metadata.gz: 84b7c903579be1e09741512533e84ef9c158c81c566716da95246ffc472d5498335f981ba8cc6e28c9e553edbc1383ef2693c86092c6cd479ccb90996069312e
7
- data.tar.gz: 7a810e4186a71a8e9921322fdb2391f1b6829e626bcc38dcda40c3fb084d385a09b2331b7e669ef77153afbe1f3652cb273fb84e98215f74468bb1b472cbbb2c
6
+ metadata.gz: e76f19c4f71bcf8cd089562c670a2412d754b78d4b7231f039cac62319c2ff81f376684c7d5643239cb173e6478e72d3f935773eb91c7da46d32ea747e03beb0
7
+ data.tar.gz: cd9f0da603ce3477e08bfad4e0658dfe323ab47ced78033b490932ccb9d8b8fca739a35101f159cbf9f1a0cd893d10aafe88c775449f821a945180528dc17c59
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.0
4
+
5
+ - provide handshake in onopen call
6
+
3
7
  ## 1.1.1
4
8
 
5
9
  - don't call onclose if handshake is not finished yet
@@ -132,11 +132,16 @@ module WebSocket
132
132
 
133
133
  private
134
134
 
135
- ['onopen'].each do |m|
136
- define_method "trigger_#{m}" do
137
- callback = instance_variable_get("@#{m}")
138
- callback.call if callback
139
- end
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)
@@ -1,7 +1,7 @@
1
1
  module WebSocket
2
2
  module EventMachine
3
3
  class Base
4
- VERSION = '1.1.1'
4
+ VERSION = '1.2.0'
5
5
  end
6
6
  end
7
7
  end
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.1.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: 2015-09-30 00:00:00.000000000 Z
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: