Skip to content

Commit e6af83c

Browse files
committed
Modernize gem.
1 parent 96177e4 commit e6af83c

32 files changed

+217
-418
lines changed

.github/workflows/documentation.yaml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
# Allows you to run this workflow manually from the Actions tab:
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages:
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow one concurrent deployment:
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: true
21+
22+
env:
23+
CONSOLE_OUTPUT: XTerm
24+
BUNDLE_WITH: maintenance
25+
26+
jobs:
27+
generate:
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- uses: actions/checkout@v3
32+
33+
- uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: "3.1"
36+
bundler-cache: true
37+
38+
- name: Installing packages
39+
run: sudo apt-get install wget
40+
41+
- name: Generate documentation
42+
timeout-minutes: 5
43+
run: bundle exec bake utopia:project:static --force no
44+
45+
- name: Upload documentation artifact
46+
uses: actions/upload-pages-artifact@v1
47+
with:
48+
path: docs
49+
50+
deploy:
51+
runs-on: ubuntu-latest
52+
53+
environment:
54+
name: github-pages
55+
url: ${{steps.deployment.outputs.page_url}}
56+
57+
needs: generate
58+
steps:
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v1

.github/workflows/documentation.yml

-34
This file was deleted.

.github/workflows/test-external.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test External
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
env:
9+
CONSOLE_OUTPUT: XTerm
10+
11+
jobs:
12+
test:
13+
name: ${{matrix.ruby}} on ${{matrix.os}}
14+
runs-on: ${{matrix.os}}-latest
15+
16+
strategy:
17+
matrix:
18+
os:
19+
- ubuntu
20+
- macos
21+
22+
ruby:
23+
- "2.7"
24+
- "3.0"
25+
- "3.1"
26+
27+
steps:
28+
- uses: actions/checkout@v3
29+
- uses: ruby/setup-ruby@v1
30+
with:
31+
ruby-version: ${{matrix.ruby}}
32+
bundler-cache: true
33+
34+
- name: Run tests
35+
timeout-minutes: 10
36+
run: bundle exec bake test:external

.github/workflows/development.yml renamed to .github/workflows/test.yaml

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
name: Development
1+
name: Test
22

33
on: [push, pull_request]
44

5+
permissions:
6+
contents: read
7+
8+
env:
9+
CONSOLE_OUTPUT: XTerm
10+
511
jobs:
612
test:
713
name: ${{matrix.ruby}} on ${{matrix.os}}
@@ -15,12 +21,11 @@ jobs:
1521
- macos
1622

1723
ruby:
18-
- "2.6"
1924
- "2.7"
2025
- "3.0"
26+
- "3.1"
2127

2228
experimental: [false]
23-
env: [""]
2429

2530
include:
2631
- os: ubuntu
@@ -34,12 +39,12 @@ jobs:
3439
experimental: true
3540

3641
steps:
37-
- uses: actions/checkout@v2
42+
- uses: actions/checkout@v3
3843
- uses: ruby/setup-ruby@v1
3944
with:
4045
ruby-version: ${{matrix.ruby}}
4146
bundler-cache: true
4247

4348
- name: Run tests
44-
timeout-minutes: 5
45-
run: ${{matrix.env}} bundle exec rspec
49+
timeout-minutes: 10
50+
run: bundle exec bake test

.gitignore

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
/.bundle/
2-
/.yardoc
3-
/_yardoc/
4-
/coverage/
5-
/doc/
62
/pkg/
7-
/spec/reports/
8-
/tmp/
3+
/gems.locked
4+
/.covered.db
5+
/external
96

107
# rspec failure tracking
11-
.rspec_status
12-
/gems.locked
13-
.covered.db
8+
/.rspec_status
149

1510
/fuzz/request/output

examples/early-hints/server.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env ruby
22
# frozen_string_literal: true
33

4+
# Released under the MIT License.
5+
# Copyright, 2022, by Samuel Williams.
6+
47
$LOAD_PATH.unshift File.expand_path("../../lib", __dir__)
58

69
require 'async'

examples/http1/request.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# frozen_string_literal: true
22

3+
# Released under the MIT License.
4+
# Copyright, 2019-2022, by Samuel Williams.
5+
36
$LOAD_PATH.unshift File.expand_path("../../lib", __dir__)
47

58
require 'async'

fuzz/request/bake.rb

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2020-2022, by Samuel Williams.
15

26
# Run the fuzz test.
37
def run

fuzz/request/script.rb

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
# Released under the MIT License.
5+
# Copyright, 2020-2022, by Samuel Williams.
26

37
require 'socket'
48
require_relative '../../lib/protocol/http1'

gems.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# frozen_string_literal: true
22

3+
# Released under the MIT License.
4+
# Copyright, 2020-2022, by Samuel Williams.
5+
36
source "https://rubygems.org"
47

58
gemspec

lib/protocol/http1.rb

+2-19
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
11
# frozen_string_literal: true
22

3-
# Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
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
13-
# all 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
21-
# THE SOFTWARE.
3+
# Released under the MIT License.
4+
# Copyright, 2019-2022, by Samuel Williams.
225

236
require_relative 'http1/version'
247
require_relative 'http1/connection'

lib/protocol/http1/body/chunked.rb

+2-19
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
11
# frozen_string_literal: true
22

3-
# Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
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
13-
# all 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
21-
# THE SOFTWARE.
3+
# Released under the MIT License.
4+
# Copyright, 2019-2022, by Samuel Williams.
225

236
require 'protocol/http/body/readable'
247

lib/protocol/http1/body/fixed.rb

+2-19
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
11
# frozen_string_literal: true
22

3-
# Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
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
13-
# all 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
21-
# THE SOFTWARE.
3+
# Released under the MIT License.
4+
# Copyright, 2019-2022, by Samuel Williams.
225

236
require 'protocol/http/body/readable'
247

lib/protocol/http1/body/remainder.rb

+2-19
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
11
# frozen_string_literal: true
22

3-
# Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
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
13-
# all 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
21-
# THE SOFTWARE.
3+
# Released under the MIT License.
4+
# Copyright, 2019-2022, by Samuel Williams.
225

236
require 'protocol/http/body/readable'
247

lib/protocol/http1/connection.rb

+3-19
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
11
# frozen_string_literal: true
22

3-
# Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
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
13-
# all 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
21-
# THE SOFTWARE.
3+
# Released under the MIT License.
4+
# Copyright, 2019-2022, by Samuel Williams.
5+
# Copyright, 2020, by Bruno Sutic.
226

237
require 'protocol/http/headers'
248

0 commit comments

Comments
 (0)