tubesock 0.2.7 → 0.2.8

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: fe7a4e516cadc2c0aa66b3593323a1b77649620c
4
- data.tar.gz: c51d78124ec4abd28b565f5fbc9dd84babbf42a3
3
+ metadata.gz: 2414128908c4b854bc84367086ef5c09c1d472d7
4
+ data.tar.gz: 8d23986a9aefc520aeb87faccd1ce28d2f96b454
5
5
  SHA512:
6
- metadata.gz: 9b461fe99bf7e300222983f4ccab7eff06603ac08bc3150f74b5fcea6932d995aa33849ae7767243eb1908e9546c33faeb708d1fc43b28c2b898229a478a6e13
7
- data.tar.gz: 213eb36ce3f1d0fb01fe06e423c9ff0b30f0d2c7d2cf42b7059b93aea700469730a7a646e0f105d393b51fd96873f03d33901b725ba6e4664f5838b221dd7831
6
+ metadata.gz: 4eedd58e0c7d6f987aeaa4622c915543de76e37f8067d299d743ba6afc4ba7e598a2e5612636c312b6bb13f4a4d2a1855d5d6d3779795032d2976a15cd802737
7
+ data.tar.gz: a354b382e477aaf864443a3dbb6285c749a5ecbdc75acdbaa3554d39a44b884b121d33ae668143ad0bbe4645eb28fe3a5a605b8d061d4e9a86de80bd560db85c
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "2.1.6"
4
- - "2.2.2"
3
+ - "2.5.1"
4
+ - "2.4.4"
5
+ - "2.3.7"
@@ -130,9 +130,9 @@ class Tubesock
130
130
  framebuffer = WebSocket::Frame::Incoming::Server.new(version: @version)
131
131
  while IO.select([@socket])
132
132
  if @socket.respond_to?(:recvfrom)
133
- data, addrinfo = @socket.recvfrom(2000)
133
+ data, _addrinfo = @socket.recvfrom(2000)
134
134
  else
135
- data, addrinfo = @socket.readpartial(2000), @socket.peeraddr
135
+ data, _addrinfo = @socket.readpartial(2000), @socket.peeraddr
136
136
  end
137
137
  break if data.empty?
138
138
  framebuffer << data
@@ -27,13 +27,13 @@ module Tubesock::Hijack
27
27
 
28
28
  included do
29
29
  def hijack
30
- sock = Tubesock.hijack(env)
30
+ sock = Tubesock.hijack(request.env)
31
31
  yield sock
32
32
  sock.onclose do
33
33
  ActiveRecord::Base.clear_active_connections! if defined? ActiveRecord
34
34
  end
35
35
  sock.listen
36
- render text: nil, status: -1
36
+ render plain: nil, status: -1
37
37
  end
38
38
  end
39
39
  end
@@ -1,3 +1,3 @@
1
1
  class Tubesock
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
3
3
  end
@@ -53,7 +53,7 @@ class Tubesock::TestCase::TestInteraction
53
53
 
54
54
  def read
55
55
  framebuffer = WebSocket::Frame::Incoming::Client.new(version: version)
56
- data, addrinfo = @client_socket.recvfrom(2000)
56
+ data, _addrinfo = @client_socket.recvfrom(2000)
57
57
  framebuffer << data
58
58
  framebuffer.next.data
59
59
  end
@@ -21,8 +21,8 @@ class TubesockTest < Tubesock::TestCase
21
21
  closed = MockProc.new
22
22
 
23
23
  interaction.tubesock do |tubesock|
24
- tubesock.onopen &opened
25
- tubesock.onclose &closed
24
+ tubesock.onopen(&opened)
25
+ tubesock.onclose(&closed)
26
26
 
27
27
  tubesock.onmessage do |message|
28
28
  tubesock.send_data "Hello #{message}"
@@ -44,7 +44,7 @@ class TubesockTest < Tubesock::TestCase
44
44
  closed = MockProc.new
45
45
 
46
46
  interaction.tubesock do |tubesock|
47
- tubesock.onclose &closed
47
+ tubesock.onclose(&closed)
48
48
  end
49
49
 
50
50
  # That's what Firefox sends when disconnecting.
@@ -62,9 +62,9 @@ class TubesockTest < Tubesock::TestCase
62
62
  errored = MockProc.new
63
63
 
64
64
  interaction.tubesock do |tubesock|
65
- tubesock.onclose &closed
65
+ tubesock.onclose(&closed)
66
66
 
67
- tubesock.onerror &errored
67
+ tubesock.onerror(&errored)
68
68
  tubesock.onmessage do |message|
69
69
  raise "Really really really bad error"
70
70
  end
@@ -83,7 +83,7 @@ class TubesockTest < Tubesock::TestCase
83
83
  closed = MockProc.new
84
84
 
85
85
  interaction.tubesock do |tubesock|
86
- tubesock.onclose &closed
86
+ tubesock.onclose(&closed)
87
87
 
88
88
  tubesock.onerror do |error, message|
89
89
  tubesock.prevent_close_on_error
@@ -105,7 +105,7 @@ class TubesockTest < Tubesock::TestCase
105
105
  closed = MockProc.new
106
106
 
107
107
  interaction.tubesock do |tubesock|
108
- tubesock.onclose &closed
108
+ tubesock.onclose(&closed)
109
109
 
110
110
  tubesock.onmessage do |message|
111
111
  raise "Really really really bad error"
@@ -126,8 +126,8 @@ class TubesockTest < Tubesock::TestCase
126
126
  messaged = MockProc.new
127
127
 
128
128
  interaction.tubesock do |tubesock|
129
- tubesock.onclose &closed
130
- tubesock.onmessage &messaged
129
+ tubesock.onclose(&closed)
130
+ tubesock.onmessage(&messaged)
131
131
  end
132
132
 
133
133
  interaction.write "Hello world"
@@ -143,7 +143,7 @@ class TubesockTest < Tubesock::TestCase
143
143
  closed = MockProc.new
144
144
 
145
145
  interaction.tubesock do |tubesock|
146
- tubesock.onclose &closed
146
+ tubesock.onclose(&closed)
147
147
  tubesock.onopen do
148
148
  raise "Error opening socket"
149
149
  end
@@ -6,6 +6,7 @@ class MockEngine
6
6
  def read; "data" end
7
7
  def inject(data); end
8
8
  def extract; end
9
+ def init?; true; end
9
10
  def write(data)
10
11
  1
11
12
  end
@@ -14,6 +15,7 @@ end
14
15
  class MockSocket < IO
15
16
  def initialize; end
16
17
  def close; end
18
+ def closed?; false; end
17
19
  def readpartial(len); end
18
20
  end
19
21
 
@@ -36,7 +38,6 @@ class TubesockPumaTest < Tubesock::TestCase
36
38
 
37
39
  interaction.tubesock do |tubesock|
38
40
  proc { tubesock.close }.must_be_silent
39
-
40
41
  end
41
42
 
42
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tubesock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Gauthier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-29 00:00:00.000000000 Z
11
+ date: 2018-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  requirements: []
150
150
  rubyforge_project:
151
- rubygems_version: 2.6.1
151
+ rubygems_version: 2.6.14.1
152
152
  signing_key:
153
153
  specification_version: 4
154
154
  summary: Handle websocket connections via Rack and Rails 4 using concurrency