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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 215ca6215e632b80ab882fda1a6227a4f6a31d08f571db8416d3d51d35719167
4
- data.tar.gz: 5ffd6eba1b3608cc2853f8687011b089d0527d9d5735c0efc4866ff89f5fde85
3
+ metadata.gz: 49d719dcbd7c58913d56771c96160e6c0f339511e853d943a3b18405acaf7937
4
+ data.tar.gz: 112e32a37cb07630becdfc0b19b42b95ad7d4eb57f52801c065808a2e685317f
5
5
  SHA512:
6
- metadata.gz: 2c51d309448792d8dda414e0f0eaf5fe892dfeabc5c52be6d05e960ff8584791bf4cda1a5663499cea5ba7c92250b096c1f1ef4cd885b7df067cb789f56b9379
7
- data.tar.gz: 918d463a06ed0b22fdbc170796b0e5bc0622e7b685f7fbf4a4e1e976d8be47be603f3e6ea8306ad819924cc8d49933216a77a6856b1b11e891c8348d23f6cbad
6
+ metadata.gz: daf5665bf25cc38327e9f001e2a79080c2f34991d41a66cf8e614e5e2f0b51b2e4724bc9d06190c24fd98c70c270533620bb039181a9ac948a4dcb415b3d7f7f
7
+ data.tar.gz: 478bcf25e70b1b52a71c7b382450c8cef8d82bfcc06b412cfe006cc73cd494a23b75b520bb7bc5dddcd915af4f44f56b3038497599024a5bec64fe23b6cf5d9d
checksums.yaml.gz.sig CHANGED
Binary file
@@ -125,10 +125,21 @@ module Async
125
125
  return matched
126
126
  end
127
127
 
128
- def peek
129
- until yield(@read_buffer) or @eof
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)
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module IO
8
- VERSION = "1.36.1"
8
+ VERSION = "1.37.0"
9
9
  end
10
10
  end
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.36.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-29 00:00:00.000000000 Z
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