Skip to content

Commit bb9b82e

Browse files
authored
Merge pull request #21 from cookpad/upgrade-supported-versions
Support Ruby 3.4 and ActiveRecord 7.2
2 parents dbe7912 + 4688564 commit bb9b82e

File tree

8 files changed

+33
-11
lines changed

8 files changed

+33
-11
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,27 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
ruby:
14-
- 2.7
15-
- 3.0
1614
- 3.1
15+
- 3.2
16+
- 3.3
17+
- 3.4
1718
env:
1819
- ARMG_TEST_MYSQL_PORT=10056 ARMG_TEST_MYSQL_ENGINE=MyISAM
1920
- ARMG_TEST_MYSQL_PORT=10057 ARMG_TEST_MYSQL_ENGINE=MyISAM
2021
- ARMG_TEST_MYSQL_PORT=10057 ARMG_TEST_MYSQL_ENGINE=InnoDB
2122
- ARMG_TEST_MYSQL_PORT=10080 ARMG_TEST_MYSQL_ENGINE=MyISAM
2223
- ARMG_TEST_MYSQL_PORT=10080 ARMG_TEST_MYSQL_ENGINE=InnoDB
2324
gemfile:
24-
- gemfiles/ar60.gemfile
25-
- gemfiles/ar61.gemfile
2625
- gemfiles/ar70.gemfile
26+
- gemfiles/ar71.gemfile
27+
- gemfiles/ar72.gemfile
2728

2829
steps:
29-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v4
3031
- uses: ruby/setup-ruby@v1
3132
with:
3233
ruby-version: ${{ matrix.ruby }}
33-
- uses: actions/cache@v2
34+
- uses: actions/cache@v4
3435
with:
3536
path: gemfiles/vendor/bundle
3637
key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ hashFiles('ridgepole.gemspec', '**/Gemfile', matrix.gemfile) }}
@@ -39,7 +40,7 @@ jobs:
3940
4041
- name: Setup dependencies
4142
run: |
42-
for i in {1..60}; do docker-compose up -d && break; sleep 1; done
43+
for i in {1..60}; do docker compose up -d && break; sleep 1; done
4344
4445
gem install bundler
4546
bundle config path vendor/bundle

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
88

99
### Added
1010

11+
- Support ActiveRecord 7.1 and 7.2 [#21](https://github.com/cookpad/armg/pull/21)
12+
- Support Ruby 3.2, 3.3, and 3.4 [#21](https://github.com/cookpad/armg/pull/21)
13+
1114
### Changed
1215

1316
### Deprecated
1417

1518
### Removed
1619

20+
- Drop support for ActiveRecord 6.0 and 6.1 [#21](https://github.com/cookpad/armg/pull/21)
21+
- Drop support for Ruby 2.7 and 3.0 [#21](https://github.com/cookpad/armg/pull/21)
22+
1723
### Fixed
1824

1925
### Security

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,13 @@ Apply `Schemafile`
155155
No change
156156
```
157157

158-
## Limitation on MySQL 8.0
158+
## Supported versions
159+
160+
- Ruby 3.1 to 3.4
161+
- ActiveRecord 7.0 to 7.2
162+
- MySQL 5.6 to 8.0
163+
164+
### Limitation on MySQL 8.0
159165

160166
At the moment, armg gem supports only SRIDs with long-lat axis order in MySQL 8.0.
161167
e.g. SRID=3857 (WGS 84 / Pseudo-Mercator -- Spherical Mercator, Google Maps, OpenStreetMap, Bing, ArcGIS, ESRI)

armg.gemspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ Gem::Specification.new do |spec|
2626
spec.add_dependency 'activerecord', '>= 6', '< 8'
2727
spec.add_dependency 'rgeo'
2828
spec.add_development_dependency 'appraisal', '>= 2.2.0'
29+
spec.add_development_dependency 'base64'
30+
spec.add_development_dependency 'bigdecimal'
2931
spec.add_development_dependency 'bundler'
3032
spec.add_development_dependency 'erbh', '>= 0.1.2'
33+
spec.add_development_dependency 'mutex_m'
3134
spec.add_development_dependency 'mysql2'
3235
spec.add_development_dependency 'rake'
3336
spec.add_development_dependency 'rspec', '~> 3.0'

gemfiles/ar70.gemfile

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

55
gem "activerecord", "~> 7.0.0"
6+
gem "concurrent-ruby", "1.3.4" # https://stackoverflow.com/questions/79360526
67

78
gemspec path: "../"

gemfiles/ar60.gemfile renamed to gemfiles/ar71.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
source "https://rubygems.org"
44

5-
gem "activerecord", "~> 6.0.0"
5+
gem "activerecord", "~> 7.1.0"
66

77
gemspec path: "../"

gemfiles/ar61.gemfile renamed to gemfiles/ar72.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
source "https://rubygems.org"
44

5-
gem "activerecord", "~> 6.1.0"
5+
gem "activerecord", "~> 7.2.0"
66

77
gemspec path: "../"

spec/mysql_helper.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ def reset
2121

2222
def dump
2323
buf = StringIO.new
24-
ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, buf)
24+
if ActiveRecord.version >= Gem::Version.new('7.2')
25+
ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection_pool, buf)
26+
else
27+
ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, buf)
28+
end
29+
2530
buf = buf.string.sub(/\A.*\bActiveRecord::Schema(?:\[[\d.]+\])?\.define\(version: \d+\) do/m, '').sub(/end\s*\z/, '')
2631
schema = buf.lines.map { |l| l.sub(/\A /, '') }.join.strip
2732

0 commit comments

Comments
 (0)