polyphony 0.63 → 0.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2c69a05b391ebc688550a3894e56362de6603d04e807cad3072dfdffe966787
4
- data.tar.gz: c09da8e0cb9e04eb4ea964e81cdd75a735f9e2f08f882ddaec8f2bee4be5661b
3
+ metadata.gz: 5e3938b66b15caff258b95c7f1421f71bc0bb4f7b94dd9db4a3ad0614fd35ded
4
+ data.tar.gz: 2198ea0483f959491372074007d5c32416de69ebcf73a8aca51832ea6036ea87
5
5
  SHA512:
6
- metadata.gz: cbd89d448e06cc80a105ab763b21b62054eb7ee4a21b8b115954765e80170d55a99b4a314695554493d81cbd73f87941846521a4b0dcac9d1653bcb8a51497f6
7
- data.tar.gz: 6fc94352edc156fb963a4f74180208353ecd8cae82ffef1c6ac02b6413870ba028a5cea547dcdebb5bb3998b73a5529de209c035ae32ec7d4500678b3a7f7b65
6
+ metadata.gz: 318b3b2549a6d7d3c2bb1b8396adcf95109ef17f6235e25bcf1540fd3c5777d6f2666858d5f539cf17dd0c2102553eb853ba3b38b96d9476d2727a7ddfb0ed70
7
+ data.tar.gz: 025f5037c922531235bcf56076ca6986cb1d983b37eceda8e1585fa90e23f67c0abe17a81b0329851e80c050e9ccce8ba53f7a0d95565e6568546dbb923f9a25
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.64 2021-07-26
2
+
3
+ - Add optional raise_on_eof argument to `#readpartial`
4
+
1
5
  ## 0.63 2021-07-26
2
6
 
3
7
  - Add support for specifying buf and buf_pos in `IO#read`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- polyphony (0.63)
4
+ polyphony (0.64)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -123,9 +123,9 @@ class ::IO
123
123
  end
124
124
 
125
125
  alias_method :orig_readpartial, :read
126
- def readpartial(len, str = +'', buffer_pos = 0)
126
+ def readpartial(len, str = +'', buffer_pos = 0, raise_on_eof = true)
127
127
  result = Polyphony.backend_read(self, str, len, false, buffer_pos)
128
- raise EOFError unless result
128
+ raise EOFError if !result && raise_on_eof
129
129
 
130
130
  result
131
131
  end
@@ -78,7 +78,7 @@ class ::OpenSSL::SSL::SSLSocket
78
78
  buf
79
79
  end
80
80
 
81
- def readpartial(maxlen, buf = +'', buffer_pos = 0)
81
+ def readpartial(maxlen, buf = +'', buffer_pos = 0, raise_on_eof = true)
82
82
  if buffer_pos != 0
83
83
  if (result = sysread(maxlen, +''))
84
84
  if buffer_pos == -1
@@ -90,7 +90,9 @@ class ::OpenSSL::SSL::SSLSocket
90
90
  else
91
91
  result = sysread(maxlen, buf)
92
92
  end
93
- result || (raise EOFError)
93
+
94
+ raise EOFError if !result && raise_on_eof
95
+ result
94
96
  end
95
97
 
96
98
  def read_loop(maxlen = 8192)
@@ -77,8 +77,9 @@ class ::Socket
77
77
  # Polyphony.backend_send(self, mesg, 0)
78
78
  # end
79
79
 
80
- def readpartial(maxlen, str = +'', buffer_pos = 0)
81
- Polyphony.backend_recv(self, str, maxlen, buffer_pos)
80
+ def readpartial(maxlen, str = +'', buffer_pos = 0, raise_on_eof = true)
81
+ result = Polyphony.backend_recv(self, str, maxlen, buffer_pos)
82
+ raise EOFError if !result && raise_on_eof
82
83
  end
83
84
 
84
85
  ZERO_LINGER = [0, 0].pack('ii').freeze
@@ -199,11 +200,10 @@ class ::TCPSocket
199
200
  # Polyphony.backend_send(self, mesg, 0)
200
201
  # end
201
202
 
202
- def readpartial(maxlen, str = +'', buffer_pos = 0)
203
+ def readpartial(maxlen, str = +'', buffer_pos = 0, raise_on_eof)
203
204
  result = Polyphony.backend_recv(self, str, maxlen, buffer_pos)
204
- raise EOFError unless result
205
-
206
- str
205
+ raise EOFError if !result && raise_on_eof
206
+ result
207
207
  end
208
208
 
209
209
  def read_nonblock(len, str = nil, exception: true)
@@ -293,11 +293,10 @@ class ::UNIXSocket
293
293
  Polyphony.backend_send(self, mesg, 0)
294
294
  end
295
295
 
296
- def readpartial(maxlen, str = +'', buffer_pos = 0)
296
+ def readpartial(maxlen, str = +'', buffer_pos = 0, raise_on_eof)
297
297
  result = Polyphony.backend_recv(self, str, maxlen, buffer_pos)
298
- raise EOFError unless result
299
-
300
- str
298
+ raise EOFError if !result && raise_on_eof
299
+ result
301
300
  end
302
301
 
303
302
  def read_nonblock(len, str = nil, exception: true)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polyphony
4
- VERSION = '0.63'
4
+ VERSION = '0.64'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyphony
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.63'
4
+ version: '0.64'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner