Skip to content

Commit f90c812

Browse files
committed
Modernize code.
1 parent bb5711e commit f90c812

27 files changed

+102
-100
lines changed

.github/workflows/documentation-coverage.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ permissions:
66
contents: read
77

88
env:
9-
CONSOLE_OUTPUT: XTerm
109
COVERAGE: PartialSummary
1110

1211
jobs:
@@ -17,7 +16,7 @@ jobs:
1716
- uses: actions/checkout@v4
1817
- uses: ruby/setup-ruby@v1
1918
with:
20-
ruby-version: "3.4"
19+
ruby-version: ruby
2120
bundler-cache: true
2221

2322
- name: Validate coverage

.github/workflows/documentation.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ concurrency:
1717
cancel-in-progress: true
1818

1919
env:
20-
CONSOLE_OUTPUT: XTerm
2120
BUNDLE_WITH: maintenance
2221

2322
jobs:
@@ -29,7 +28,7 @@ jobs:
2928

3029
- uses: ruby/setup-ruby@v1
3130
with:
32-
ruby-version: "3.4"
31+
ruby-version: ruby
3332
bundler-cache: true
3433

3534
- name: Installing packages

.github/workflows/rubocop.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on: [push, pull_request]
55
permissions:
66
contents: read
77

8-
env:
9-
CONSOLE_OUTPUT: XTerm
10-
118
jobs:
129
check:
1310
runs-on: ubuntu-latest

.github/workflows/test-coverage.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ permissions:
66
contents: read
77

88
env:
9-
CONSOLE_OUTPUT: XTerm
109
COVERAGE: PartialSummary
1110

1211
jobs:
@@ -56,7 +55,7 @@ jobs:
5655
- uses: actions/checkout@v4
5756
- uses: ruby/setup-ruby@v1
5857
with:
59-
ruby-version: "3.4"
58+
ruby-version: ruby
6059
bundler-cache: true
6160

6261
- uses: actions/download-artifact@v4

.github/workflows/test-external.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on: [push, pull_request]
55
permissions:
66
contents: read
77

8-
env:
9-
CONSOLE_OUTPUT: XTerm
10-
118
jobs:
129
test:
1310
name: ${{matrix.ruby}} on ${{matrix.os}}

.github/workflows/test.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on: [push, pull_request]
55
permissions:
66
contents: read
77

8-
env:
9-
CONSOLE_OUTPUT: XTerm
10-
118
jobs:
129
test:
1310
name: ${{matrix.ruby}} on ${{matrix.os}} ${{matrix.gemfile}}

.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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
plugins:
2+
- rubocop-socketry
3+
14
AllCops:
25
DisabledByDefault: true
36

7+
Layout/ConsistentBlankLineIndentation:
8+
Enabled: true
9+
410
Layout/IndentationStyle:
511
Enabled: true
612
EnforcedStyle: tabs
@@ -48,6 +54,15 @@ Layout/EmptyLinesAroundModuleBody:
4854
Layout/EmptyLineAfterMagicComment:
4955
Enabled: true
5056

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+
5166
Style/FrozenStringLiteralComment:
5267
Enabled: true
5368

examples/puma/config.ru

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ middleware = Protocol::HTTP::Middleware::HelloWorld
99
run proc{|env|
1010
# Convert the rack request to a compatible rich request object:
1111
request = Protocol::Rack::Request[env]
12-
12+
1313
# Call your application
1414
response = middleware.call(request)
15-
15+
1616
Protocol::Rack::Adapter.make_response(env, response)
1717
}

examples/rewind-bug/config.ru

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ class BodyTestApp
77
def call(env)
88
# Get the request body
99
body = env["rack.input"]
10-
10+
1111
# First read
1212
body.rewind
1313
first_read = body.read
14-
14+
1515
# Second read
1616
body.rewind
1717
second_read = body.read
18-
18+
1919
# Response showing both reads
2020
response_body = "First read: #{first_read.inspect}\n\nSecond read: #{second_read.inspect}"
21-
21+
2222
[200, { "Content-Type" => "text/plain" }, [response_body]]
2323
end
2424
end

0 commit comments

Comments
 (0)