Skip to content

Commit 9b1123c

Browse files
authored
Support Rails 8.1 and Ruby 3.4 (#342)
* Use stable Mongoid
1 parent bc1d2cc commit 9b1123c

File tree

11 files changed

+78
-46
lines changed

11 files changed

+78
-46
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,24 @@ jobs:
88
fail-fast: false
99
matrix:
1010
# To keep matrix size down, only test highest and lowest rubies.
11-
ruby: ["3.0", "3.3"]
12-
rails: ["7.0", "7.1", "7.2", "8.0"]
11+
ruby: ["3.0", "3.4"]
12+
rails: ["7.0", "7.1", "7.2", "8.0", "8.1"]
1313
exclude:
1414
- ruby: "3.0"
1515
rails: "7.2"
1616
- ruby: "3.0"
1717
rails: "8.0"
18+
- ruby: "3.0"
19+
rails: "8.1"
20+
- ruby: "3.4"
21+
rails: "7.0"
1822
name: Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails }}
1923
runs-on: ubuntu-latest
2024
env:
2125
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}.gemfile
2226
steps:
23-
- uses: actions/checkout@v4
24-
- uses: supercharge/mongodb-github-action@1.11.0
27+
- uses: actions/checkout@v5
28+
- uses: supercharge/mongodb-github-action@1.12.0
2529
- uses: ruby/setup-ruby@v1
2630
with:
2731
ruby-version: ${{ matrix.ruby }}

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
description: "RubyGems account API key"
88
required: true
99

10-
1110
workflow_dispatch: # Trigger the workflow manually
1211
inputs:
1312
otp_code:
@@ -26,12 +25,12 @@ jobs:
2625
steps:
2726

2827
- name: Checkout code
29-
uses: actions/checkout@v3
28+
uses: actions/checkout@v5
3029

3130
- name: Set up Ruby
3231
uses: ruby/setup-ruby@v1
3332
with:
34-
ruby-version: '3.3.4'
33+
ruby-version: '3.4.7'
3534

3635
- name: Extract Gem Version
3736
id: extract_version

Appraisals

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
11
# frozen_string_literal: true
22

3-
appraise "rails-6.1" do
4-
group :development do
5-
gem "rails", "~> 6.1.0"
6-
end
7-
end
8-
93
appraise "rails-7.0" do
104
group :development do
115
gem "rails", "~> 7.0.0"
6+
gem "sqlite3", "~> 1.7.0"
127
end
138
end
149

1510
appraise "rails-7.1" do
1611
group :development do
1712
gem "rails", "~> 7.1.0"
13+
gem "sqlite3", "~> 1.7.0"
1814
end
1915
end
2016

2117
appraise "rails-7.2" do
2218
group :development do
2319
gem "rails", "~> 7.2.0"
2420
gem "sqlite3", "~> 2.0.0"
25-
group :mongo do
26-
gem "mongoid", github: "mongodb/mongoid"
27-
end
21+
end
22+
end
23+
24+
appraise "rails-8.0" do
25+
group :development do
26+
gem "rails", "~> 8.0.0"
27+
gem "sqlite3", "~> 2.1.0"
28+
end
29+
end
30+
31+
appraise "rails-8.1" do
32+
group :development do
33+
gem "rails", ">= 8.1.0.rc1", "< 8.2"
34+
gem "sqlite3", "~> 2.1.0"
2835
end
2936
end

CONTRIBUTING.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ Tests can be run against different versions of Rails:
1717
bundle install
1818
bundle exec appraisal install
1919

20-
# Run tests against Rails 7.2
21-
bundle exec appraisal rails-7.2 rake
20+
# Run tests against Rails 8.1
21+
bundle exec appraisal rails-8.1 rake
2222

23-
# Run tests against Rails 6.1
24-
bundle exec appraisal rails-6.1 rake
23+
# Run tests against Rails 7.0
24+
bundle exec appraisal rails-7.0 rake
2525
```
2626

2727
**Using BUNDLE_GEMFILE**
2828

2929
``` shell
30-
# Run tests against Rails 7.2
31-
BUNDLE_GEMFILE=gemfiles/rails_7.2.gemfile bundle install
32-
BUNDLE_GEMFILE=gemfiles/rails_7.2.gemfile bundle exec rake
30+
# Run tests against Rails 8.1
31+
BUNDLE_GEMFILE=gemfiles/rails_8.1.gemfile bundle install
32+
BUNDLE_GEMFILE=gemfiles/rails_8.1.gemfile bundle exec rake
3333

34-
# Run tests against Rails 6.1
35-
BUNDLE_GEMFILE=gemfiles/rails_6.1.gemfile bundle install
36-
BUNDLE_GEMFILE=gemfiles/rails_6.1.gemfile bundle exec rake
34+
# Run tests against Rails 7.0
35+
BUNDLE_GEMFILE=gemfiles/rails_7.0.gemfile bundle install
36+
BUNDLE_GEMFILE=gemfiles/rails_7.0.gemfile bundle exec rake
3737
```

gemfiles/rails_7.0.gemfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
# frozen_string_literal: true
2-
31
# This file was generated by Appraisal
42

53
source "https://rubygems.org"
64

75
group :development do
6+
gem "activerecord"
87
gem "appraisal"
98
gem "bump"
109
gem "csv"
10+
gem "debug"
1111
gem "nokogiri"
1212
gem "pry-byebug"
13-
gem "rails", "~> 7.0.0"
13+
gem "rails-dom-testing", "~> 2.2"
1414
gem "rspec"
15+
gem "rubocop", "~> 1.68"
16+
gem "rubocop-yard", "~> 0.9.3", require: false
1517
gem "sequel"
1618
gem "sqlite3", "~> 1.7.0"
19+
gem "rails", "~> 7.0.0"
1720

1821
group :mongo do
1922
gem "bson"

gemfiles/rails_7.1.gemfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
# frozen_string_literal: true
2-
31
# This file was generated by Appraisal
42

53
source "https://rubygems.org"
64

75
group :development do
6+
gem "activerecord"
87
gem "appraisal"
98
gem "bump"
109
gem "csv"
10+
gem "debug"
1111
gem "nokogiri"
1212
gem "pry-byebug"
13-
gem "rails", "~> 7.1.0"
13+
gem "rails-dom-testing", "~> 2.2"
1414
gem "rspec"
15+
gem "rubocop", "~> 1.68"
16+
gem "rubocop-yard", "~> 0.9.3", require: false
1517
gem "sequel"
1618
gem "sqlite3", "~> 1.7.0"
19+
gem "rails", "~> 7.1.0"
1720

1821
group :mongo do
1922
gem "bson"

gemfiles/rails_7.2.gemfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
# frozen_string_literal: true
2-
31
# This file was generated by Appraisal
42

53
source "https://rubygems.org"
64

75
group :development do
6+
gem "activerecord"
87
gem "appraisal"
98
gem "bump"
109
gem "csv"
10+
gem "debug"
1111
gem "nokogiri"
1212
gem "pry-byebug"
13-
gem "rails", "~> 7.2.0"
13+
gem "rails-dom-testing", "~> 2.2"
1414
gem "rspec"
15+
gem "rubocop", "~> 1.68"
16+
gem "rubocop-yard", "~> 0.9.3", require: false
1517
gem "sequel"
1618
gem "sqlite3", "~> 2.0.0"
19+
gem "rails", "~> 7.2.0"
1720

1821
group :mongo do
1922
gem "bson"
20-
gem "mongoid", github: "mongodb/mongoid"
23+
gem "mongoid", "~> 9.0"
2124
end
2225
end
2326

gemfiles/rails_8.0.gemfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
# frozen_string_literal: true
2-
31
# This file was generated by Appraisal
42

53
source "https://rubygems.org"
64

75
group :development do
6+
gem "activerecord"
87
gem "appraisal"
98
gem "bump"
109
gem "csv"
10+
gem "debug"
1111
gem "nokogiri"
1212
gem "pry-byebug"
13-
gem "rails", "~> 8.0.0"
13+
gem "rails-dom-testing", "~> 2.2"
1414
gem "rspec"
15+
gem "rubocop", "~> 1.68"
16+
gem "rubocop-yard", "~> 0.9.3", require: false
1517
gem "sequel"
1618
gem "sqlite3", "~> 2.1.0"
19+
gem "rails", "~> 8.0.0"
1720

1821
group :mongo do
1922
gem "bson"
20-
gem "mongoid", github: "mongodb/mongoid"
23+
gem "mongoid", "~> 9.0"
2124
end
2225
end
2326

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
# frozen_string_literal: true
2-
31
# This file was generated by Appraisal
42

53
source "https://rubygems.org"
64

75
group :development do
6+
gem "activerecord"
87
gem "appraisal"
98
gem "bump"
109
gem "csv"
10+
gem "debug"
1111
gem "nokogiri"
1212
gem "pry-byebug"
13-
gem "rails", "~> 6.1.0"
13+
gem "rails-dom-testing", "~> 2.2"
1414
gem "rspec"
15+
gem "rubocop", "~> 1.68"
16+
gem "rubocop-yard", "~> 0.9.3", require: false
1517
gem "sequel"
16-
gem "sqlite3", "~> 1.7.0"
18+
gem "sqlite3", "~> 2.1.0"
19+
gem "rails", ">= 8.1.0.rc1", "< 8.2"
1720

1821
group :mongo do
1922
gem "bson"

lib/datagrid/columns/column.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,14 @@ def enabled?(grid)
168168

169169
# @return [String] column console inspection
170170
def inspect
171-
"#<#{self.class} #{grid_class}##{name} #{options.inspect}>"
171+
options_inspection = if RUBY_VERSION >= "3.4"
172+
# Ruby 3.4+ changed Hash#inspect format for symbol keys from {:key=>"value"} to {key: "value"}
173+
options.inspect
174+
else
175+
"{#{options.map { |key, value| "#{key}: #{value.inspect}" }.join(", ")}}"
176+
end
177+
178+
"#<#{self.class} #{grid_class}##{name} #{options_inspection}>"
172179
end
173180

174181
# @return [String] column header

0 commit comments

Comments
 (0)