rack-conform 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7f16588884b3ca0b245d6d1744898cde54f0b7a45d92d2c9bb6d6ad205eac2d9
4
+ data.tar.gz: d8732aaeb808d32fdfb1edb978eee0b51f9f8ad6917c606a7e752e3f935e35bb
5
+ SHA512:
6
+ metadata.gz: 296f423eba32e01ee19e8932545ee597078b26eb31f0a5e2f34b798614871eec739433fe651c1cd1bac11189bf34e97481e685836e1965596617097ce77d30b2
7
+ data.tar.gz: 9a9e9916ea229e5bdee8c483d70868c6b4fb14ca44fac4d3425bbfb82a563384e17f484e7fd1890606da25f830a2341256a09b8a08f6973cc4c8404f7ae452b8
checksums.yaml.gz.sig ADDED
Binary file
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2022, by Samuel Williams.
5
+
6
+ require 'json'
7
+
8
+ module Rack
9
+ module Conform
10
+ class Server
11
+ def call(env)
12
+ self.public_send(test_method_for(env), env)
13
+ end
14
+
15
+ def test(env)
16
+ [200, {}, ["Hello World"]]
17
+ end
18
+
19
+ def test_status(env)
20
+ status = env.fetch('HTTP_STATUS', 200)
21
+ [status.to_i, {}, []]
22
+ end
23
+
24
+ def test_echo(env)
25
+ [200, {}, env['rack.input']]
26
+ end
27
+
28
+ def test_cookies(env)
29
+ cookies = JSON.parse(env['rack.input'].read)
30
+
31
+ Rack::Response.new.tap do |response|
32
+ cookies.each do |key, value|
33
+ response.set_cookie(key, value)
34
+ end
35
+ end.to_a
36
+ end
37
+
38
+ def test_headers(env)
39
+ headers = JSON.parse(env['rack.input'].read)
40
+
41
+ Rack::Response.new.tap do |response|
42
+ headers.each do |key, value|
43
+ Array(value).each do |value|
44
+ response.add_header(key, value)
45
+ end
46
+ end
47
+ end.to_a
48
+ end
49
+
50
+ private
51
+
52
+ def test_method_for(env)
53
+ parts = env['PATH_INFO'].split('/')
54
+ parts[0] = "test"
55
+
56
+ return parts.join('_').to_sym
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2022, by Samuel Williams.
5
+
6
+ module Rack
7
+ module Conform
8
+ VERSION = '0.1.0'
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2022, by Samuel Williams.
5
+
6
+ require_relative 'conform/version'
7
+ require_relative 'conform/server'
data/license.md ADDED
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ Copyright, 2022, by Samuel Williams.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/readme.md ADDED
@@ -0,0 +1,19 @@
1
+ # Rack::Conform
2
+
3
+ Provides rack server conformance testing.
4
+
5
+ [![Development Status](https://github.com/socketry/protocol-http/workflows/Test/badge.svg)](https://github.com/socketry/protocol-http/actions?workflow=Test)
6
+
7
+ ## Features
8
+
9
+ - Supports Rack 2 and Rack 3.
10
+
11
+ ## Usage
12
+
13
+ This repository includes test suite execution for published versions of major web servers. You can also run it for a specific server:
14
+
15
+ ```bash
16
+ $ puma & # start your server
17
+ $ export RACK_CONFORM_ENDPOINT="http://localhost:9292"
18
+ $ bundle exec sus # run tests
19
+ ```
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,132 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rack-conform
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Samuel Williams
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11
14
+ ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK
15
+ CZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz
16
+ MjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd
17
+ MBsGCgmSJomT8ixkARkWDW9yaW9udHJhbnNmZXIxEjAQBgoJkiaJk/IsZAEZFgJj
18
+ bzESMBAGCgmSJomT8ixkARkWAm56MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB
19
+ igKCAYEAomvSopQXQ24+9DBB6I6jxRI2auu3VVb4nOjmmHq7XWM4u3HL+pni63X2
20
+ 9qZdoq9xt7H+RPbwL28LDpDNflYQXoOhoVhQ37Pjn9YDjl8/4/9xa9+NUpl9XDIW
21
+ sGkaOY0eqsQm1pEWkHJr3zn/fxoKPZPf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2MYskBveyaxt
37
+ Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
38
+ voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
39
+ -----END CERTIFICATE-----
40
+ date: 2022-08-27 00:00:00.000000000 Z
41
+ dependencies:
42
+ - !ruby/object:Gem::Dependency
43
+ name: async-http
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '0.50'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '0.50'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rack
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '1.0'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '1.0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: sus
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 0.11.2
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 0.11.2
84
+ - !ruby/object:Gem::Dependency
85
+ name: sus-fixtures-async
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: 0.1.0
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: 0.1.0
98
+ description:
99
+ email:
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - lib/rack/conform.rb
105
+ - lib/rack/conform/server.rb
106
+ - lib/rack/conform/version.rb
107
+ - license.md
108
+ - readme.md
109
+ homepage: https://github.com/socketry/rack-conform
110
+ licenses:
111
+ - MIT
112
+ metadata: {}
113
+ post_install_message:
114
+ rdoc_options: []
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '2.5'
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ requirements: []
128
+ rubygems_version: 3.3.7
129
+ signing_key:
130
+ specification_version: 4
131
+ summary: An implementation of the Rack protocol/specification.
132
+ test_files: []
metadata.gz.sig ADDED
Binary file