protocol-rack 0.7.0 → 0.9.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: abae8a03873e4b82fb2d64d88e0a3014a9fd8c0d9eacca1aeb419fb4651f32f8
4
- data.tar.gz: 1d1ae6ec253f7fe688907563ed0cdd16cc2e482325344d36384cd6647b403227
3
+ metadata.gz: 36a0633c754c61a78d6fee4b4c0e22b817d2ba12ebc3ca6c780b89c9bfbfecfd
4
+ data.tar.gz: b5fbe75d93826fc22f1ee4d848674cb94fcfb8bb2c3ea32ab7f3cb4626d4df96
5
5
  SHA512:
6
- metadata.gz: 65c3cfc64676c05b7c7c380a89d4c1f6ab3fa196899877651a574437c6587dab36c75c46f3a1031afb6e13a2e5bedc3cbbf7d39111bbf873b7875bec0ef43a81
7
- data.tar.gz: b8f67ded7fc90df8893e98873f3300ba9e2af062d368917216e6f13447e41737c2ed0ae339557932cdf73008df64c4ad5a6a2423af9655bdb96921bb29d06f6d
6
+ metadata.gz: e0b1e7479f9bfad4b8183aa35095c708c91442a9aadb2dc90bcd5c873a75eff9d0f16cce06a1b3d76defdfed30390cffc1e15a4fa6a027cde2cb9c5c3e6171c7
7
+ data.tar.gz: 2b4d7ab1582ea8971141f1a755c88cc9ba25422f60a44e0812523181a89e2f27c4a0e598e5a4cb72a482dc7ef76b41941c5eb2f20b5263d647f3259bcbf03ea1
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022, by Samuel Williams.
4
+ # Copyright, 2022-2024, by Samuel Williams.
5
5
 
6
6
  require 'protocol/http/body/readable'
7
7
  require 'protocol/http/body/stream'
@@ -41,15 +41,23 @@ module Protocol
41
41
  end
42
42
  end
43
43
 
44
- def close
44
+ def close(error = nil)
45
45
  @fiber = nil
46
46
 
47
47
  if from = @from
48
48
  @from = nil
49
- from.transfer(nil)
49
+ if error
50
+ from.raise(error)
51
+ else
52
+ from.transfer(nil)
53
+ end
50
54
  end
51
55
  end
52
56
 
57
+ def close_write(error = nil)
58
+ close(error)
59
+ end
60
+
53
61
  def read
54
62
  raise RuntimeError, "Stream is already being read!" if @from
55
63
 
@@ -87,7 +87,14 @@ module Protocol
87
87
 
88
88
  def read_next
89
89
  if @body
90
- @body.read
90
+ # User's may forget to call #close...
91
+ if chunk = @body.read
92
+ return chunk
93
+ else
94
+ # So if we are at the end of the stream, we close it automatically:
95
+ @body.close
96
+ @body = nil
97
+ end
91
98
  elsif @closed
92
99
  raise IOError, "Stream is not readable, input has been closed!"
93
100
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module Rack
8
- VERSION = "0.7.0"
8
+ VERSION = "0.9.0"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -73,11 +73,11 @@ We welcome contributions to this project.
73
73
 
74
74
  ### Developer Certificate of Origin
75
75
 
76
- This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.
76
+ In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.
77
77
 
78
- ### Contributor Covenant
78
+ ### Community Guidelines
79
79
 
80
- This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
80
+ This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.
81
81
 
82
82
  ## See Also
83
83
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -38,7 +38,7 @@ cert_chain:
38
38
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
39
39
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
40
40
  -----END CERTIFICATE-----
41
- date: 2024-09-02 00:00:00.000000000 Z
41
+ date: 2024-09-22 00:00:00.000000000 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: protocol-http
metadata.gz.sig CHANGED
Binary file