websocket-driver 0.3.4 → 0.3.5

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: 547ad558c91b225fb330155dfda3c4b80fce0ffe
4
- data.tar.gz: 87efd4c7a99f2a765badd12237966e6c000e7581
3
+ metadata.gz: 1a13b9adf6ecd4d2e375153c60898f884fb60de1
4
+ data.tar.gz: adf67dbc8b4eb9f4c582531f026b03c029a596cd
5
5
  SHA512:
6
- metadata.gz: 1dc8274a20b011cb8caf5d5acb8b96a0c0e4312c1e1f7f722de8304124b7249b97eee978e84f110ac4d6988bfcb098709e4430d890f9dc442f809806d0a0a034
7
- data.tar.gz: c4780127df20fbb47c9c3c5fedbc33df99fbed323a1b52cf5b4d1dd0e5a812e0fcd11515dcacd6494214759c035a01e657029cbbfac5bd20d98e2138573f9e04
6
+ metadata.gz: 40a8dffd61f2aeb1ebb28ca1d368a6bbbc66ab6422d4a7ba68afec740e456d2bf20a783353ce3c0bda0f43dbbbb9a42d68cd61c5c43744647ce544b0049daadd
7
+ data.tar.gz: 1b93c39aaa658aaf9c736307a4a7e3866768e7c1703aa981b9603a50e76798297aecfc7c20a09699cf96e9d2eb0e24257db90a245bc11ecf9898549ea6211a1a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 0.3.5 / 2014-10-04
2
+
3
+ * Fix bug where the `Server` driver doesn't pass `ping` callbacks to its delegate
4
+ * Fix an arity error when calling `fail_request`
5
+ * Allow `close` to be called before `start` to close the driver
6
+
1
7
  ### 0.3.4 / 2014-07-06
2
8
 
3
9
  * Don't hold references to frame buffers after a message has been emitted
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # websocket-driver [![Build Status](https://travis-ci.org/faye/websocket-driver-ruby.png)](https://travis-ci.org/faye/websocket-driver-ruby)
1
+ # websocket-driver [![Build Status](https://travis-ci.org/faye/websocket-driver-ruby.svg)](https://travis-ci.org/faye/websocket-driver-ruby)
2
2
 
3
3
  This module provides a complete implementation of the WebSocket protocols that
4
4
  can be hooked up to any TCP library. It aims to simplify things by decoupling
@@ -181,17 +181,16 @@ module WebSocket
181
181
  reason ||= ''
182
182
  code ||= ERRORS[:normal_closure]
183
183
 
184
- case @ready_state
185
- when 0 then
186
- @ready_state = 3
187
- emit(:close, CloseEvent.new(code, reason))
188
- true
189
- when 1 then
190
- frame(reason, :close, code)
191
- @ready_state = 2
192
- true
193
- else
194
- false
184
+ if @ready_state <= 0
185
+ @ready_state = 3
186
+ emit(:close, CloseEvent.new(code, reason))
187
+ true
188
+ elsif @ready_state == 1
189
+ frame(reason, :close, code)
190
+ @ready_state = 2
191
+ true
192
+ else
193
+ false
195
194
  end
196
195
  end
197
196
 
@@ -23,11 +23,11 @@ module WebSocket
23
23
  end
24
24
 
25
25
  %w[set_header start state frame text binary ping close].each do |method|
26
- define_method(method) do |*args|
26
+ define_method(method) do |*args, &block|
27
27
  if @delegate
28
- @delegate.__send__(method, *args)
28
+ @delegate.__send__(method, *args, &block)
29
29
  else
30
- @queue << [method, args]
30
+ @queue << [method, args, block]
31
31
  true
32
32
  end
33
33
  end
@@ -61,14 +61,14 @@ module WebSocket
61
61
 
62
62
  private
63
63
 
64
- def fail_request
64
+ def fail_request(message)
65
65
  emit(:error, ProtocolError.new(message))
66
66
  emit(:close, CloseEvent.new(Hybi::ERRORS[:protocol_error], message))
67
67
  end
68
68
 
69
69
  def open
70
- @queue.each do |message|
71
- @delegate.__send__(message[0], *message[1])
70
+ @queue.each do |method, args, block|
71
+ @delegate.__send__(method, *args, &block)
72
72
  end
73
73
  @queue = []
74
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: websocket-driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Coglan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-06 00:00:00.000000000 Z
11
+ date: 2014-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine