protocol-rack 0.4.1 → 0.5.1

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: a51b0412866f66870722a8f62008d4e76df2ba1d613af62b94eea1a30618bd97
4
- data.tar.gz: 0cc84245f1dbb289cb1081f4c7c291a0bb3d69498b2d822290937418af7dc532
3
+ metadata.gz: f8eef2db46dd32a4307561b5d6d05b5b3874971473f0a01f669122bba02aa2f4
4
+ data.tar.gz: 24f7ce0dec015114a5d6a984ef3b3075446fee220975b1a9060100588124d262
5
5
  SHA512:
6
- metadata.gz: ed7a6592a103ecc2f285aa51a83427f29b15fe95cd7488ce57f59878598b833765774db65c5f8563d67e2ac7fe1da01a5f6c58dda6c0e09b34cbdc5fa12d5384
7
- data.tar.gz: 8182ea7a512bec710d122cdf5ee4f4538b263ef03d2b7eb99130102126c536a58cd2057cf986a9336cad9169eabcffe61ed3c9560d912445a980cdc384311ee8
6
+ metadata.gz: aaf3f413e3667955841c43dfbd66d0ed930bf0454a9fda0740af3d24ee2cab7055fa3dbe4807f4aa4d7684747e96567216eb9490a412ed68bc6c2a94c125fe60
7
+ data.tar.gz: b8055752788740184967b2ab59a9c9c612659451797aadadc956358b661e876afe7e8465dfc2ae72e5f4d27be27514a5a70ad76cd726460036ef1c41bc986d58
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-2023, by Samuel Williams.
4
+ # Copyright, 2022-2024, by Samuel Williams.
5
5
 
6
6
  require 'console'
7
7
 
@@ -17,6 +17,11 @@ module Protocol
17
17
  self.new(app)
18
18
  end
19
19
 
20
+ def self.parse_file(...)
21
+ # This is the old interface, which was changed in Rack 3.
22
+ ::Rack::Builder.parse_file(...).first
23
+ end
24
+
20
25
  # Initialize the rack adaptor middleware.
21
26
  # @parameter app [Object] The rack middleware.
22
27
  def initialize(app)
@@ -26,9 +31,9 @@ module Protocol
26
31
  end
27
32
 
28
33
  def logger
29
- Console.logger
34
+ Console
30
35
  end
31
-
36
+
32
37
  # Unwrap raw HTTP headers into the CGI-style expected by Rack middleware.
33
38
  #
34
39
  # Rack separates multiple headers with the same key, into a single field with multiple lines.
@@ -116,7 +121,7 @@ module Protocol
116
121
 
117
122
  return Response.wrap(env, status, headers, meta, body, request)
118
123
  rescue => exception
119
- Console.logger.error(self) {exception}
124
+ Console.error(self, exception)
120
125
 
121
126
  body&.close if body.respond_to?(:close)
122
127
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022-2023, by Samuel Williams.
4
+ # Copyright, 2022-2024, by Samuel Williams.
5
5
 
6
6
  require 'console'
7
7
 
@@ -87,7 +87,7 @@ module Protocol
87
87
 
88
88
  return Response.wrap(env, status, headers, meta, body, request)
89
89
  rescue => exception
90
- Console.logger.error(self) {exception}
90
+ Console.error(self, exception)
91
91
 
92
92
  body&.close if body.respond_to?(:close)
93
93
 
@@ -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 'console'
7
7
 
@@ -15,6 +15,10 @@ module Protocol
15
15
  self.new(app)
16
16
  end
17
17
 
18
+ def self.parse_file(...)
19
+ ::Rack::Builder.parse_file(...)
20
+ end
21
+
18
22
  def make_environment(request)
19
23
  request_path, query_string = request.path.split('?', 2)
20
24
  server_name, server_port = (request.authority || '').split(':', 2)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022-2023, by Samuel Williams.
4
+ # Copyright, 2022-2024, by Samuel Williams.
5
5
 
6
6
  require 'rack'
7
7
 
@@ -24,6 +24,10 @@ module Protocol
24
24
  def self.make_response(env, response)
25
25
  IMPLEMENTATION.make_response(env, response)
26
26
  end
27
+
28
+ def self.parse_file(...)
29
+ IMPLEMENTATION.parse_file(...)
30
+ end
27
31
  end
28
32
  end
29
33
  end
@@ -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
  module Protocol
7
7
  module Rack
@@ -1,10 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022-2023, by Samuel Williams.
4
+ # Copyright, 2022-2024, by Samuel Williams.
5
5
  # Copyright, 2023, by Genki Takiuchi.
6
6
 
7
- require 'async/io/buffer'
8
7
  require 'protocol/http/body/stream'
9
8
 
10
9
  module Protocol
@@ -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_relative 'body'
7
7
  require_relative 'constants'
@@ -43,7 +43,7 @@ module Protocol
43
43
  ignored = headers.extract(HOP_HEADERS)
44
44
 
45
45
  unless ignored.empty?
46
- Console.logger.warn(self, "Ignoring protocol-level headers: #{ignored.inspect}")
46
+ Console.warn(self, "Ignoring hop headers!", ignored: ignored)
47
47
  end
48
48
 
49
49
  if hijack_body = meta['rack.hijack']
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022-2023, by Samuel Williams.
4
+ # Copyright, 2022-2024, by Samuel Williams.
5
5
 
6
6
  module Protocol
7
7
  module Rack
8
- VERSION = "0.4.1"
8
+ VERSION = "0.5.1"
9
9
  end
10
10
  end
data/license.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2022-2023, by Samuel Williams.
3
+ Copyright, 2022-2024, by Samuel Williams.
4
4
  Copyright, 2023, by Genki Takiuchi.
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
data/readme.md CHANGED
@@ -77,7 +77,7 @@ This project uses the [Developer Certificate of Origin](https://developercertifi
77
77
 
78
78
  ### Contributor Covenant
79
79
 
80
- This project is governed by [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
80
+ This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
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.4.1
4
+ version: 0.5.1
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: 2023-12-11 00:00:00.000000000 Z
41
+ date: 2024-04-24 00:00:00.000000000 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: protocol-http
@@ -94,7 +94,9 @@ files:
94
94
  homepage: https://github.com/socketry/protocol-rack
95
95
  licenses:
96
96
  - MIT
97
- metadata: {}
97
+ metadata:
98
+ documentation_uri: https://socketry.github.io/protocol-rack/
99
+ source_code_uri: https://github.com/socketry/protocol-rack.git
98
100
  post_install_message:
99
101
  rdoc_options: []
100
102
  require_paths:
@@ -103,14 +105,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
103
105
  requirements:
104
106
  - - ">="
105
107
  - !ruby/object:Gem::Version
106
- version: '3.0'
108
+ version: '3.1'
107
109
  required_rubygems_version: !ruby/object:Gem::Requirement
108
110
  requirements:
109
111
  - - ">="
110
112
  - !ruby/object:Gem::Version
111
113
  version: '0'
112
114
  requirements: []
113
- rubygems_version: 3.4.22
115
+ rubygems_version: 3.5.3
114
116
  signing_key:
115
117
  specification_version: 4
116
118
  summary: An implementation of the Rack protocol/specification.
metadata.gz.sig CHANGED
Binary file