Skip to content

Commit b05b9da

Browse files
committed
Modernize code.
1 parent b7cc15d commit b05b9da

34 files changed

+199
-77
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: 1 addition & 1 deletion
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

.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.yaml

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

2323
ruby:
24-
- "3.1"
2524
- "3.2"
2625
- "3.3"
26+
- "3.4"
2727

2828
experimental: [false]
2929

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/.bundle/
2-
/pkg/
1+
/.bundle
2+
/pkg
33
/gems.locked
44
/.covered.db
55
/external

.rubocop.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
Layout/EmptyLineAfterMagicComment:
49+
Enabled: true
50+
51+
Layout/SpaceInsideBlockBraces:
52+
Enabled: true
53+
EnforcedStyle: no_space
54+
SpaceBeforeBlockParameters: false
55+
56+
Layout/SpaceAroundBlockParameters:
57+
Enabled: true
58+
EnforcedStyleInsidePipes: no_space
59+
60+
Style/FrozenStringLiteralComment:
61+
Enabled: true
62+
63+
Style/StringLiterals:
64+
Enabled: true
65+
EnforcedStyle: double_quotes

bake.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, 2025, by Samuel Williams.
55

66
# Update the project documentation with the new version number.
77
#
88
# @parameter version [String] The new version number.
99
def after_gem_release_version_increment(version)
10-
context['releases:update'].call(version)
11-
context['utopia:project:readme:update'].call
10+
context["releases:update"].call(version)
11+
context["utopia:project:readme:update"].call
1212
end

bake/utopia/project.rb

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

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

66
# Create an empty project in the current directory.
77
def create
@@ -38,7 +38,7 @@ def serve(port: nil, bind: nil)
3838
# @parameter output_path [String] The output path for the static site.
3939
# @parameter force [Boolean] Remove the output directory before generating the static content.
4040
def static(output_path: "docs", force: true)
41-
require 'rackula/command'
41+
require "rackula/command"
4242

4343
config_path = File.expand_path("../../template/config.ru", __dir__)
4444
public_path = File.expand_path("../../public", __dir__)
@@ -60,7 +60,7 @@ def static(output_path: "docs", force: true)
6060

6161
# Extract a description for the project.
6262
def description(root: context.root)
63-
require 'markly'
63+
require "markly"
6464

6565
readme_path = File.join(root, "readme.md")
6666
if File.exist?(readme_path)

bake/utopia/project/readme/update.rb

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

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

6-
require 'utopia/project'
7-
require 'xrb'
6+
require "utopia/project"
7+
require "xrb"
88

99
def update(path: "readme.md", documentation_url: nil)
1010
project = Utopia::Project::Base.new(context.root)
@@ -52,7 +52,7 @@ def gemspec
5252
# The public documentation URL if it can be determined.
5353
def public_documentation_url
5454
if metadata = gemspec.metadata
55-
if documentation_uri = metadata['documentation_uri']
55+
if documentation_uri = metadata["documentation_uri"]
5656
return documentation_uri
5757
end
5858
end

0 commit comments

Comments
 (0)