protocol-http 0.24.1 → 0.24.3

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: ca739827af38110440c34d4df98b7e67dfcc671266b45d0d4e9599a0cf352259
4
- data.tar.gz: 1d79370138e22504cd3b8c41b9285cd3c323dbbe4b56ed810eece6189e1734db
3
+ metadata.gz: e2395576c8aba120a122bc6f5855a3cb3b98c7fbbbc5b3cb8ce9c6a03428ac60
4
+ data.tar.gz: 4b20aa1a240517db6318ed8a0e34e4a86b928f34b28bd62faae5ae7ad565d149
5
5
  SHA512:
6
- metadata.gz: e4291f142cde7c38d3bd8e96f050df2eaec3551eafcc5381e7518813d4405576504f7a404fc34f688df3ab1867510587ea9052d763451733ed97da4fd5e9c47b
7
- data.tar.gz: 56bde2a2296edaf86aac94a2b88a84b86b88abf967205d0c124b88f477773bcc55dca29c294ab52fe042b621e49fed11429e5ef98a6fd627526176ff7935af2e
6
+ metadata.gz: 69c8da38bf38207c0b815973b6de1286066ef606717d1b20f13af2e79ed2ede88c932c3656ee178d522cd934ddd4c17b3a8c12749b332b6db9f10ee8cf503a2f
7
+ data.tar.gz: 6846f00a5d65e3230228bfdfd9e94d76372ca0528b6977fcd9c8ebf1f647a21793a4bfd340b818950c1a5e5f74e884d815176067ea56b353a5838c14e582aabe
checksums.yaml.gz.sig CHANGED
Binary file
@@ -41,7 +41,7 @@ module Protocol
41
41
  end
42
42
 
43
43
  # Write the body of the response to the given file path.
44
- def save(path, mode = ::File::WRONLY|::File::CREAT, **options)
44
+ def save(path, mode = ::File::WRONLY|::File::CREAT|::File::TRUNC, **options)
45
45
  if @body
46
46
  ::File.open(path, mode, **options) do |file|
47
47
  self.each do |chunk|
@@ -19,6 +19,7 @@ module Protocol
19
19
  # Will hold remaining data in `#read`.
20
20
  @buffer = nil
21
21
  @closed = false
22
+ @closed_read = false
22
23
  end
23
24
 
24
25
  attr :input
@@ -146,6 +147,9 @@ module Protocol
146
147
  end
147
148
 
148
149
  def close_read
150
+ @closed_read = true
151
+ @buffer = nil
152
+
149
153
  @input&.close
150
154
  @input = nil
151
155
  end
@@ -181,8 +185,7 @@ module Protocol
181
185
  def read_next
182
186
  if @input
183
187
  return @input.read
184
- else
185
- @input = nil
188
+ elsif @closed_read
186
189
  raise IOError, "Stream is not readable, input has been closed!"
187
190
  end
188
191
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module HTTP
8
- VERSION = "0.24.1"
8
+ VERSION = "0.24.3"
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: protocol-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.1
4
+ version: 0.24.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -43,7 +43,7 @@ cert_chain:
43
43
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
44
44
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
45
45
  -----END CERTIFICATE-----
46
- date: 2023-02-10 00:00:00.000000000 Z
46
+ date: 2023-06-10 00:00:00.000000000 Z
47
47
  dependencies:
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: bundler
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
152
  requirements: []
153
- rubygems_version: 3.4.6
153
+ rubygems_version: 3.4.7
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: Provides abstractions to handle HTTP protocols.
metadata.gz.sig CHANGED
Binary file