Skip to content

Commit c5cf0ad

Browse files
committed
Modernize code.
1 parent 9be2b9e commit c5cf0ad

40 files changed

+222
-120
lines changed

.github/workflows/benchmark-node.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
include:
20-
- ruby: "3.3"
20+
- ruby: ruby
2121
name: "Node-http"
2222
server: "node examples/node/server.js"
2323
endpoint: "http://localhost:3000"
@@ -30,7 +30,7 @@ jobs:
3030
bundler-cache: true
3131
- uses: actions/setup-node@v3
3232
with:
33-
node-version: "16"
33+
node-version: "22"
3434

3535
- name: Run benchmarks
3636
run: |

.github/workflows/rubocop.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: RuboCop
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: ruby
17+
bundler-cache: true
18+
19+
- name: Run RuboCop
20+
timeout-minutes: 10
21+
run: bundle exec rubocop

.github/workflows/test-passenger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
include:
24-
- ruby: "3.4"
24+
- ruby: ruby
2525
name: "Passenger-v6-Rack-v2-http"
2626
gemfile: "gems/passenger-v6-rack-v2.rb"
2727
server: "passenger start"

.github/workflows/test.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,72 +29,72 @@ jobs:
2929
fail-fast: false
3030
matrix:
3131
include:
32-
- ruby: "3.4"
32+
- ruby: ruby
3333
name: "Webrick-Rack-v2-http"
3434
gemfile: "gems/webrick-rack-v2.rb"
3535
server: "rackup -s webrick"
3636
endpoint: "http://localhost:9292"
37-
- ruby: "3.4"
37+
- ruby: ruby
3838
name: "Webrick-Rack-v3-http"
3939
gemfile: "gems/webrick-rack-v3.rb"
4040
server: "rackup -s webrick"
4141
endpoint: "http://localhost:9292"
42-
- ruby: "3.4"
42+
- ruby: ruby
4343
name: "Falcon-v0-Rack-v2-https"
4444
gemfile: "gems/falcon-v0-rack-v2.rb"
4545
server: "falcon"
4646
endpoint: "https://localhost:9292"
47-
- ruby: "3.4"
47+
- ruby: ruby
4848
name: "Falcon-v0-Rack-v3-https"
4949
gemfile: "gems/falcon-v0-rack-v3.rb"
5050
server: "falcon"
5151
endpoint: "https://localhost:9292"
52-
- ruby: "3.4"
52+
- ruby: ruby
5353
name: "Falcon-v0-Rack-v3-http"
5454
gemfile: "gems/falcon-v0-rack-v3.rb"
5555
server: "falcon --bind http://localhost:9292"
5656
endpoint: "http://localhost:9292"
57-
- ruby: "3.4"
57+
- ruby: ruby
5858
name: "Puma-v4-Rack-v2-http"
5959
gemfile: "gems/puma-v4-rack-v2.rb"
6060
server: "puma"
6161
endpoint: "http://localhost:9292"
62-
- ruby: "3.4"
62+
- ruby: ruby
6363
name: "Puma-v5-Rack-v2-http"
6464
gemfile: "gems/puma-v5-rack-v2.rb"
6565
server: "puma"
6666
endpoint: "http://localhost:9292"
67-
- ruby: "3.4"
67+
- ruby: ruby
6868
name: "Puma-v6-Rack-v2-http"
6969
gemfile: "gems/puma-v6-rack-v2.rb"
7070
server: "puma"
7171
endpoint: "http://localhost:9292"
72-
- ruby: "3.4"
72+
- ruby: ruby
7373
name: "Puma-v6-Rack-v3-http"
7474
gemfile: "gems/puma-v6-rack-v3.rb"
7575
server: "puma"
7676
endpoint: "http://localhost:9292"
77-
- ruby: "3.4"
77+
- ruby: ruby
7878
name: "Puma-head-Rack-v2-http"
7979
gemfile: "gems/puma-head-rack-v2.rb"
8080
server: "puma"
8181
endpoint: "http://localhost:9292"
82-
- ruby: "3.4"
82+
- ruby: ruby
8383
name: "Puma-head-Rack-v3-http"
8484
gemfile: "gems/puma-head-rack-v3.rb"
8585
server: "puma"
8686
endpoint: "http://localhost:9292"
87-
- ruby: "3.4"
87+
- ruby: ruby
8888
name: "Thin-v1-Rack-v2-http"
8989
gemfile: "gems/thin-v1-rack-v2.rb"
9090
server: "thin start"
9191
endpoint: "http://localhost:3000"
92-
- ruby: "3.4"
92+
- ruby: ruby
9393
name: "Unicorn-v6-Rack-v2-http"
9494
gemfile: "gems/unicorn-v6-rack-v2.rb"
9595
server: "unicorn -E none"
9696
endpoint: "http://localhost:8080"
97-
- ruby: "3.4"
97+
- ruby: ruby
9898
name: "Pitchfork-head-Rack-v2-http"
9999
gemfile: "gems/pitchfork-head-rack-v2.rb"
100100
server: "pitchfork -E none"

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
/.bundle/
2-
/pkg/
1+
/.bundle
2+
/.context
3+
/pkg
34
/gems.locked
45
/.covered.db
56
/external

.rubocop.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
plugins:
2+
- rubocop-socketry
3+
4+
AllCops:
5+
DisabledByDefault: true
6+
7+
Layout/ConsistentBlankLineIndentation:
8+
Enabled: true
9+
10+
Layout/IndentationStyle:
11+
Enabled: true
12+
EnforcedStyle: tabs
13+
14+
Layout/InitialIndentation:
15+
Enabled: true
16+
17+
Layout/IndentationWidth:
18+
Enabled: true
19+
Width: 1
20+
21+
Layout/IndentationConsistency:
22+
Enabled: true
23+
EnforcedStyle: normal
24+
25+
Layout/BlockAlignment:
26+
Enabled: true
27+
28+
Layout/EndAlignment:
29+
Enabled: true
30+
EnforcedStyleAlignWith: start_of_line
31+
32+
Layout/BeginEndAlignment:
33+
Enabled: true
34+
EnforcedStyleAlignWith: start_of_line
35+
36+
Layout/ElseAlignment:
37+
Enabled: true
38+
39+
Layout/DefEndAlignment:
40+
Enabled: true
41+
42+
Layout/CaseIndentation:
43+
Enabled: true
44+
45+
Layout/CommentIndentation:
46+
Enabled: true
47+
48+
Layout/EmptyLinesAroundClassBody:
49+
Enabled: true
50+
51+
Layout/EmptyLinesAroundModuleBody:
52+
Enabled: true
53+
54+
Layout/EmptyLineAfterMagicComment:
55+
Enabled: true
56+
57+
Layout/SpaceInsideBlockBraces:
58+
Enabled: true
59+
EnforcedStyle: no_space
60+
SpaceBeforeBlockParameters: false
61+
62+
Layout/SpaceAroundBlockParameters:
63+
Enabled: true
64+
EnforcedStyleInsidePipes: no_space
65+
66+
Style/FrozenStringLiteralComment:
67+
Enabled: true
68+
69+
Style/StringLiterals:
70+
Enabled: true
71+
EnforcedStyle: double_quotes

bake/rack/conform.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
def initialize(...)
77
super
8-
require 'sus'
9-
require 'rack/conform/server'
8+
require "sus"
9+
require "rack/conform/server"
1010
end
1111

1212
def server

config.ru

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
require_relative 'lib/rack/conform/application'
1+
# frozen_string_literal: true
2+
3+
require_relative "lib/rack/conform/application"
24
run Rack::Conform::Application.new

config/sus.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Released under the MIT License.
44
# Copyright, 2022-2024, by Samuel Williams.
55

6-
require 'rack/conform/server'
6+
require "rack/conform/server"
77

88
def before_tests(assertions)
99
@server = Rack::Conform::Server.current

fixtures/client_context.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
# Released under the MIT License.
44
# Copyright, 2022, by Samuel Williams.
55

6-
require 'async/http/client'
7-
require 'async/http/endpoint'
8-
require 'sus/fixtures/async/reactor_context'
6+
require "async/http/client"
7+
require "async/http/endpoint"
8+
require "sus/fixtures/async/reactor_context"
99

1010
module ClientContext
1111
include Sus::Fixtures::Async::ReactorContext
1212

1313
def url
14-
ENV['RACK_CONFORM_ENDPOINT']
14+
ENV["RACK_CONFORM_ENDPOINT"]
1515
end
1616

1717
def endpoint

0 commit comments

Comments
 (0)