async-io 1.36.1 → 1.37.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/io/stream.rb +13 -2
- data/lib/async/io/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49d719dcbd7c58913d56771c96160e6c0f339511e853d943a3b18405acaf7937
|
4
|
+
data.tar.gz: 112e32a37cb07630becdfc0b19b42b95ad7d4eb57f52801c065808a2e685317f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daf5665bf25cc38327e9f001e2a79080c2f34991d41a66cf8e614e5e2f0b51b2e4724bc9d06190c24fd98c70c270533620bb039181a9ac948a4dcb415b3d7f7f
|
7
|
+
data.tar.gz: 478bcf25e70b1b52a71c7b382450c8cef8d82bfcc06b412cfe006cc73cd494a23b75b520bb7bc5dddcd915af4f44f56b3038497599024a5bec64fe23b6cf5d9d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/async/io/stream.rb
CHANGED
@@ -125,10 +125,21 @@ module Async
|
|
125
125
|
return matched
|
126
126
|
end
|
127
127
|
|
128
|
-
def peek
|
129
|
-
|
128
|
+
def peek(size = nil)
|
129
|
+
if size
|
130
|
+
until @eof or @read_buffer.bytesize >= size
|
131
|
+
# Compute the amount of data we need to read from the underlying stream:
|
132
|
+
read_size = size - @read_buffer.bytesize
|
133
|
+
|
134
|
+
# Don't read less than @block_size to avoid lots of small reads:
|
135
|
+
fill_read_buffer(read_size > @block_size ? read_size : @block_size)
|
136
|
+
end
|
137
|
+
return @read_buffer[..([size, @read_buffer.size].min - 1)]
|
138
|
+
end
|
139
|
+
until (block_given? && yield(@read_buffer)) or @eof
|
130
140
|
fill_read_buffer
|
131
141
|
end
|
142
|
+
return @read_buffer
|
132
143
|
end
|
133
144
|
|
134
145
|
def gets(separator = $/, **options)
|
data/lib/async/io/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.37.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -46,7 +46,7 @@ cert_chain:
|
|
46
46
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
47
47
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
48
48
|
-----END CERTIFICATE-----
|
49
|
-
date: 2023-10
|
49
|
+
date: 2023-11-10 00:00:00.000000000 Z
|
50
50
|
dependencies:
|
51
51
|
- !ruby/object:Gem::Dependency
|
52
52
|
name: async
|
metadata.gz.sig
CHANGED
Binary file
|