websocket_parser 0.1.3 → 0.1.4

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: 44b06b012bde86cc8f738bb495171011343eb5e5
4
- data.tar.gz: 52b426bacfe7868cced01be9f31fbdb6d510b4bb
3
+ metadata.gz: 8924e6562d9e92cf020064ec8856a1a0a24fa0f0
4
+ data.tar.gz: 4135ca151a1284fb741a6aa4cf6b0344608e07bc
5
5
  SHA512:
6
- metadata.gz: bfc4e078ff80f30e66e9880a7db3e263e9cd458d8e2b85ffb1e9f86a611e6e0f545d3eb663e77898f4c8504076c097165bc282b1b94a4e7b1593587bd8990a55
7
- data.tar.gz: 46602d290abfc3bb7538e2439522b4ff14ce2ec5ccf4fb104ceddc93eb2850d8761cfadaf083e5bf78e6c82c3455c97b1b4ae1428be6158363f7c2646d1926a2
6
+ metadata.gz: 3e63785361ded5ab54c8a127998a810529c6950eb2519b42318895c2e3abbb2d9a447accecbed2065f275fe6503eded4599c7053b4a8d99dedc79860cd06eb69
7
+ data.tar.gz: 23f4cefa767337afd3710fc30da0298486cf9fe50e10b791d4522828366b59f3925615e146733efac98cd1397e8bcc271c8bc8e529be6da96361361edb634a10
@@ -8,8 +8,7 @@ module WebSocket
8
8
  end
9
9
 
10
10
  # Return a new pong message
11
- def self.pong(ping = nil)
12
- payload = ping ? ping.payload : ''
11
+ def self.pong(payload = '')
13
12
  new(payload, :pong)
14
13
  end
15
14
 
@@ -187,9 +187,9 @@ module WebSocket
187
187
  when :binary
188
188
  @on_message.call(@current_message) if @on_message
189
189
  when :ping
190
- @on_ping.call if @on_ping
190
+ @on_ping.call(@current_message) if @on_ping
191
191
  when :pong
192
- @on_pong.call if @on_ping
192
+ @on_pong.call(@current_message) if @on_ping
193
193
  when :close
194
194
  status_code, message = @current_message.unpack('S<a*')
195
195
  status = STATUS_CODES[status_code]
@@ -1,3 +1,3 @@
1
1
  module WebSocket
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -42,7 +42,7 @@ describe WebSocket::Message do
42
42
 
43
43
  it "can create a pong message from a ping message" do
44
44
  ping = WebSocket::Message.ping('Roman Ping Pong')
45
- pong = WebSocket::Message.pong(ping)
45
+ pong = WebSocket::Message.pong(ping.payload)
46
46
 
47
47
  pong.type.should == :pong
48
48
  pong.payload.should == 'Roman Ping Pong'
@@ -14,8 +14,8 @@ describe WebSocket::Parser do
14
14
  parser.on_message { |m| received_messages << m }
15
15
  parser.on_error { |m| received_errors << m }
16
16
  parser.on_close { |status, message| received_closes << [status, message] }
17
- parser.on_ping { received_pings << 'ping' }
18
- parser.on_pong { received_pongs << 'pong' }
17
+ parser.on_ping { |m| received_pings << m }
18
+ parser.on_pong { |m| received_pongs << m }
19
19
 
20
20
  parser
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: websocket_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alberto Fernandez-Capel