Skip to content

Commit 8da527c

Browse files
committed
Modernize code.
1 parent c7597d9 commit 8da527c

28 files changed

+242
-114
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Documentation Coverage
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
env:
9+
CONSOLE_OUTPUT: XTerm
10+
COVERAGE: PartialSummary
11+
12+
jobs:
13+
validate:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: ruby/setup-ruby@v1
19+
with:
20+
ruby-version: "3.4"
21+
bundler-cache: true
22+
23+
- name: Validate coverage
24+
timeout-minutes: 5
25+
run: bundle exec bake decode:index:coverage lib

.github/workflows/documentation.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
- uses: ruby/setup-ruby@v1
3131
with:
32-
ruby-version: "3.3"
32+
ruby-version: "3.4"
3333
bundler-cache: true
3434

3535
- name: Installing packages
@@ -40,7 +40,7 @@ jobs:
4040
run: bundle exec bake utopia:project:static --force no
4141

4242
- name: Upload documentation artifact
43-
uses: actions/upload-pages-artifact@v2
43+
uses: actions/upload-pages-artifact@v3
4444
with:
4545
path: docs
4646

@@ -55,4 +55,4 @@ jobs:
5555
steps:
5656
- name: Deploy to GitHub Pages
5757
id: deployment
58-
uses: actions/deploy-pages@v3
58+
uses: actions/deploy-pages@v4

.github/workflows/rubocop.yaml

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

.github/workflows/coverage.yaml renamed to .github/workflows/test-coverage.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Coverage
1+
name: Test Coverage
22

33
on: [push, pull_request]
44

@@ -21,7 +21,7 @@ jobs:
2121
- macos
2222

2323
ruby:
24-
- "3.3"
24+
- "3.4"
2525

2626
steps:
2727
- uses: actions/checkout@v4
@@ -33,9 +33,11 @@ jobs:
3333
- name: Run tests
3434
timeout-minutes: 5
3535
run: bundle exec bake test
36-
37-
- uses: actions/upload-artifact@v3
36+
37+
- uses: actions/upload-artifact@v4
3838
with:
39+
include-hidden-files: true
40+
if-no-files-found: error
3941
name: coverage-${{matrix.os}}-${{matrix.ruby}}
4042
path: .covered.db
4143

@@ -47,10 +49,10 @@ jobs:
4749
- uses: actions/checkout@v4
4850
- uses: ruby/setup-ruby@v1
4951
with:
50-
ruby-version: "3.3"
52+
ruby-version: "3.4"
5153
bundler-cache: true
5254

53-
- uses: actions/download-artifact@v3
55+
- uses: actions/download-artifact@v4
5456

5557
- name: Validate coverage
5658
timeout-minutes: 5

.github/workflows/test-external.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
- macos
2121

2222
ruby:
23-
- "3.0"
2423
- "3.1"
2524
- "3.2"
2625
- "3.3"
26+
- "3.4"
2727

2828
steps:
2929
- uses: actions/checkout@v4

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
- macos
2222

2323
ruby:
24-
- "3.0"
2524
- "3.1"
2625
- "3.2"
2726
- "3.3"
27+
- "3.4"
2828

2929
experimental: [false]
3030

.rubocop.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
AllCops:
2+
DisabledByDefault: true
3+
4+
Layout/IndentationStyle:
5+
Enabled: true
6+
EnforcedStyle: tabs
7+
8+
Layout/InitialIndentation:
9+
Enabled: true
10+
11+
Layout/IndentationWidth:
12+
Enabled: true
13+
Width: 1
14+
15+
Layout/IndentationConsistency:
16+
Enabled: true
17+
EnforcedStyle: normal
18+
19+
Layout/BlockAlignment:
20+
Enabled: true
21+
22+
Layout/EndAlignment:
23+
Enabled: true
24+
EnforcedStyleAlignWith: start_of_line
25+
26+
Layout/BeginEndAlignment:
27+
Enabled: true
28+
EnforcedStyleAlignWith: start_of_line
29+
30+
Layout/ElseAlignment:
31+
Enabled: true
32+
33+
Layout/DefEndAlignment:
34+
Enabled: true
35+
36+
Layout/CaseIndentation:
37+
Enabled: true
38+
39+
Layout/CommentIndentation:
40+
Enabled: true
41+
42+
Layout/EmptyLinesAroundClassBody:
43+
Enabled: true
44+
45+
Layout/EmptyLinesAroundModuleBody:
46+
Enabled: true
47+
48+
Style/FrozenStringLiteralComment:
49+
Enabled: true
50+
51+
Style/StringLiterals:
52+
Enabled: true
53+
EnforcedStyle: double_quotes

async-service.gemspec

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@ Gem::Specification.new do |spec|
1010
spec.authors = ["Samuel Williams"]
1111
spec.license = "MIT"
1212

13-
spec.cert_chain = ['release.cert']
14-
spec.signing_key = File.expand_path('~/.gem/release.pem')
13+
spec.cert_chain = ["release.cert"]
14+
spec.signing_key = File.expand_path("~/.gem/release.pem")
1515

1616
spec.homepage = "https://github.com/socketry/async-service"
1717

1818
spec.metadata = {
1919
"documentation_uri" => "https://socketry.github.io/async-service/",
20+
"source_code_uri" => "https://github.com/socketry/async-service.git",
2021
}
2122

22-
spec.files = Dir.glob(['{bin,lib}/**/*', '*.md'], File::FNM_DOTMATCH, base: __dir__)
23+
spec.files = Dir.glob(["{bin,lib}/**/*", "*.md"], File::FNM_DOTMATCH, base: __dir__)
2324

2425
spec.executables = ["async-service"]
2526

26-
spec.required_ruby_version = ">= 3.0"
27+
spec.required_ruby_version = ">= 3.1"
2728

2829
spec.add_dependency "async"
2930
spec.add_dependency "async-container", "~> 0.16"

bake/async/service/configuration.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# frozen_string_literal: true
22

33
# Released under the MIT License.
4-
# Copyright, 2024, by Samuel Williams.
4+
# Copyright, 2024-2025, by Samuel Williams.
55

66
def initialize(context)
77
super
88

9-
require 'async/service/configuration'
9+
require "async/service/configuration"
1010

1111
@configuration = Async::Service::Configuration.new
1212
end

bake/async/service/controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# frozen_string_literal: true
22

33
# Released under the MIT License.
4-
# Copyright, 2024, by Samuel Williams.
4+
# Copyright, 2024-2025, by Samuel Williams.
55

66
def initialize(context)
77
super
88

9-
require 'async/service/controller'
9+
require "async/service/controller"
1010
end
1111

1212
def run
@@ -28,7 +28,7 @@ def run
2828
private
2929

3030
def controller
31-
configuration = context.lookup('async:service:configuration').instance.configuration
31+
configuration = context.lookup("async:service:configuration").instance.configuration
3232

3333
return Async::Service::Controller.new(configuration.services)
3434
end

0 commit comments

Comments
 (0)