Skip to content

Commit a6cbea9

Browse files
committed
Modernize gem.
1 parent 87104b2 commit a6cbea9

24 files changed

+189
-42
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ root = true
33
[*]
44
indent_style = tab
55
indent_size = 2
6+
7+
[*.{yml,yaml}]
8+
indent_style = space
9+
indent_size = 2
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.3"
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: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
branches:
66
- main
77

8-
# Allows you to run this workflow manually from the Actions tab:
9-
workflow_dispatch:
10-
118
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages:
129
permissions:
1310
contents: read
@@ -28,11 +25,11 @@ jobs:
2825
runs-on: ubuntu-latest
2926

3027
steps:
31-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
3229

3330
- uses: ruby/setup-ruby@v1
3431
with:
35-
ruby-version: "3.2"
32+
ruby-version: "3.3"
3633
bundler-cache: true
3734

3835
- name: Installing packages
@@ -43,7 +40,7 @@ jobs:
4340
run: bundle exec bake utopia:project:static --force no
4441

4542
- name: Upload documentation artifact
46-
uses: actions/upload-pages-artifact@v1
43+
uses: actions/upload-pages-artifact@v3
4744
with:
4845
path: docs
4946

@@ -58,4 +55,4 @@ jobs:
5855
steps:
5956
- name: Deploy to GitHub Pages
6057
id: deployment
61-
uses: actions/deploy-pages@v1
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: 7 additions & 7 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,10 +21,10 @@ jobs:
2121
- macos
2222

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

2626
steps:
27-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2828
- uses: ruby/setup-ruby@v1
2929
with:
3030
ruby-version: ${{matrix.ruby}}
@@ -33,8 +33,8 @@ jobs:
3333
- name: Run tests
3434
timeout-minutes: 5
3535
run: bundle exec bake test
36-
37-
- uses: actions/upload-artifact@v2
36+
37+
- uses: actions/upload-artifact@v3
3838
with:
3939
name: coverage-${{matrix.os}}-${{matrix.ruby}}
4040
path: .covered.db
@@ -44,10 +44,10 @@ jobs:
4444
runs-on: ubuntu-latest
4545

4646
steps:
47-
- uses: actions/checkout@v3
47+
- uses: actions/checkout@v4
4848
- uses: ruby/setup-ruby@v1
4949
with:
50-
ruby-version: "3.2"
50+
ruby-version: "3.3"
5151
bundler-cache: true
5252

5353
- uses: actions/download-artifact@v3

.github/workflows/test-external.yaml

Lines changed: 36 additions & 0 deletions
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+
- "3.1"
24+
- "3.2"
25+
- "3.3"
26+
27+
steps:
28+
- uses: actions/checkout@v4
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/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
- macos
2222

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

2828
gemfile:
2929
- gems/rails-v6.rb
@@ -46,7 +46,7 @@ jobs:
4646
BUNDLE_GEMFILE: ${{matrix.gemfile}}
4747

4848
steps:
49-
- uses: actions/checkout@v3
49+
- uses: actions/checkout@v4
5050
- uses: ruby/setup-ruby@v1
5151
with:
5252
ruby-version: ${{matrix.ruby}}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/.bundle/
22
/pkg/
33
/gems.locked
4-
/gems/*.lock
54
/.covered.db
65
/external
76

.rubocop.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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/EndAlignment:
20+
Enabled: true
21+
EnforcedStyleAlignWith: start_of_line
22+
23+
Layout/BeginEndAlignment:
24+
Enabled: true
25+
EnforcedStyleAlignWith: start_of_line
26+
27+
Layout/ElseAlignment:
28+
Enabled: true
29+
30+
Layout/DefEndAlignment:
31+
Enabled: true
32+
33+
Layout/CaseIndentation:
34+
Enabled: true
35+
36+
Layout/CommentIndentation:
37+
Enabled: true
38+
39+
Layout/EmptyLinesAroundClassBody:
40+
Enabled: true
41+
42+
Layout/EmptyLinesAroundModuleBody:
43+
Enabled: true
44+
45+
Style/FrozenStringLiteralComment:
46+
Enabled: true

console-adapter-rails.gemspec

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
77
spec.version = Console::Adapter::Rails::VERSION
88

99
spec.summary = "Adapt Rails logs and events to the console gem."
10-
spec.authors = ["Samuel Williams"]
10+
spec.authors = ["Samuel Williams", "Joshua Young", "Michael Adams"]
1111
spec.license = "MIT"
1212

1313
spec.cert_chain = ['release.cert']
@@ -17,13 +17,14 @@ Gem::Specification.new do |spec|
1717

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

2223
spec.files = Dir.glob(['{lib}/**/*', '*.md'], File::FNM_DOTMATCH, base: __dir__)
2324

24-
spec.required_ruby_version = ">= 3.0"
25+
spec.required_ruby_version = ">= 3.1"
2526

2627
spec.add_dependency "console", "~> 1.21"
28+
spec.add_dependency "fiber-storage", "~> 1.0"
2729
spec.add_dependency "rails", ">= 6.1"
28-
spec.add_dependency "fiber-storage", "~> 0.1"
2930
end

fixtures/app.rb

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

33
# Released under the MIT License.
4-
# Copyright, 2023, by Samuel Williams.
4+
# Copyright, 2023-2024, by Samuel Williams.
5+
# Copyright, 2024, by Michael Adams.
56

67
require 'rails'
78
require 'action_controller/railtie'

gems.rb

Lines changed: 6 additions & 4 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, 2023, by Samuel Williams.
4+
# Copyright, 2023-2024, by Samuel Williams.
55

66
source "https://rubygems.org"
77

@@ -11,15 +11,17 @@
1111
gem "bake-gem"
1212
gem "bake-modernize"
1313

14-
gem "bake-github-pages"
1514
gem "utopia-project"
1615
end
1716

1817
group :test do
19-
gem "bake-test"
20-
2118
gem "sus"
2219
gem "covered"
20+
gem "decode"
21+
gem "rubocop"
22+
23+
gem "bake-test"
24+
gem "bake-test-external"
2325

2426
gem "sqlite3"
2527
end

gems/rails-v6.rb

Lines changed: 3 additions & 0 deletions
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, 2023-2024, by Samuel Williams.
5+
36
eval_gemfile('../gems.rb')
47

58
gem 'rails', '~> 6.0'

gems/rails-v7.rb

Lines changed: 3 additions & 0 deletions
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, 2023-2024, by Samuel Williams.
5+
36
eval_gemfile('../gems.rb')
47

58
gem 'rails', '~> 7.0'

lib/console/adapter/rails.rb

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

33
# Released under the MIT License.
4-
# Copyright, 2023, by Samuel Williams.
4+
# Copyright, 2023-2024, by Samuel Williams.
5+
# Copyright, 2024, by Michael Adams.
56

67
require_relative 'rails/logger'
78
require_relative 'rails/action_controller'

lib/console/adapter/rails/action_controller.rb

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

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

66
require 'console'
77

8+
require 'active_support/log_subscriber'
89
require 'action_controller/log_subscriber'
910

1011
module Console

lib/console/adapter/rails/active_record.rb

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

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

66
require 'console'
77

8+
require 'active_support/log_subscriber'
89
require 'active_record/log_subscriber'
910

1011
module Console
@@ -67,4 +68,4 @@ def self.apply!(notifications: ActiveSupport::Notifications)
6768
end
6869
end
6970
end
70-
end
71+
end

lib/console/adapter/rails/logger.rb

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

33
# Released under the MIT License.
4-
# Copyright, 2023, by Samuel Williams.
4+
# Copyright, 2023-2024, by Samuel Williams.
5+
# Copyright, 2024, by Michael Adams.
56

67
require 'console/compatible/logger'
78

lib/console/adapter/rails/railtie.rb

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

33
# Released under the MIT License.
4-
# Copyright, 2023, by Samuel Williams.
4+
# Copyright, 2024, by Michael Adams.
5+
# Copyright, 2024, by Samuel Williams.
56

67
require 'action_controller/log_subscriber'
78
require 'action_view/log_subscriber'

0 commit comments

Comments
 (0)