Skip to content

Commit c069f71

Browse files
authored
Add support for ActiveRecord 7.2, Bump minimum Ruby to 3.2 and ActiveRecord to 7.1 (#349)
* Add support for ActiveRecord 7.2 * Bump minimum ActiveRecord to 7.1 * Bump minimum Ruby to 3.2 * Use bundle binstubs in CI
1 parent 2c2613b commit c069f71

File tree

7 files changed

+12
-62
lines changed

7 files changed

+12
-62
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
fail-fast: false
2929
matrix:
3030
ruby: ["3.2", "3.3", "3.4"]
31-
activerecord: [61, 70, 71, 80]
31+
activerecord: [71, 72, 80]
3232

3333
steps:
3434
- uses: actions/checkout@v4
@@ -40,7 +40,7 @@ jobs:
4040
bundler-cache: true
4141

4242
- name: Run tests
43-
run: bundle exec rake
43+
run: bin/rake
4444

4545
publish:
4646
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

.github/workflows/linting.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717
- name: Set up Ruby
1818
uses: ruby/setup-ruby@v1
1919
with:
20-
ruby-version: 3.4
20+
ruby-version: 3.2
2121
bundler: latest
2222
bundler-cache: true
2323

2424
- name: Rubocop
25-
run: bundle exec rubocop
25+
run: bin/rubocop
2626

2727
- name: Syntax tree
28-
run: bundle exec stree check Gemfile $(git ls-files '*.rb') $(git ls-files '*.rake') $(git ls-files '*.thor')
28+
run: bin/stree check Gemfile $(git ls-files '*.rb') $(git ls-files '*.rake') $(git ls-files '*.thor')

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ inherit_gem:
22
rubocop-discourse: default.yml
33

44
AllCops:
5+
TargetRubyVersion: "3.2"
56
Exclude:
67
- 'bin/*'
78
- 'gemfiles/**/*'

Appraisals

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

3-
appraise "ar-61" do
4-
gem "activerecord", "~> 6.1.1"
5-
6-
# Fix:
7-
# warning: mutex_m was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0.
8-
# Add mutex_m to your Gemfile or gemspec.
9-
install_if '-> { Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0") }' do
10-
gem 'base64'
11-
gem 'mutex_m'
12-
end
13-
end
14-
15-
appraise "ar-70" do
16-
gem "activerecord", "~> 7.0.0"
17-
18-
# Fix:
19-
# warning: mutex_m was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0.
20-
# Add mutex_m to your Gemfile or gemspec.
21-
install_if '-> { Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0") }' do
22-
gem 'mutex_m'
23-
end
24-
end
25-
263
appraise "ar-71" do
274
gem "activerecord", "~> 7.1.0"
285
end
296

7+
appraise "ar-72" do
8+
gem "activerecord", "~> 7.2.0"
9+
end
10+
3011
appraise "ar-80" do
3112
gem "activerecord", "~> 8.0.0"
3213
end

gemfiles/ar_61.gemfile

Lines changed: 0 additions & 28 deletions
This file was deleted.

gemfiles/ar_70.gemfile renamed to gemfiles/ar_72.gemfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
source "https://rubygems.org"
44

55
gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git"
6-
gem "activerecord", "~> 7.0.0"
6+
gem "activerecord", "~> 7.2.0"
77
gem "bundler", ">= 2.1.4"
88
gem "m"
99
gem "mini_racer", "~> 0.12.0"
@@ -20,8 +20,4 @@ gem "guard-minitest", "~> 2.0", require: false
2020
gem "rubocop", ">= 0.69", require: false
2121
gem "rubocop-discourse", ">= 3", require: false
2222

23-
install_if -> { Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0") } do
24-
gem "mutex_m"
25-
end
26-
2723
gemspec path: "../"

prometheus_exporter.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
1515
spec.homepage = "https://github.com/discourse/prometheus_exporter"
1616
spec.license = "MIT"
1717

18-
spec.required_ruby_version = ">= 3.0.0"
18+
spec.required_ruby_version = ">= 3.2.0"
1919

2020
spec.files = Dir['README.md', 'CHANGELOG', 'LICENSE.txt', 'lib/**/*.rb', 'exe/*']
2121

0 commit comments

Comments
 (0)